chef/stats_hero
59.9
Adequate · 17 September 2026
999
lines of production code
Erlang
primary language
1
measurement over time
What this system is
Stats Hero is an Erlang metrics library designed to instrument code and transmit collected data to StatsD or estatsd-compatible backends. It manages metric collection through a pool of UDP sender processes for improved reliability and provides APIs for retrieving current metrics and configuring output protocols. The system includes comprehensive documentation and test infrastructure to verify UDP message formats and support continuous integration.
Features
Initial documentation for the stats\_hero metrics library
Added comprehensive documentation for the stats\_hero Erlang application, including an overview of how to instrument code to collect metrics and send them to estatsd/Graphite, detailed API references for modules such as stats\_hero, stats\_hero\_monitor, and stats\_hero\_worker\_sup, and design notes on the worker lifecycle and metric reporting. The documentation is authored by the core team and covers usage examples, configuration, and license information.
doc · high confidence
Behavioural changes
Project maintenance and build system modernization
This update modernizes the project's build and documentation infrastructure by switching from the legacy rebar to rebar3, removing the dependency on the fast\_log library, and adding meck, edown, and envy as dependencies. It also updates the Erlang support to include versions 17 through 25, adds a Travis CI configuration for continuous integration, and introduces standard repository governance files including a CODE\_OF\_CONDUCT, SECURITY policy, and Apache 2.0 license.
(repo-wide) · high confidence
Stats Hero now supports configurable StatsD protocol and pooled UDP senders
The stats\_hero metrics library now allows users to configure the output protocol (estatsd or statsd) via the application environment, enabling compatibility with standard StatsD receivers. Additionally, metric sending is now handled by a pool of UDP sender processes managed by a new \stats\_hero\_sender\_sup\ supervisor, replacing the previous single-sender approach to improve reliability and performance. The system also introduces a \snapshot\ API to retrieve current metrics and a \reparent\ function to allow worker processes to be adopted by other processes upon termination.
src · high confidence
Update copyright and license headers; change SH\_TIME macro argument structure
The stats\_hero include file updates its copyright and license headers from Opscode to Chef Software, Inc., reflecting the company rebranding. Additionally, the SH\_TIME macro is modified to pass the module and function as a tuple {Mod, Fun} instead of calling stats\_hero:label(Mod, Fun), which changes how timing data is labeled internally.
include · high confidence
Test coverage
Added test infrastructure for stats\_hero UDP metrics capture
Added a new \capture\_udp\ test helper module to replace the previous \echo\_udp\ scaffold, enabling tests to capture and verify UDP metrics sent by \stats\_hero\. The new module tracks message counts and buffers received UDP packets, supporting assertions on statsd-compatible output formats and upstream metric aggregation in the \stats\_hero\_test\ suite.
test · high confidence
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
How this codebase got here
Baseline
- First survey — no prior run to compare against. CAI 60.
Lenses
- Code Health 97
- Architecture 69
- Maturity 49
- Readiness 64
- Security 75
Changes since last survey
- 90 commits — 81 feature/other, 9 fixes
By area
- (root) — 33 commits
- src/stats_hero.erl — 18 commits
- (repo) — 16 commits
- test/stats_hero_test.erl — 6 commits
- src/stats_hero_sender.erl — 5 commits
- include/stats_hero.hrl — 4 commits
- doc/overview.edoc — 3 commits
- test/capture_udp.erl — 3 commits
- src/stats_hero.app.src — 1 commit
- src/stats_hero_sup.erl — 1 commit
Notable commits
- fix: Add basic test for no org name required fixes
- fix: Fix duplicate req_time key in snapshot return value
- fix: Fix req_time not finalized by a call to report_metrics
- fix: Fix supervisors so that the app starts and you can start a worker
- fix: Fix warning and remove debug from integration test
- fix: Fixed repository name in README
- fix: Merge pull request #13 from chef/ssd/stats-badline-fix
- fix: Revert "git:// -> https://"
- fix: Revert "replace pg2 with pg"
- change: Add and improve docs and comments in stats_hero.erl
- change: Add by request upstream aggregate metrics
- change: Add oc_chef_authz to label function
- change: Add oc_chef_authz to upstream type def
- change: Add read_at_least/1 to capture_udp test scaffold.
- change: Add some edoc goodness... including an overview
- change: Add some ignore rules for generated doc
- change: Add stats_hero_sender pooled via pg2
- change: Add test coverage for a metric not matching defined prefixes
- change: Add tests for instrumenting using custom label fun
- change: Add trivial test for handling of info messages
- …and 70 more
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
Survey your own repository
chef/stats_hero was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.
About this page
- The score is its most recent published measurement, taken on 17 September 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
- Measured at commit 7feba2adf09ac1d49a5204dc551a8a547968940c — the exact code this score is about.
- Scored under rubric-2026.09.13 — the same rubric and the same method as every other entry in this index.
- Measured by watchdog.canine.dev using codehealth-analyzer preprod-d1ef6c0bd534.