aggregator
aggregator
¶
Read-only telemetry aggregation — query stored inference records.
Classes¶
ModelStats
dataclass
¶
ModelStats(
model_id: str = "",
call_count: int = 0,
total_tokens: int = 0,
prompt_tokens: int = 0,
prompt_tokens_evaluated: int = 0,
completion_tokens: int = 0,
total_latency: float = 0.0,
avg_latency: float = 0.0,
total_cost: float = 0.0,
avg_ttft: float = 0.0,
total_energy_joules: float = 0.0,
avg_gpu_utilization_pct: float = 0.0,
avg_throughput_tok_per_sec: float = 0.0,
avg_tokens_per_joule: float = 0.0,
avg_energy_per_output_token_joules: float = 0.0,
avg_throughput_per_watt: float = 0.0,
total_prefill_energy_joules: float = 0.0,
total_decode_energy_joules: float = 0.0,
avg_mean_itl_ms: float = 0.0,
avg_median_itl_ms: float = 0.0,
avg_p95_itl_ms: float = 0.0,
)
Aggregated statistics for a single model.
EngineStats
dataclass
¶
EngineStats(
engine: str = "",
call_count: int = 0,
total_tokens: int = 0,
total_latency: float = 0.0,
avg_latency: float = 0.0,
total_cost: float = 0.0,
avg_ttft: float = 0.0,
total_energy_joules: float = 0.0,
avg_gpu_utilization_pct: float = 0.0,
avg_throughput_tok_per_sec: float = 0.0,
avg_tokens_per_joule: float = 0.0,
avg_energy_per_output_token_joules: float = 0.0,
avg_throughput_per_watt: float = 0.0,
total_prefill_energy_joules: float = 0.0,
total_decode_energy_joules: float = 0.0,
avg_mean_itl_ms: float = 0.0,
avg_median_itl_ms: float = 0.0,
avg_p95_itl_ms: float = 0.0,
)
Aggregated statistics for a single engine backend.
AggregatedStats
dataclass
¶
AggregatedStats(
total_calls: int = 0,
total_tokens: int = 0,
total_cost: float = 0.0,
total_latency: float = 0.0,
total_energy_joules: float = 0.0,
avg_throughput_tok_per_sec: float = 0.0,
avg_gpu_utilization_pct: float = 0.0,
avg_energy_per_output_token_joules: float = 0.0,
avg_throughput_per_watt: float = 0.0,
total_prefill_energy_joules: float = 0.0,
total_decode_energy_joules: float = 0.0,
avg_mean_itl_ms: float = 0.0,
avg_median_itl_ms: float = 0.0,
avg_p95_itl_ms: float = 0.0,
per_model: List[ModelStats] = list(),
per_engine: List[EngineStats] = list(),
)
Top-level summary combining per-model and per-engine stats.
TelemetryAggregator
¶
Read-only query layer over the telemetry SQLite database.
Source code in src/diapason/telemetry/aggregator.py
Methods:¶
per_batch_stats
¶
per_batch_stats(
*,
since: Optional[float] = None,
until: Optional[float] = None,
exclude_warmup: bool = False,
) -> List[Dict[str, Any]]
Aggregate telemetry by batch_id.
Returns list of dicts with batch_id, total_requests, total_tokens, total_energy_joules, energy_per_token_joules.