API Reference
Class
RunMonitor
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 ForEach-ConsoleItem use it; other runners can too.
Inheritance
- Object
- RunMonitor
Constructors
public RunMonitor(Int32 total, RunOptions? options = null) #Starts showing a run.
Parameters
- total System.Int32
- The number of items.
- options ConsoleMonster.Live.RunOptions? = null
- Options, or null for the defaults.
Methods
public Void Complete() #Returns:
VoidThe run ended: items never started count as skipped; the live view keeps its final frame, printed runs end with a summary.
public Void Dispose() #Returns:
VoidPerforms application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public Void Finished(Int32 index, StatusKind outcome, String label, TimeSpan duration, String? message = null, Boolean timedOut = false) #Returns:
VoidAn item finished.
Parameters
- index System.Int32
- Its position (0-based).
- outcome ConsoleMonster.Styling.StatusKind
- Pass, Fail, Warn or Skip.
- label System.String
- Its label.
- duration System.TimeSpan
- How long it took.
- message System.String? = null
- The error message of a failed item, or null.
- timedOut System.Boolean = false
- Whether it ran out of time.
public String LabelOf(Object? item) #Returns:
StringThe label of an item: RunOptions.Label, otherwise its title.
Parameters
- item System.Object?
- The item.
Returns
The label.
public Void Started(Int32 index, String label) #Returns:
VoidAn item started.
Parameters
- index System.Int32
- Its position (0-based).
- label System.String
- Its label.
Inherited Methods
public virtual Boolean Equals(Object? obj) #Returns:
BooleanInherited from Object
Parameters
- obj Object?
Properties
public LiveSession? Session { get; } #The live session, or null when the run is printed.