1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
//! Aggregated per-provider view. Built by [`super::ProviderMetrics::all_snapshots`].
use ;
/// Aggregated statistics for one provider across its retained request history.
///
/// All percentiles use the simple `(n * pct) as usize` index method; for the
/// rolling 1000-entry buffer this is accurate to well within 1%.
///
/// # Examples
///
/// ```rust
/// use codetether_agent::telemetry::ProviderSnapshot;
///
/// let s = ProviderSnapshot {
/// provider: "openai".into(),
/// request_count: 0,
/// total_input_tokens: 0,
/// total_output_tokens: 0,
/// avg_tps: 0.0,
/// avg_latency_ms: 0.0,
/// p50_tps: 0.0,
/// p50_latency_ms: 0.0,
/// p95_tps: 0.0,
/// p95_latency_ms: 0.0,
/// };
/// assert_eq!(s.provider, "openai");
/// ```