pub mod backend;
pub mod export;
pub mod snapshot;
pub mod unified;
pub use export::{export_json_format, export_prometheus_format, get_enhanced_stats};
pub use snapshot::CacheStats;
pub use unified::{AtomicCounters, UnifiedMetrics};
#[cfg(not(any(feature = "metrics", feature = "memory")))]
#[derive(Debug, Clone, Default)]
pub struct Metrics;
#[cfg(not(any(feature = "metrics", feature = "memory")))]
impl Metrics {
pub fn record_request(&self, _service: &str, _layer: &str, _op: &str, _result: &str) {}
pub fn record_duration(&self, _service: &str, _layer: &str, _op: &str, _duration_secs: f64) {}
pub fn set_health(&self, _service: &str, _status: u8) {}
pub fn set_wal_size(&self, _service: &str, _size: usize) {}
pub fn set_batch_buffer_size(&self, _service: &str, _size: usize) {}
pub fn set_batch_success_rate(&self, _service: &str, _rate: f64) {}
pub fn set_batch_throughput(&self, _service: &str, _throughput: f64) {}
pub fn get_counters(&self) -> (u64, u64, u64, u64, u64, u64, u64, u64, u64) {
(0, 0, 0, 0, 0, 0, 0, 0, 0)
}
}
#[cfg(not(any(feature = "metrics", feature = "memory")))]
lazy_static! {
pub static ref GLOBAL_METRICS: Metrics = Metrics;
}
#[cfg(not(any(feature = "metrics", feature = "memory")))]
pub fn get_metrics_string() -> String {
String::new()
}
pub use unified::{
convenience as unified_convenience, CacheOpResult, CacheOpType, CacheOperation, CounterSnapshot, HistogramData,
HitRates, MetricValue, MetricsConfig, MetricsSnapshot, TimerData, GLOBAL_UNIFIED_METRICS,
};
pub use crate::core::types::CacheLayer;