Skip to content
ConsoleMonster
Class

AttentionTally

ConsoleMonster.Frames

Namespace
ConsoleMonster.Frames
Assembly
ConsoleMonster
Modifiers
sealed

Counts attention findings as rows go by, keeping a total and the first few identities per state and reason, so the summary of a streamed or very large result can name what is wrong without holding every row. Memory grows with the number of distinct reasons, not with the number of rows, so keep reasons generic and put what is specific to one row (an error code, a path) in its identity. A tally is not thread-safe; use one per stream.

Inheritance

  • object
  • AttentionTally

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.

Accepted by parameters 2

Constructors

public AttentionTally() #

Methods

public void Add(HealthState state, string reason, string identity) #

Counts one finding.

Parameters

state ConsoleMonster.Frames.HealthState required
The finding's state; healthy findings are not counted.
reason string required
The literal reason; findings with the same state and reason are counted together.
identity string required
What the finding is about, kept while the reason has room for samples.
public void AddTo(AttentionList list) #

Adds the findings to an attention list: a reason whose every identity was kept adds them as items, which the list groups as usual; a reason with more findings than samples becomes a counted group. Each call adds them again, so call it once per list.

Parameters

list ConsoleMonster.Frames.AttentionList required
The attention list.

Properties

public int SampleSize { get; set; } #

How many identities each reason keeps (default 5).

public long Count { get; } #

How many findings were counted, over every reason.