Open
Description
I'd like to have a gauge that precisely tracks a peak value of another gauge (I have a gauge that goes up and down, and its temporary peak value is more interesting than current value at any time). I'm not sure what's the best way to implement it.
Currently gauges have only inc/get/set, so I have something like this:
val.inc();
if val.get() > peak.get() {
peak.set(val);
}
// later
val.dec();
but the get+set doesn't seem elegant, and isn't atomic. Maybe you could expose fetch_max?
If inc()
returned current value I could even do:
peak.max(val.inc());
Metadata
Metadata
Assignees
Labels
No labels