Feuerlabs/exometer — pull request #71 by uwiger (2014-08-04 18:05:15+00:00)
Title: Uw minor additions

Example of enabling/disabling reporters:

```erlang
Eshell V5.10.3 (abort with ^G)
1> exometer:start().
ok
2> exometer_report:add_reporter(tty,[{module,exometer_report_tty}]).
ok
15:49:42.799 [info] exometer_report_tty([{module,exometer_report_tty}]): Starting

3> exometer:new([e],gauge,[]).
ok
4> exometer_report:subscribe(tty,[e],value,10000).
ok
exometer_report_tty: e_value 1407160306:0 (unknown)
exometer_report_tty: e_value 1407160316:0 (unknown)
exometer_report_tty: e_value 1407160326:0 (unknown)
exometer_report_tty: e_value 1407160336:0 (unknown)

5> exometer_report:disable_reporter(tty).
ok
... (no output for a while)
7> exometer_report:enable_reporter(tty).
15:55:13.120 [info] exometer_report_tty([{module,exometer_report_tty}]): Starting
ok
exometer_report_tty: e_value 1407160523:0 (unknown)
exometer_report_tty: e_value 1407160533:0 (unknown)
exometer_report_tty: e_value 1407160543:0 (unknown)
```

When disabling a reporter, the reporter process is in fact terminated. Subscriptions remain, but timers are cancelled. When re-enabled, the reporter is started using the saved restart info used for reporter monitoring.

Other changes in the PR are bug fixes and a change in the internal representation of the entry status attribute. The idea is to make it a bit mask, and thereby enable things like real-time event reporting (not yet implemented, but see `exometer:update_ok/3` for a hint).