RunMonitor
ConsoleMonster.Live
Shows a run of many items while it happens: the live RunView on an interactive terminal, or one line per finished item (and a summary at the end) in redirected output and CI. Safe to call from any thread. ConsoleRun.ForEachAsync and Invoke-ConsoleRun use it; other runners can too.
Inheritance
- object
- RunMonitor
Constructors
public RunMonitor(int total, RunOptions? options = null) #Starts showing a run.
Parameters
- total int
- The number of items.
- options ConsoleMonster.Live.RunOptions? = null
- Options, or null for the defaults.
Methods
public void Complete() #The run ended: items never started count as skipped; the live view keeps its final frame, printed runs end with a summary.
public void Dispose() #Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public void Finished(int index, StatusKind outcome, string label, TimeSpan duration, string? message = null, bool timedOut = false) #An item finished.
Parameters
- index int
- Its position (0-based).
- outcome ConsoleMonster.Styling.StatusKind
- Pass, Fail, Warn, Skip, Error, Investigate or NotRun.
- label string
- Its label.
- duration System.TimeSpan
- How long it took.
- message string? = null
- The error message of a failed item, or null.
- timedOut bool = false
- Whether it ran out of time.
public string LabelOf(object? item) #The label of an item: RunOptions.Label, otherwise its title.
Parameters
- item object?
- The item.
Returns
string The label.public void Retrying(int index, string label, int attempt, string? message = null) #An item failed and runs again: it stays running, its cell shows the retry and the summary counts it.
Parameters
- index int
- Its position (0-based).
- label string
- Its label.
- attempt int
- The attempt about to start (2 for the first retry).
- message string? = null
- Why the previous attempt failed.
public void Started(int index, string label) #An item started.
Parameters
- index int
- Its position (0-based).
- label string
- Its label.
Inherited Methods
Properties
public LiveSession? Session { get; } #The live session, or null when the run is printed.