use crate::shell::Shell;
use crate::util::CgroupPath;
use std::sync::Arc;
use std::time::Duration;
use bus::BusReader;
use serde::Serialize;
pub struct IntervalWorkerContext {
pub interval: Duration,
pub term_rx: BusReader<()>,
pub shell: Arc<Shell>,
}
pub type Id = String;
#[derive(Clone, Debug, PartialEq, Serialize)]
pub enum CollectionEvent {
Stop(Id),
Start {
target: CollectionTarget,
method: CollectionMethod,
},
}
#[derive(Clone, Debug, PartialEq, Serialize)]
pub enum CollectionMethod {
LinuxCgroups(CgroupPath),
}
#[derive(Clone, Debug, PartialEq, Serialize)]
#[serde(rename_all = "PascalCase")]
pub struct CollectionTarget {
pub provider: &'static str,
pub id: Id,
pub name: String,
pub metadata: Option<serde_yaml::Value>,
pub poll_time: u128,
}