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 Intent,
26 InterCanisterCall,
27 Lifecycle,
28 Perf,
29 PlatformCall,
30 Pool,
31 Provisioning,
32 Replay,
33 RootCapability,
34 Scaling,
35 #[cfg(feature = "sharding")]
36 Sharding,
37 System,
38 Timer,
39 WasmStore,
40}
41
42#[derive(CandidType, Deserialize)]
49pub struct MetricEntry {
50 pub labels: Vec<String>,
52
53 pub principal: Option<Principal>,
55
56 pub value: MetricValue,
58}
59
60#[derive(CandidType, Deserialize)]
65pub enum MetricValue {
66 Count(u64),
67 CountAndU64 { count: u64, value_u64: u64 },
68 U128(u128),
69}
70
71#[derive(CandidType, Deserialize)]
78pub struct QueryPerfSample<T> {
79 pub value: T,
81
82 pub local_instructions: u64,
84}