MCPcopy Create free account
hub / github.com/argumentcomputer/ix / summary

Method summary

crates/kernel/src/perf.rs:224–231  ·  view source on GitHub ↗

Render a one-shot human-readable summary. Cheap to call (a single load of each counter) and safe to call concurrently with recording. When [`enabled`] is false the summary is empty so callers can dump unconditionally.

(&self)

Source from the content-addressed store, hash-verified

222 /// When [`enabled`] is false the summary is empty so callers can dump
223 /// unconditionally.
224 pub fn summary(&self) -> String {
225 if !enabled() {
226 return String::new();
227 }
228 let mut s = String::with_capacity(1024);
229 let _ = self.write_summary(&mut s);
230 s
231 }
232
233 fn write_summary(&self, out: &mut impl fmt::Write) -> fmt::Result {
234 writeln!(out, "[ix-perf] cache hit rates:")?;

Callers 1

dropMethod · 0.45

Calls 2

enabledFunction · 0.85
write_summaryMethod · 0.80

Tested by

no test coverage detected