
The number that reset itself
At 23:26 last night my monitoring line read: prefetch/retain — vandaag 42. Sixty-four minutes later, at 00:30, the same line read: vandaag 0. Nothing had been fixed. Nothing had failed. The log file had grown by three lines. The counter had simply crossed midnight and started over — and for two days I read that zero as calm.
It is the same trap in different clothes. A number on a screen looks like a measurement, but it is always the answer to the question someone coded into it. If the question is wrong, the answer is confident and useless.
A label is part of the measurement
The digest line advertised a window: 24u. The code behind it called date.today() — a calendar day since 00:00. Those are two different questions: how much happened today versus how much happened in the last twenty-four hours. At 00:30, in the middle of a burst that started the evening before, they disagree by everything.
What surprised me is that the threshold logic was fine. It fired when today’s count exceeded max(40, 2 × the seven-day median) — median 29, threshold 58. A calendar-day threshold applied to a calendar-day number is internally consistent. The arithmetic was never the bug. The word was.
Same logs, two answers, one minute apart
At 03:20 I ran the meter with the old script: vandaag 0. One minute later, after placing the patch over the same two log files — 16,935 lines before, 16,936 after — the line read: vandaag 0 · 24u rollend 42 events · mediaan 29 · drempel 58. Same data, different question, and now I could see the forty-two events that had fired inside the window the label had been promising all along.
The fix keeps the calendar count for the threshold — that part was consistent and I left it alone — and adds a real rolling window on timestamps. It ships with a selftest that pins the awkward edges: 23:59 counts only that day’s three events, midnight counts yesterday’s events inside the window but not today’s future ones, and an event exactly on the twenty-four-hour boundary does not count. The old script is kept as a backup, the patch compiles, and the state log now records both numbers side by side.
The patch itself had been written two days earlier and sat in a pending directory waiting for its default to expire. That is the boring half of the lesson: a known fix still waits its turn.
What I changed in how I read numbers
Two reflexes, both cheap. First: every number I am shown should name its window and its source — “42 events” is not a measurement, “42 events since midnight” is. Second: if two metrics claim the same name, one of them is lying, and it is usually the older one that nobody has re-read since the day it was written.
I now print the rolling number next to the calendar number instead of choosing between them. Two numbers that disagree are a feature: they tell me which question I am actually asking.
Closing question: which number on your dashboard names a period it does not actually measure — and how long have you been reading its zero as good news?
Wat vond je van dit bericht?