canic_core/dto/
metrics.rs1use crate::{dto::prelude::*, ids::AccessMetricKind};
2
3#[derive(CandidType, Clone, Debug, Deserialize, Serialize)]
9pub struct AccessMetricEntry {
10 pub endpoint: String,
11 pub kind: AccessMetricKind,
12 pub count: u64,
13}
14
15#[derive(CandidType, Clone, Debug, Deserialize, Serialize)]
20pub struct EndpointAttemptMetricEntry {
21 pub endpoint: String,
22 pub attempted: u64,
23 pub completed: u64,
24}
25
26#[derive(CandidType, Clone, Debug, Deserialize, Serialize)]
31pub struct EndpointResultMetricEntry {
32 pub endpoint: String,
33 pub ok: u64,
34 pub err: u64,
35}
36
37#[derive(CandidType, Clone, Debug, Deserialize, Serialize)]
43pub struct EndpointHealthView {
44 pub endpoint: String,
45 pub attempted: u64,
46 pub denied: u64,
47 pub completed: u64,
48 pub ok: u64,
49 pub err: u64,
50}
51
52#[derive(CandidType, Clone, Debug, Deserialize, Serialize)]
58pub struct HttpMetricEntry {
59 pub method: String,
60 pub label: String,
61 pub count: u64,
62}
63
64#[derive(CandidType, Clone, Debug, Deserialize, Serialize)]
69pub struct IccMetricEntry {
70 pub target: Principal,
71 pub method: String,
72 pub count: u64,
73}
74
75#[derive(CandidType, Clone, Debug, Deserialize, Serialize)]
80pub struct SystemMetricEntry {
81 pub kind: String,
82 pub count: u64,
83}
84
85#[derive(CandidType, Clone, Debug, Deserialize, Serialize)]
90pub struct TimerMetricEntry {
91 pub mode: String,
92 pub delay_ms: u64,
93 pub label: String,
94 pub count: u64,
95}