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