Skip to content

RunStatistics

Namespace AgentPrism · Assembly AgentPrism.Abstractions.dll

A summary of the runs in a time range.

public sealed record RunStatistics : IEquatable<RunStatistics>

objectRunStatistics

IEquatable<RunStatistics>

object.GetType(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()

Token totals cover only runs that reported usage information. If a provider does not return usage, that run is counted but contributes nothing to the token total.

Cost is populated only when pricing is configured — see TotalCost. Pricing is not embedded in AgentPrism: it comes from the model catalog or the AgentPrism:Pricing configuration.

public RunStatistics()

The audio input tokens. Counted INSIDE InputTokens.

public long AudioInputTokens { get; init; }

long

The audio output tokens. Counted INSIDE OutputTokens.

public long AudioOutputTokens { get; init; }

long

The number of runs awaiting human input.

public long AwaitingInputRuns { get; init; }

long

Occurs only in workflow runs. Counted separately because such a run is neither running nor settled; forcing it into one bucket would make the subtotals not add up to TotalRuns.

The breakdown by agent.

public IReadOnlyList<RunAgentStatistics> ByAgent { get; init; }

IReadOnlyList<RunAgentStatistics>

The breakdown by error class. Only runs that ended in an error are counted. Rows written before the error class was added appear in the Unknown bucket (past rows are not backfilled).

public IReadOnlyList<RunErrorStatistics> ByErrorClass { get; init; }

IReadOnlyList<RunErrorStatistics>

The breakdown by label. One entry per distinct key/value pair, so a run carrying three labels contributes to three entries.

public IReadOnlyList<RunLabelStatistics> ByLabel { get; init; }

IReadOnlyList<RunLabelStatistics>

The entries therefore do not sum to TotalRuns, unlike RunStatistics.ByAgent: a label set is not a partition of the runs. Bounded by RunStatisticsQuery.MaxAgents.

The breakdown by model. Runs with an unknown model name do not appear in this list; they are still counted in the totals.

public IReadOnlyList<RunModelStatistics> ByModel { get; init; }

IReadOnlyList<RunModelStatistics>

The breakdown by user. Runs that carry no user identity do not appear in this list; they are still counted in the totals.

public IReadOnlyList<RunUserStatistics> ByUser { get; init; }

IReadOnlyList<RunUserStatistics>

Bounded by RunStatisticsQuery.MaxAgents, users with the highest run count first. Rows written before the column existed carry no user and therefore never appear here (no backfill).

The breakdown by definition version. Runs with an unknown version do not appear in this list.

public IReadOnlyList<RunVersionStatistics> ByVersion { get; init; }

IReadOnlyList<RunVersionStatistics>

The input tokens that were served from the prompt cache. Counted INSIDE InputTokens, so the two must not be added together.

public long CachedInputTokens { get; init; }

long

Runs whose provider does not report cache usage contribute nothing here, exactly as a run that reports no usage contributes nothing to RunStatistics.TotalTokens.

The number of cancelled runs.

public required long CanceledRuns { get; init; }

long

The number of runs that completed successfully.

public required long CompletedRuns { get; init; }

long

The currency. Populated when TotalCost is populated.

public string? Currency { get; init; }

string?

The error rate among settled runs (0–1). null if no run has settled.

public double? ErrorRate { get; }

double?

The denominator is settled runs, not TotalRuns. Whether a run in progress will succeed or fail is not yet known; including it in the denominator would artificially lower the rate.

The number of runs that ended in an error.

public required long FailedRuns { get; init; }

long

The total input tokens.

public long InputTokens { get; init; }

long

The total output tokens.

public long OutputTokens { get; init; }

long

The positive rate among RunScoreKind.Binary scores (0–1). Star ratings are not included in this rate — averaging the two kinds would be meaningless. null if there is no binary score.

public double? PositiveRate { get; init; }

double?

The tokens spent on reasoning. Counted INSIDE OutputTokens.

public long ReasoningTokens { get; init; }

long

The number of runs still running.

public required long RunningRuns { get; init; }

long

The number of runs whose model is known but whose pricing is undefined.

public long RunsWithUnknownPricing { get; init; }

long

The number of runs that received at least one RunScore (at the run or message level). Eval runs (RunKind.Eval) are excluded for the same reason as TotalRuns.

public long ScoredRuns { get; init; }

long

The total cost. If a model has undefined pricing, that model’s run costs are not included in this total (only runs with known pricing are summed); the number of runs excluded appears in RunsWithUnknownPricing. null if no run was ever priced.

public decimal? TotalCost { get; init; }

decimal?

The total number of runs matching the filter.

public required long TotalRuns { get; init; }

long

The total tokens.

public long TotalTokens { get; init; }

long

public override bool Equals(object? obj)

obj object?

bool

public bool Equals(RunStatistics? other)

other RunStatistics?

bool

public override int GetHashCode()

int

public override string ToString()

string

operator ==(RunStatistics?, RunStatistics?)

Section titled “ operator ==(RunStatistics?, RunStatistics?)”
public static bool operator ==(RunStatistics? left, RunStatistics? right)

left RunStatistics?

right RunStatistics?

bool

operator !=(RunStatistics?, RunStatistics?)

Section titled “ operator !=(RunStatistics?, RunStatistics?)”
public static bool operator !=(RunStatistics? left, RunStatistics? right)

left RunStatistics?

right RunStatistics?

bool