Package-level declarations

Types

Link copied to clipboard
@Serializable
value class MetricKey<out Metric>(val id: String)

Typed key for identifying a metric within a MetricsMap.

Link copied to clipboard
@Serializable(with = MetricsMapSerializer::class)
class MetricsMap(map: MutableMap<MetricKey<Metric>, Metric> = mutableMapOf())

A mutable, typed wrapper around Map<MetricKey<*>, Metric>.

Link copied to clipboard
object MetricsMapSerializer : KSerializer<MetricsMap>

KSerializer that encodes a MetricsMap as a plain map of metric-key id to polymorphic Metric.

Functions

Link copied to clipboard

Collect all AgentRunRecords (both completed and failed), recursively through stages.

Link copied to clipboard

true if any leaf in this subtree performed at least one retry.

Link copied to clipboard

Return the average of the list, or null if the list is empty.

Link copied to clipboard

Get the consumption of any record.

Link copied to clipboard

Count substages that are completed successfully (no failure).

Link copied to clipboard

Count substages that are failed (stages with failure, or failed leaf records).

Link copied to clipboard

Count substages that have finished, regardless of failures.

Link copied to clipboard

Dataset iteration metrics: standard + dataset-specific solved rate + agent run stats + solved-aware consumption.

Link copied to clipboard

Keep only finished substages: leaves are atomic so they always pass, stages pass only when StageRecord.isFinished. Intended for aggregate metrics that would otherwise include an in-flight stage's partial state (consumption/solved counts/etc.) in the roll-up.

Link copied to clipboard

Wall-clock per finished substage. Stage substages contribute StageRecord.realElapsed (only once finished, since a running stage's live value would skew avg / max); leaf substages contribute aggregatedElapsedTime (final attempt + retries + retry wait delays) — the real cost a downstream avgPerFinishedSubstage / ETC projection should reflect.

Link copied to clipboard

Check if a record (or its substages recursively) contains any solved agent run.

Link copied to clipboard

Root stage metrics: standard + cross-stage summary metrics.

Link copied to clipboard

Standard metrics for any stage: elapsed time, substage counts, consumption, failures, retry stats.

Link copied to clipboard

Collect a specific metric from all substage StageRecords that have it.

Link copied to clipboard

Get a double value from a specific metric in substages, for min/max/avg aggregation.

Link copied to clipboard

Sum consumption across all substages, skipping NA values.

Link copied to clipboard

Retry-attempt consumption only (excludes the final attempt), summed across substages.

Link copied to clipboard

Final attempt + retry attempts, summed across substages.

Link copied to clipboard

Retry-attempt elapsed + retry wait delays (excludes the final attempt), summed across substages.

Link copied to clipboard

Final attempt + retry attempts + retry wait delays, summed across substages.