Commit 5eed986
committed
Report never-set gauges in mostrecent multiprocess mode
In the mostrecent/livemostrecent accumulation branch, sample_timestamps
is a defaultdict(float), so the stored timestamp of a series defaults to
0.0. A gauge child that was created but never set() also has a stored
timestamp of 0, so the strict 'current_timestamp < timestamp' check was
never satisfied and the series was dropped from collection entirely.
Every other gauge mode (sum, min, max, all) reports such a child as 0,
so mostrecent silently omitting it was inconsistent. Register the sample
when it is first seen, regardless of timestamp, and still let a strictly
newer timestamp win afterwards.
Add test_gauge_mostrecent_never_set, asserting a mostrecent gauge that is
created but never set is reported as 0 rather than missing.
Signed-off-by: Sean Kim <skim8705@gmail.com>1 parent a96f6f4 commit 5eed986
2 files changed
Lines changed: 11 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
119 | 119 | | |
120 | 120 | | |
121 | 121 | | |
122 | | - | |
| 122 | + | |
123 | 123 | | |
124 | 124 | | |
125 | 125 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
205 | 205 | | |
206 | 206 | | |
207 | 207 | | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
208 | 218 | | |
209 | 219 | | |
210 | 220 | | |
| |||
0 commit comments