[PERF] Runtime Telemetry Hot Path

This commit is contained in:
2026-04-10 08:59:02 +01:00
parent 5e80ea46b8
commit 63892dcfb9
16 changed files with 537 additions and 141 deletions
@@ -5,11 +5,17 @@ pub struct LogService {
events: VecDeque<LogEvent>,
capacity: usize,
next_seq: u64,
pub logs_count: u32,
}
impl LogService {
pub fn new(capacity: usize) -> Self {
Self { events: VecDeque::with_capacity(capacity), capacity, next_seq: 0 }
Self {
events: VecDeque::with_capacity(capacity),
capacity,
next_seq: 0,
logs_count: 0,
}
}
pub fn log(
@@ -34,6 +40,11 @@ impl LogService {
msg,
});
self.next_seq += 1;
self.logs_count += 1;
}
pub fn reset_count(&mut self) {
self.logs_count = 0;
}
pub fn get_recent(&self, n: usize) -> Vec<LogEvent> {