Class JobRunReport
- Namespace
- Quartz
- Assembly
- Quartz.dll
A job's report of what its run achieved: set it as Result.
public sealed record JobRunReport : IJobRunReport, IEquatable<JobRunReport>
- Inheritance
-
JobRunReport
- Implements
- Inherited Members
Remarks
context.Result = JobRunReport.Skipped("no stale reservations").With("released", 0);
To have the scheduler act on a failure — retry it, run OnFailure continuations — throw. A
reported Failed is history only.
Fields
MaxMetricsLength
The longest the Metrics may be as JSON: 4,000 characters. A larger object is
dropped whole, and log event 1059 says so.
public const int MaxMetricsLength = 4000
Field Value
Remarks
The JSON escapes every character outside ASCII, so the limit is also 4,000 bytes.
MaxSummaryLength
The longest Summary the history keeps: 1,000 characters. A longer one is cut, never between the two halves of a surrogate pair.
public const int MaxSummaryLength = 1000
Field Value
Properties
Metrics
Named values the run measured, or null. Recorded as one JSON object of at most MaxMetricsLength characters; a larger one, or one with a value that throws while it is written, is dropped whole and the run is recorded without it.
public IReadOnlyDictionary<string, object?>? Metrics { get; init; }
Property Value
Remarks
A value is written as a JSON string, number, boolean or null: numbers stay numbers (a non-finite
double or float is a string), dates are round-trip ("O")
strings, a TimeSpan is its constant ("c") form, an enum is its name, and
anything else is its invariant-culture text. A value whose text throws drops the metrics, with log
event 1060; the run is still recorded.
Result
What the run achieved.
public JobRunResult Result { get; init; }
Property Value
Summary
One line for a reader of the history, or null. Cut to MaxSummaryLength characters when recorded.
public string? Summary { get; init; }
Property Value
Methods
Failed(string?)
A report that the run failed, recorded in the history only.
public static JobRunReport Failed(string? summary = null)
Parameters
Returns
Remarks
The scheduler does not retry it, run OnFailure continuations for it, or count it against a
retry policy. To have the scheduler act on a failure, throw.
Skipped(string?)
A report that the run found nothing to do. It counts as a success.
public static JobRunReport Skipped(string? summary = null)
Parameters
Returns
Succeeded(string?)
A report that the run did its work.
public static JobRunReport Succeeded(string? summary = null)
Parameters
Returns
With(string, object?)
A copy of this report with one more metric. A name already present takes the new value.
public JobRunReport With(string name, object? value)
Parameters
Returns
- JobRunReport
A new report; this one is unchanged.