diff options
Diffstat (limited to 'src/reporting.rs')
-rw-r--r-- | src/reporting.rs | 39 |
1 files changed, 0 insertions, 39 deletions
diff --git a/src/reporting.rs b/src/reporting.rs deleted file mode 100644 index ee30ac5..0000000 --- a/src/reporting.rs +++ /dev/null @@ -1,39 +0,0 @@ -use crate::config::Config; -use mond_client::{make_ident, Aspect, Push, Rate, Reporter}; -use std::{collections::HashMap, marker::PhantomData}; - -pub struct Reporting { - pub request_in: Aspect<Rate<i64>>, - pub request_out: Aspect<Rate<i64>>, - pub hosts: HashMap<String, HostReporting>, - // pub connections: Aspect<State<i64>>, -} -pub struct HostReporting { - pub requests_in: Aspect<Rate<i64>>, -} - -impl Reporting { - pub fn new(config: &Config) -> Self { - let mut rep = Reporter::new(); - Self { - request_in: rep.create(make_ident!("requests-in"), Push(Rate(PhantomData::<i64>))), - request_out: rep.create(make_ident!("requests-out"), Push(Rate(PhantomData::<i64>))), - // connections: rep.create(make_ident!("connections"), Push()), - hosts: config - .hosts - .iter() - .map(|(k, _v)| { - ( - k.to_owned(), - HostReporting { - requests_in: rep.create( - make_ident!("host", k, "request-in"), - Push(Rate(PhantomData::<i64>)), - ), - }, - ) - }) - .collect(), - } - } -} |