< Summary - Heimdall API

Information
Class: ArturRios.Heimdall.WebApi.Retention.ScheduledPassResult
Assembly: ArturRios.Heimdall.WebApi
File(s): /home/ci/agent/workspace/heimdall-api-docs_main/app/src/Presentation/ArturRios.Heimdall.WebApi/Retention/ScheduledPassResult.cs
Line coverage
100%
Covered lines: 6
Uncovered lines: 0
Coverable lines: 6
Total lines: 27
Line coverage: 100%
Branch coverage
100%
Covered branches: 2
Total branches: 2
Branch coverage: 100%
Method coverage
100%
Covered methods: 3
Fully covered methods: 3
Total methods: 3
Method coverage: 100%
Full method coverage: 100%

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
get_Summary()100%11100%
get_Quiet()100%11100%
Failure(...)100%22100%

File(s)

/home/ci/agent/workspace/heimdall-api-docs_main/app/src/Presentation/ArturRios.Heimdall.WebApi/Retention/ScheduledPassResult.cs

#LineLine coverage
 1namespace ArturRios.Heimdall.WebApi.Retention;
 2
 3/// <summary>What one run of a <see cref="ScheduledPassService" /> pass did.</summary>
 4/// <param name="Summary">
 5///     The line to log: the outcome of a run that changed something, the errors of one that failed, or
 6///     <c>null</c> for a clean run with nothing worth saying.
 7/// </param>
 8/// <param name="Failed">
 9///     Whether the pass's command reported failure. A failed run is logged at Error with
 10///     <see cref="ScheduledPassService.FailureMarker" /> and does not count as a success.
 11/// </param>
 12/// <param name="RowsProcessed">The rows the pass reports having changed, for the rows-processed counter.</param>
 9413public sealed record ScheduledPassResult(string? Summary, bool Failed = false, long RowsProcessed = 0)
 14{
 15    /// <summary>A run that did nothing worth reporting.</summary>
 116    public static ScheduledPassResult Quiet => new(null, false);
 17
 18    /// <summary>
 19    ///     A failed run, described by the command's errors, with the rows it changed before it failed —
 20    ///     a pass that drains in batches (#206) may have finished several before one failed.
 21    /// </summary>
 22    public static ScheduledPassResult Failure(string summary, IEnumerable<string> errors, long rowsProcessed = 0) =>
 623        new(
 624            $"{summary} failed: {string.Join("; ", errors)}" +
 625            (rowsProcessed > 0 ? $". It had processed {rowsProcessed} rows before failing" : ""),
 626            true, rowsProcessed);
 27}