MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / observe

Method observe

atomic-cli/src/commands/git/rolling_dashboard.rs:96–104  ·  view source on GitHub ↗
(&mut self, sample: &Resources, cpu: Option<f64>)

Source from the content-addressed store, hash-verified

94
95impl Metrics {
96 fn observe(&mut self, sample: &Resources, cpu: Option<f64>) {
97 if let Some(rss) = sample.rss {
98 push_history(&mut self.rss_history, rss / 1024);
99 }
100 if let Some(cpu) = cpu {
101 self.max_cpu = self.max_cpu.max(cpu);
102 push_history(&mut self.cpu_history, cpu.round() as u64);
103 }
104 }
105}
106
107fn push_history(history: &mut VecDeque<u64>, value: u64) {

Calls 1

push_historyFunction · 0.85