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
52
53
use crate::dto::prelude::*;
//
// Metrics DTOs
//
//
// MetricsKind
//
// Metric family selector.
//
#[derive(CandidType, Clone, Copy, Deserialize)]
pub enum MetricsKind {
System,
Icc,
Http,
Timer,
Access,
Delegation,
RootCapability,
CyclesFunding,
Perf,
}
//
// MetricEntry
//
// Unified metrics row.
//
#[derive(CandidType, Deserialize)]
pub struct MetricEntry {
// Ordered labels.
pub labels: Vec<String>,
// Optional principal dimension.
pub principal: Option<Principal>,
// Metric payload.
pub value: MetricValue,
}
//
// MetricValue
//
#[derive(CandidType, Deserialize)]
pub enum MetricValue {
Count(u64),
CountAndU64 { count: u64, value_u64: u64 },
U128(u128),
}