canic_core/ops/
metrics.rs1pub use crate::model::metrics::{
2 HttpMetricEntry, HttpMetrics, HttpMetricsSnapshot, IccMetricEntry, IccMetrics,
3 IccMetricsSnapshot, MetricsReport, SystemMetricEntry, SystemMetricKind, SystemMetrics,
4 SystemMetricsSnapshot, TimerMetricEntry, TimerMetrics, TimerMetricsSnapshot,
5};
6
7pub struct MetricsOps;
13
14impl MetricsOps {
15 #[must_use]
17 pub fn system_snapshot() -> SystemMetricsSnapshot {
18 SystemMetrics::snapshot()
19 }
20
21 #[must_use]
23 pub fn http_snapshot() -> HttpMetricsSnapshot {
24 HttpMetrics::snapshot()
25 }
26
27 #[must_use]
29 pub fn icc_snapshot() -> IccMetricsSnapshot {
30 IccMetrics::snapshot()
31 }
32
33 #[must_use]
35 pub fn timer_snapshot() -> TimerMetricsSnapshot {
36 TimerMetrics::snapshot()
37 }
38
39 #[must_use]
41 pub fn report() -> MetricsReport {
42 MetricsReport {
43 system: Self::system_snapshot(),
44 http: Self::http_snapshot(),
45 icc: Self::icc_snapshot(),
46 timer: Self::timer_snapshot(),
47 }
48 }
49}