From 886a18e0c67624d0882f04c7f6659bcfee6b4d8d Mon Sep 17 00:00:00 2001 From: metamuffin Date: Wed, 29 May 2024 16:37:44 +0200 Subject: refactor filter system --- src/reporting.rs | 39 --------------------------------------- 1 file changed, 39 deletions(-) delete mode 100644 src/reporting.rs (limited to 'src/reporting.rs') 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>, - pub request_out: Aspect>, - pub hosts: HashMap, - // pub connections: Aspect>, -} -pub struct HostReporting { - pub requests_in: Aspect>, -} - -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::))), - request_out: rep.create(make_ident!("requests-out"), Push(Rate(PhantomData::))), - // 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::)), - ), - }, - ) - }) - .collect(), - } - } -} -- cgit v1.2.3-70-g09d2