Skip to content
ConsoleMonster

API Reference

Class

RunTracker

Namespace ConsoleMonster.Live
Assembly ConsoleMonster
Modifiers sealed

The state of a run of many items (ConsoleRun, ForEach-ConsoleItem), safe to update from any thread: each item is pending, running or finished with an outcome; failures keep their message. RunView draws it.

Inheritance

  • Object
  • RunTracker

Usage

Explore 2 API references to this type

This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.

Returned or exposed by 1

Accepted by parameters 1

Constructors

public RunTracker(Int32 total, Func<TimeSpan>? clock = null) #

Creates a tracker.

Parameters

total System.Int32 requiredposition: 0
The number of items.
clock System.Func<System.TimeSpan>? = null optionalposition: 1
The run clock, or null for a stopwatch started now.

Methods

public Void Complete() #
Returns: Void

The run ended: items never started count as skipped and the clock stops.

public Void Finished(Int32 index, StatusKind outcome, String label, String? message = null, Boolean timedOut = false) #
Returns: Void

An item finished.

Parameters

index System.Int32 requiredposition: 0
The item's position (0-based).
outcome ConsoleMonster.Styling.StatusKind requiredposition: 1
Pass, Fail, Warn or Skip.
label System.String requiredposition: 2
Its label (for the failures list).
message System.String? = null optionalposition: 3
The error message of a failed item, or null.
timedOut System.Boolean = false optionalposition: 4
Whether it ran out of time.
public RunSnapshot Snapshot() #
Returns: RunSnapshot

A consistent copy of the state, for drawing on another thread.

Returns

The snapshot.

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

An item started.

Parameters

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

Properties

public Int32 Total { get; } #

The number of items.