Skip to main content

encode_metric

Function encode_metric 

Source
pub fn encode_metric(name: &str, value: u64) -> [u8; 41]
Expand description

Encode one metric sample.

The OWNER is this service’s declared name (trace_as), exactly as for an event: identity is not ambient, so the emitter says who it is, and the sample is its own testimony - no more and no less trustworthy than the value beside it.

No clock read. The sink stamps the sample, for the reason recorded on trace_emit: a CMOS RTC read on every publish would put up to a millisecond of port I/O on the emitting service’s path, and that once cost the shell its keystrokes. An observer must not be able to slow what it observes.