Type: enhancement
Area: Telegram bot / telemetry
Addressed by: PR 4 of 4 (feat(telegram): traffic history, analytics and an informative periodic report)
Summary
The periodic report sends the same three facts every interval, regardless of
whether anything happened:
📊 Periodic Report
🟢 Running | ⏱ 12d 4h
👥 Connections: 37
📊 ↓ 18.4 GB ↑ 4.1 GB
The two traffic figures are lifetime cumulative counters. They only ever
increase, so the report is monotonically less informative the longer the server
runs, and it cannot answer the question an operator actually has.
Impact
- "How much did we move today, and is that more or less than yesterday?" is
unanswerable. The only numbers shown are since-the-beginning totals.
- The message is identical every time when idle. A server with no traffic
still produces a full report every interval, training operators to ignore it —
which defeats the purpose of the alert channel.
- No visibility into per-user trends.
/mp_traffic shows cumulative totals
per user, which have the same problem: a user who transferred 5 GB last month
and nothing since looks identical to one who transferred 5 GB this morning.
- Quota and expiry problems are only surfaced at the moment of enforcement.
The report gives no early warning that users are approaching their limits.
Root cause
Nothing records how usage changes over time. relay_stats/ holds a running total
plus a single "last raw values" snapshot used only for delta arithmetic. There is
no history, so no windowed or comparative figure can be computed.
Proposal
-
Record a rolling history of coarse samples (5-minute, 7-day retention) per
user and globally, under relay_stats/history/. Store deltas, not
cumulative counters, so an engine restart or a traffic reset cannot corrupt
a window that spans it.
-
Derive windowed analytics from it: 24h/7d/30d totals, period-over-period
change, peak and average rate, top talkers, an hourly sparkline, quota
pressure and expiry watch.
Peak should use the actual gap between samples, not the nominal interval,
so a daemon outage reads as a real gap rather than a phantom spike. Average
should divide by the span actually covered.
-
Make the report activity-aware. With no traffic in the window it should
collapse to a one-line heartbeat rather than repeat a dashboard of zeroes. A
verbosity setting should allow forcing either behaviour.
-
Expose management commands for the new store: status, prune, reset.
-
Reuse the existing 80/100 quota thresholds and the existing ISO expiry
parser for the warning lines, so the report and the enforcement loop cannot
disagree.
Acceptance criteria
Notes
Cumulative counters should remain available — operators rely on them — but they
should not be the whole report.
Type: enhancement
Area: Telegram bot / telemetry
Addressed by: PR 4 of 4 (
feat(telegram): traffic history, analytics and an informative periodic report)Summary
The periodic report sends the same three facts every interval, regardless of
whether anything happened:
The two traffic figures are lifetime cumulative counters. They only ever
increase, so the report is monotonically less informative the longer the server
runs, and it cannot answer the question an operator actually has.
Impact
unanswerable. The only numbers shown are since-the-beginning totals.
still produces a full report every interval, training operators to ignore it —
which defeats the purpose of the alert channel.
/mp_trafficshows cumulative totalsper user, which have the same problem: a user who transferred 5 GB last month
and nothing since looks identical to one who transferred 5 GB this morning.
The report gives no early warning that users are approaching their limits.
Root cause
Nothing records how usage changes over time.
relay_stats/holds a running totalplus a single "last raw values" snapshot used only for delta arithmetic. There is
no history, so no windowed or comparative figure can be computed.
Proposal
Record a rolling history of coarse samples (5-minute, 7-day retention) per
user and globally, under
relay_stats/history/. Store deltas, notcumulative counters, so an engine restart or a traffic reset cannot corrupt
a window that spans it.
Derive windowed analytics from it: 24h/7d/30d totals, period-over-period
change, peak and average rate, top talkers, an hourly sparkline, quota
pressure and expiry watch.
Peak should use the actual gap between samples, not the nominal interval,
so a daemon outage reads as a real gap rather than a phantom spike. Average
should divide by the span actually covered.
Make the report activity-aware. With no traffic in the window it should
collapse to a one-line heartbeat rather than repeat a dashboard of zeroes. A
verbosity setting should allow forcing either behaviour.
Expose management commands for the new store:
status,prune,reset.Reuse the existing 80/100 quota thresholds and the existing ISO expiry
parser for the warning lines, so the report and the enforcement loop cannot
disagree.
Acceptance criteria
n/awhen there is noprevious window (never
inf/nan, and never a numeric sentinel that agenuine small decrease would collide with).
windows.
Notes
Cumulative counters should remain available — operators rely on them — but they
should not be the whole report.