commit | 0be906a14dc8c2035c494032a7117921d1326308 | [log] [tgz] |
---|---|---|
author | ILYA Khlopotov <iilyak@ca.ibm.com> | Fri Jan 09 14:27:08 2015 -0800 |
committer | ILYA Khlopotov <iilyak@ca.ibm.com> | Fri Jan 09 14:27:08 2015 -0800 |
tree | 87f38902e248f38d1a0fa0cb5fb9669e987dc2f1 | |
parent | 1bcffbdd260ac600336bb74db592b2481bb6a2e6 [diff] |
Add couch_stats:reload() Since couch_stats relies on application:loaded_applications/0 we need a way to force reload of metrics' definitions. Ability to force reload is used from a test suite to make sure we have all metrics' definitions prior to test invocation. COUCHDB-2540
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
.