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 ManagementCall,
29 Perf,
30 PlatformCall,
31 Pool,
32 Provisioning,
33 Replay,
34 RootCapability,
35 Scaling,
36 #[cfg(feature = "sharding")]
37 Sharding,
38 System,
39 Timer,
40 WasmStore,
41}
42
43#[derive(CandidType, Deserialize)]
50pub struct MetricEntry {
51 pub labels: Vec<String>,
53
54 pub principal: Option<Principal>,
56
57 pub value: MetricValue,
59}
60
61#[derive(CandidType, Deserialize)]
66pub enum MetricValue {
67 Count(u64),
68 CountAndU64 { count: u64, value_u64: u64 },
69 U128(u128),
70}
71
72#[derive(CandidType, Deserialize)]
79pub struct QueryPerfSample<T> {
80 pub value: T,
82
83 pub local_instructions: u64,
85}