use core::output::{Output, OutputScope, OutputMetric};
use core::name::MetricName;
use core::input::{InputKind, InputDyn, InputScope};
use core::Flush;
use std::sync::Arc;
lazy_static! {
pub static ref VOID_INPUT: Arc<InputDyn + Send + Sync> = Arc::new(Void::metrics());
pub static ref NO_METRIC_SCOPE: Arc<InputScope + Send + Sync> = VOID_INPUT.input_dyn();
}
#[derive(Clone)]
pub struct Void {}
#[derive(Clone)]
pub struct VoidInput {}
#[derive(Clone)]
pub struct VoidOutput {}
impl Void {
pub fn metrics() -> Self {
Void {}
}
}
impl Output for Void {
type SCOPE = VoidOutput;
fn output(&self) -> VoidOutput {
VoidOutput {}
}
}
impl OutputScope for VoidOutput {
fn new_metric(&self, _name: MetricName, _kind: InputKind) -> OutputMetric {
OutputMetric::new(|_value, _labels| {})
}
}
impl Flush for VoidOutput {
}