commit | d7310e546baf1685b5b2cd3007136f6d99b573dd | [log] [tgz] |
---|---|---|
author | Paul J. Davis <paul.joseph.davis@gmail.com> | Sat Aug 23 12:10:11 2014 -0500 |
committer | Paul J. Davis <paul.joseph.davis@gmail.com> | Sat Aug 23 12:10:33 2014 -0500 |
tree | 8ac7c128a57a65745b7cc41a9cd0566cd1a38fb1 | |
parent | 1461beb1acd912276d40d72113362b0a9905c4c0 [diff] |
Add sub-stat access at the HTTP layer
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
.