DEV Community

ilya mozerov
ilya mozerov

Posted on

A full bar, mostly silent

A status bar can be completely full and still describe a sensor that has spent
most of the week absent. That is not a bug in the bar. It is a question of which
question the bar answers: "how old is the newest reading?" and "how much of the
time did readings actually arrive?" happen to have the same answer at the one
moment the display is most reassuring.

Two different questions

Freshness is a property of the last observation. If a reading came in ten
seconds ago, a freshness bar is right to be full, however long the silence
before it was. The display was honest about that; the trouble was that readers
took a full bar to mean the source was healthy.

Reliability is a property of a window. It asks how many of the expected rows
were usable, and how often the source fell out and came back. Those numbers do
not move with the newest row. A device that reports once after six quiet hours
is fresh right now and unreliable over the window.

We had both kinds of information. Only one kind was on the pane.

A worked example

Take a constructed sequence of six collector rows, spaced a hundred seconds
apart, with statuses: ok, ok, stale, ok, unknown, ok. The newest row is ok and
recent, so the old bar read full. Over the whole sequence there are two drop
onsets — an ok followed by stale, and an ok followed by unknown — and four of
the six rows are fresh, about 67 percent.

Narrow the window to the last 250 seconds and the same sequence tells a
different story: two rows, one fresh, and no drop onsets at all, because the
only transition left inside the window is a recovery. Nothing about the device
changed. The window changed, and the failure disappeared from the reading.

That is why the length of the window is printed with the number rather than
left implicit. Seven days is a choice about what counts as a pattern; a reader
who disagrees with it can name the disagreement instead of guessing at it.

Missing is not zero

The reliability line refuses to invent data. If the history file is absent,
empty or malformed, or its timestamps and statuses are not usable, the line
reads UNKNOWN. It does not report zero drop onsets and a zero fresh fraction,
because "nothing was recorded" and "nothing went wrong" are different claims.
A detector that turns unreadable input into a clean number is worse than no
detector: it converts an outage into a reassurance.

The two readings also stay on separate populations. These are collector rows —
the same stream the display already uses — not the device's own body log. A
drop in one is not evidence about the other. Mixing them would have made the
new line look more authoritative than the evidence allows.

What changed

The old status line was relabelled to say plainly that its bar measures the age
of the newest row. A second line now reports drop onsets and the share of fresh
rows over the trailing window, drawn from the same collector rows. When those
rows cannot be read, it says so. No threshold changed and no alert was added;
the change is that a distinction the data already supported became visible.

Focus tests cover the boundary cases: the drop count on a mixed sequence, the
narrower window that hides it, empty history, old history, a malformed status,
and a malformed timestamp. Each of the last four must produce UNKNOWN, never a
confident zero.

The habit

When a live-looking indicator reassures you, ask what it measures: the last
arrival, or the interval between arrivals. Then ask over what window. A bar can
be a truthful answer to a question you did not mean to ask.

Top comments (0)