use std::sync::{Mutex, RwLock};
use std::time::Duration;
#[derive(Debug, Clone)]
pub struct LockTracker {}
impl LockTracker {
pub fn new() -> Self {
Self {}
}
#[allow(dead_code)] pub fn track_operation<T, F>(&self, operation: F) -> T
where
F: FnOnce() -> T,
{
operation()
}
#[allow(dead_code)] pub fn execute_with_lock_tracking<T, F>(&self, operation: F) -> T
where
F: FnOnce() -> T,
{
operation()
}
#[allow(dead_code)] pub fn add_lock_wait_time(&self, _duration: Duration) {}
#[allow(dead_code)] pub fn get_total_lock_wait_time(&self) -> Duration {
Duration::from_secs(0)
}
}
impl Default for LockTracker {
fn default() -> Self {
Self::new()
}
}
#[allow(dead_code)] pub type TrackedLock<T> = Mutex<T>;
#[allow(dead_code)] pub type TrackedRwLock<T> = RwLock<T>;