server/
stats_defs.rs.h

1// To be included from server.rs and client.rs examples. This would usually
2// be done through the usual pub struct definitions but it's cumbersome to
3// do in the examples directory, so work around with c-like includes.
4
5#[derive(Clone, Debug, Serialize, Deserialize, Stats)]
6#[stat(desc = "domain statistics", _om_prefix="d_", _om_label="domain_name")]
7struct DomainStats {
8    pub name: String,
9    #[stat(desc = "an event counter")]
10    pub events: u64,
11    #[stat(desc = "a gauge number")]
12    pub pressure: f64,
13}
14
15#[derive(Clone, Debug, Serialize, Deserialize, Stats)]
16#[stat(desc = "cluster statistics", top)]
17struct ClusterStats {
18    pub name: String,
19    #[stat(desc = "update timestamp")]
20    pub at: u64,
21    #[stat(desc = "some bitmap we want to report", _om_skip)]
22    pub bitmap: Vec<u32>,
23    #[stat(desc = "domain statistics")]
24    pub doms_dict: BTreeMap<usize, DomainStats>,
25}