commit | 39d5267535485b7db52a883d5d411483175ddcad | [log] [tgz] |
---|---|---|
author | Mike Wallace <mikewallace@apache.org> | Thu Sep 04 13:12:06 2014 +0100 |
committer | Mike Wallace <mikewallace1979@googlemail.com> | Thu Sep 04 13:17:14 2014 +0100 |
tree | c727186bf522e0fb88c21af87240bab2500203b9 | |
parent | 7de4f9549f71b540899a6e9683ca75cc07b1fcfa [diff] |
Fix "Avoid recreating all metrics on reload" This commit fixes the "fix" for reloading metrics every 10 minutes in ab8d36b3973364b3a87f90767b9fadab016ac38b by ensuring we return the full output of load_metrics_for_applications/0 in reload_metrics/0.
couch_stats is a simple statistics collection app for Erlang applications. Its core API is a thin wrapper around a stat storage library (currently Folsom,) but abstracting over that library provides several benefits:
All references to stat storage are in one place, so it's easy to swap the module out.
Some common patterns, such as tying a process's lifetime to a counter value, are straightforward to support.
Configuration can be managed in a single place - for example, it's much easier to ensure that all histogram metrics use a 10-second sliding window if those metrics are instantiated/configured centrally.
[atom()]
.counter
, gauge
, or histogram
.If you don‘t add your metric to a description file, your metric will be accessible via couch_stats:sample/1
, but it won’t be read by the stats collector and therefore won't be available to HTTP _stats
requests, etc.
Tell couch_stats to use your description file via application configuration.
Instrument your code with the helper functions in couch_stats.erl
.