# monitor.series-window
Picks the samples of a stored metric series that fall in a window, and owns
the `MetricSample` type the other `monitor.*` metric capabilities share:
`{ at, value }`, `at` in Unix seconds and `value` a whole number in whatever
unit the metric uses (milliseconds, bytes, a request counter). Scale decimals
to integers first (a CPU percentage in basis points), so every language
agrees on every answer.
## Why half-open
The window is `from <= at < to`. Back-to-back windows (this hour, the hour
before) then never count the same sample twice, which a closed window would.
## Order is checked
Samples must be strictly ascending in time. The whole series is checked, not
only the part inside the window: a store that returns rows out of order gives
wrong rates, alerts and uptimes everywhere, so it is refused everywhere. Two
samples at the same second are refused too: which one is "the" value then is
a guess.
## Errors
- `from must not be after to`
- `samples must be in strictly ascending time order`
- `from and to must be whole seconds`