Per-site statistics telemetry

HUB documentation · docs/STATISTICS_CONTRACT.md

← Documentation library · Download Markdown

Production dashboard / HUB API: https://bamboubot.duckdns.org
Set HUB_URL=https://bamboubot.duckdns.org. Local-development commands and loopback bind addresses below are development/operator reference, not the production API origin. Use the existing hosted HUB; you do not need to deploy a new one.

Introduction

Statistics are automation-owned absolute snapshots, not inferred activity, increment events, or fabricated values. The hub does not know what a successful link/chat means. Whole-site aggregation and persistence/reset policy belong to the automation; one reporter per site prevents competing snapshots. Reposting a snapshot is idempotent (values replaced, never added).

Dashboard: visible per-site STATISTICS section on Overview and a Statistics tab with the same two cards: Links Sent Successfully, Average Messages Per Chat (up to2decimalplaces). Show lastreportedtime; no-data and offlinehistoricalsnapshotnotice. Poll10s. No grandtotal average acrossworkers/sites. No localincrementAPI toavoidretriesdoublecounting.

Developer examples/helpers should send real accumulatedwhole-sitecounts orcomputedaverage, never publish defaultzeroautomatically. Document resetting/overwriting explicitly and advise derivingweightedavg as totalmessages/totalchats only if those are the caller'sdefinitions.