Skip to main content

Module blossom_stats

Module blossom_stats 

Source
Expand description

Per-server latency, speed and reachability, and the one-word status the list shows.

One row per server, no history: latency and speed are exponentially weighted averages, the last few upload speeds ride along as a short array for a sparkline. The footprint does not grow with use.

Latency is the BUD-06 preflight round-trip — a small request, so it is dominated by distance and server load and comparable between servers. Speed is this device’s throughput to the server, which the uplink caps: shown as a number, never graded.

Structs§

Sample
One recent upload: its speed and its size, stored as [mbps, bytes]. Rows written before sizes were kept hold a bare number and read back with bytes: 0.
ServerStats
ServerStatus
The list’s one-word answer to “will my next upload here work?”.

Constants§

FAIL_MAXED
FAIL_OFFLINE
MIN_SPEED_SAMPLE_BYTES
Below this an upload is all round-trip and says nothing about throughput.

Functions§

derive_status
Pure: what the list should say, from what is known. info is the server’s document when it has one; stats this device’s history.
migrate
record_failure
kind is FAIL_OFFLINE or FAIL_MAXED.
record_latency
A small request answered in ms.
record_ok
The server answered, whatever it said: it is reachable.
record_upload
bytes accepted in ms. Small uploads are ignored: they measure the round-trip, not the pipe.
stats_for
status_for