forked from torrust/torrust-tracker
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathmod.rs
More file actions
28 lines (21 loc) · 763 Bytes
/
mod.rs
File metadata and controls
28 lines (21 loc) · 763 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
pub mod event;
pub mod metrics;
pub mod persisted;
pub mod repository;
use metrics::Metrics;
use torrust_tracker_metrics::metric::description::MetricDescription;
use torrust_tracker_metrics::metric_name;
use torrust_tracker_metrics::unit::Unit;
// Torrent metrics
const TRACKER_CORE_PERSISTENT_TORRENTS_DOWNLOADS_TOTAL: &str = "tracker_core_persistent_torrents_downloads_total";
#[must_use]
pub fn describe_metrics() -> Metrics {
let mut metrics = Metrics::default();
// Torrent metrics
metrics.metric_collection.describe_counter(
&metric_name!(TRACKER_CORE_PERSISTENT_TORRENTS_DOWNLOADS_TOTAL),
Some(Unit::Count),
Some(MetricDescription::new("The total number of torrent downloads (persisted).")),
);
metrics
}