canic_core/ids/
metrics.rs1use candid::CandidType;
2use serde::{Deserialize, Serialize};
3
4#[derive(
13 CandidType, Clone, Copy, Debug, Deserialize, Eq, Hash, Ord, PartialEq, PartialOrd, Serialize,
14)]
15#[remain::sorted]
16pub enum AccessMetricKind {
17 Auth,
18 Custom,
19 Env,
20 Guard,
21 Rule,
22}
23
24impl AccessMetricKind {
25 #[must_use]
26 pub const fn as_str(self) -> &'static str {
27 match self {
28 Self::Auth => "auth",
29 Self::Custom => "custom",
30 Self::Env => "env",
31 Self::Guard => "guard",
32 Self::Rule => "rule",
33 }
34 }
35}
36
37#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
42#[remain::sorted]
43pub enum SystemMetricKind {
44 CanisterCall,
45 CanisterStatus,
46 CreateCanister,
47 DeleteCanister,
48 DepositCycles,
49 HttpOutcall,
50 InstallCode,
51 RawRand,
52 ReinstallCode,
53 TimerScheduled,
54 UninstallCode,
55 UpdateSettings,
56 UpgradeCode,
57}