RunStatistics
AgentPrism.Abstractions.dllA summary of the runs in a time range.
public sealed record RunStatistics : IEquatable<RunStatistics>Inheritance
Section titled “Inheritance”Implements
Section titled “Implements”Inherited Members
Section titled “Inherited Members”object.GetType(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()
Remarks
Section titled “Remarks”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.
Constructors
Section titled “Constructors”RunStatistics()
Section titled “ RunStatistics()”public RunStatistics()Properties
Section titled “Properties”AudioInputTokens
Section titled “ AudioInputTokens”The audio input tokens. Counted INSIDE InputTokens.
public long AudioInputTokens { get; init; }Property Value
Section titled “Property Value”AudioOutputTokens
Section titled “ AudioOutputTokens”The audio output tokens. Counted INSIDE OutputTokens.
public long AudioOutputTokens { get; init; }Property Value
Section titled “Property Value”AwaitingInputRuns
Section titled “ AwaitingInputRuns”The number of runs awaiting human input.
public long AwaitingInputRuns { get; init; }Property Value
Section titled “Property Value”Remarks
Section titled “Remarks”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.
ByAgent
Section titled “ ByAgent”The breakdown by agent.
public IReadOnlyList<RunAgentStatistics> ByAgent { get; init; }Property Value
Section titled “Property Value”IReadOnlyList<RunAgentStatistics>
ByErrorClass
Section titled “ ByErrorClass”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; }Property Value
Section titled “Property Value”IReadOnlyList<RunErrorStatistics>
ByLabel
Section titled “ ByLabel”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; }Property Value
Section titled “Property Value”IReadOnlyList<RunLabelStatistics>
Remarks
Section titled “Remarks”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.
ByModel
Section titled “ ByModel”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; }Property Value
Section titled “Property Value”IReadOnlyList<RunModelStatistics>
ByUser
Section titled “ ByUser”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; }Property Value
Section titled “Property Value”IReadOnlyList<RunUserStatistics>
Remarks
Section titled “Remarks”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).
ByVersion
Section titled “ ByVersion”The breakdown by definition version. Runs with an unknown version do not appear in this list.
public IReadOnlyList<RunVersionStatistics> ByVersion { get; init; }Property Value
Section titled “Property Value”IReadOnlyList<RunVersionStatistics>
CachedInputTokens
Section titled “ CachedInputTokens”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; }Property Value
Section titled “Property Value”Remarks
Section titled “Remarks”Runs whose provider does not report cache usage contribute nothing here, exactly as a run that reports no usage contributes nothing to RunStatistics.TotalTokens.
CanceledRuns
Section titled “ CanceledRuns”The number of cancelled runs.
public required long CanceledRuns { get; init; }Property Value
Section titled “Property Value”CompletedRuns
Section titled “ CompletedRuns”The number of runs that completed successfully.
public required long CompletedRuns { get; init; }Property Value
Section titled “Property Value”Currency
Section titled “ Currency”The currency. Populated when TotalCost is populated.
public string? Currency { get; init; }Property Value
Section titled “Property Value”ErrorRate
Section titled “ ErrorRate”The error rate among settled runs (0–1). null if no run has settled.
public double? ErrorRate { get; }Property Value
Section titled “Property Value”Remarks
Section titled “Remarks”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.
FailedRuns
Section titled “ FailedRuns”The number of runs that ended in an error.
public required long FailedRuns { get; init; }Property Value
Section titled “Property Value”InputTokens
Section titled “ InputTokens”The total input tokens.
public long InputTokens { get; init; }Property Value
Section titled “Property Value”OutputTokens
Section titled “ OutputTokens”The total output tokens.
public long OutputTokens { get; init; }Property Value
Section titled “Property Value”PositiveRate
Section titled “ PositiveRate”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; }Property Value
Section titled “Property Value”ReasoningTokens
Section titled “ ReasoningTokens”The tokens spent on reasoning. Counted INSIDE OutputTokens.
public long ReasoningTokens { get; init; }Property Value
Section titled “Property Value”RunningRuns
Section titled “ RunningRuns”The number of runs still running.
public required long RunningRuns { get; init; }Property Value
Section titled “Property Value”RunsWithUnknownPricing
Section titled “ RunsWithUnknownPricing”The number of runs whose model is known but whose pricing is undefined.
public long RunsWithUnknownPricing { get; init; }Property Value
Section titled “Property Value”ScoredRuns
Section titled “ ScoredRuns”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; }Property Value
Section titled “Property Value”TotalCost
Section titled “ TotalCost”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; }Property Value
Section titled “Property Value”TotalRuns
Section titled “ TotalRuns”The total number of runs matching the filter.
public required long TotalRuns { get; init; }Property Value
Section titled “Property Value”TotalTokens
Section titled “ TotalTokens”The total tokens.
public long TotalTokens { get; init; }Property Value
Section titled “Property Value”Methods
Section titled “Methods”Equals(object?)
Section titled “ Equals(object?)”public override bool Equals(object? obj)Parameters
Section titled “Parameters”obj object?
Returns
Section titled “Returns”Equals(RunStatistics?)
Section titled “ Equals(RunStatistics?)”public bool Equals(RunStatistics? other)Parameters
Section titled “Parameters”other RunStatistics?
Returns
Section titled “Returns”GetHashCode()
Section titled “ GetHashCode()”public override int GetHashCode()Returns
Section titled “Returns”ToString()
Section titled “ ToString()”public override string ToString()Returns
Section titled “Returns”Operators
Section titled “Operators”operator ==(RunStatistics?, RunStatistics?)
Section titled “ operator ==(RunStatistics?, RunStatistics?)”public static bool operator ==(RunStatistics? left, RunStatistics? right)Parameters
Section titled “Parameters”left RunStatistics?
right RunStatistics?
Returns
Section titled “Returns”operator !=(RunStatistics?, RunStatistics?)
Section titled “ operator !=(RunStatistics?, RunStatistics?)”public static bool operator !=(RunStatistics? left, RunStatistics? right)Parameters
Section titled “Parameters”left RunStatistics?
right RunStatistics?