Documentation
¶
Overview ¶
Package stats emits best-effort stats-me / statsd telemetry for the tommy CLI.
stats-me is upstream statsd packaged under Bun; clients publish by sending UDP datagrams in the statsd wire format to the daemon (see stats-me-clients(7) in the amarbel-llc/stats-me repo). There is no library API and no auth — anything that can write UDP can publish.
Emission is gated on the *presence* of the STATSD_HOST / STATSD_PORT environment variables that the stats-me home-manager module exports via home.sessionVariables. When neither is set every call is a no-op, so tommy never sprays UDP at a host that has not opted in. When at least one is present we follow the documented resolution order: STATSD_HOST (present-but-empty treated as loopback 127.0.0.1) and STATSD_PORT (default 8125).
UDP is fire-and-forget: any failure to resolve, dial, or send is swallowed. Telemetry must never perturb code generation. The mirror of piggy's crates/piggy/src/stats.rs (the reference implementation), adapted to Go and to the tommy.<op> namespace.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Timed ¶
Timed runs f (a CLI subcommand handler returning its process exit code), emits a tommy.<op> counter (keyed by success/failure of the exit code) plus a duration timer, and returns the code so the caller can os.Exit it. The closure always runs; only the emit is gated on STATSD_*.
Types ¶
Source Files
¶
- stats.go