use std::sync::Arc;
pub trait Counter: Send + Sync + 'static {
fn inc(&self);
fn inc_by(&self, v: u64);
fn get(&self) -> u64;
}
pub trait Gauge: Send + Sync + 'static {
fn set(&self, v: i64);
fn inc(&self);
fn dec(&self);
fn get(&self) -> i64;
}
pub trait Histogram: Send + Sync + 'static {
fn observe(&self, v: f64);
}
pub trait CounterVec: Send + Sync + 'static {
fn with_labels(&self, labels: &[&str]) -> Arc<dyn Counter>;
}
pub trait GaugeVec: Send + Sync + 'static {
fn with_labels(&self, labels: &[&str]) -> Arc<dyn Gauge>;
}
pub trait HistogramVec: Send + Sync + 'static {
fn with_labels(&self, labels: &[&str]) -> Arc<dyn Histogram>;
}
pub trait MetricsRegistry: Send + Sync + 'static {
fn counter_vec(&self, name: &str, help: &str, label_keys: &[&str]) -> Arc<dyn CounterVec>;
fn gauge_vec(&self, name: &str, help: &str, label_keys: &[&str]) -> Arc<dyn GaugeVec>;
fn histogram_vec(&self, name: &str, help: &str, label_keys: &[&str]) -> Arc<dyn HistogramVec>;
fn render(&self) -> String;
}