use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct DbStats {
pub expired_count: u64,
pub operations_count: u64,
pub size_bytes: usize,
pub hot_state_objects: usize,
pub cold_state_trajectories: usize,
pub cold_state_buffer_bytes: usize,
pub memory_usage_bytes: usize,
}
impl DbStats {
pub fn new() -> Self {
Self::default()
}
pub fn record_operation(&mut self) {
self.operations_count += 1;
}
pub fn record_expired(&mut self, count: u64) {
self.expired_count += count;
}
pub fn set_size_bytes(&mut self, bytes: usize) {
self.size_bytes = bytes;
}
}