petrkozorezov/estatist — pull request #3 by keynslug (2012-10-24 16:11:05+00:00)
Title: Latest add and remove metric fixes

There was initially an issue with `add_metric` call. As long as metric addition went through `add_metric` call we were not able to properly gather time-bound metrics, such as meter or simple_meter. It was so because of the timer being created in the caller process. It is ok when add_metric called during gen_server' init, but it is not ok otherwise.

So I've tried to fix this issue and provided some additional self-descriptive patches.

Timers are now implemented through continuous calls to `erlang:send_after` which saves `timer_server` from significant loads when huge number of metrics or rows in table were used. Also timers now watch and update entire table instead of a timer per row approch.

The issue #1 is addressed too.

Please review carefully and consider pull.