Skip to content
ConsoleMonster

API Reference

Class

RunMonitor

Namespace ConsoleMonster.Live
Assembly ConsoleMonster
Implements
IDisposable
Modifiers sealed

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 requiredposition: 0
The number of items.
options ConsoleMonster.Live.RunOptions? = null optionalposition: 1
Options, or null for the defaults.

Methods

public Void Complete() #
Returns: Void

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() #
Returns: Void

Performs 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: Void

An item finished.

Parameters

index System.Int32 requiredposition: 0
Its position (0-based).
outcome ConsoleMonster.Styling.StatusKind requiredposition: 1
Pass, Fail, Warn or Skip.
label System.String requiredposition: 2
Its label.
duration System.TimeSpan requiredposition: 3
How long it took.
message System.String? = null optionalposition: 4
The error message of a failed item, or null.
timedOut System.Boolean = false optionalposition: 5
Whether it ran out of time.
public String LabelOf(Object? item) #
Returns: String

The label of an item: RunOptions.Label, otherwise its title.

Parameters

item System.Object? requiredposition: 0
The item.

Returns

The label.

public Void Started(Int32 index, String label) #
Returns: Void

An item started.

Parameters

index System.Int32 requiredposition: 0
Its position (0-based).
label System.String requiredposition: 1
Its label.

Properties

public RunTracker Tracker { get; } #

The run's state.

public Boolean IsLive { get; } #

Whether the live view is showing.

public LiveSession? Session { get; } #

The live session, or null when the run is printed.