canic_core/dto/
metrics.rs1use crate::dto::prelude::*;
2
3#[derive(CandidType, Clone, Copy, Deserialize)]
14#[remain::sorted]
15pub enum MetricsKind {
16 Access,
17 Auth,
18 CanisterOps,
19 Cascade,
20 CyclesFunding,
21 CyclesTopup,
22 DelegatedAuth,
23 Directory,
24 Http,
25 Icc,
26 Lifecycle,
27 Perf,
28 Pool,
29 Replay,
30 RootCapability,
31 Scaling,
32 #[cfg(feature = "sharding")]
33 Sharding,
34 System,
35 Timer,
36 WasmStore,
37}
38
39#[derive(CandidType, Deserialize)]
46pub struct MetricEntry {
47 pub labels: Vec<String>,
49
50 pub principal: Option<Principal>,
52
53 pub value: MetricValue,
55}
56
57#[derive(CandidType, Deserialize)]
62pub enum MetricValue {
63 Count(u64),
64 CountAndU64 { count: u64, value_u64: u64 },
65 U128(u128),
66}
67
68#[derive(CandidType, Deserialize)]
75pub struct QueryPerfSample<T> {
76 pub value: T,
78
79 pub local_instructions: u64,
81}