Modular statistics collection
Created by: szarsti
I wanted to swap mechanism dalmatiner is using to publish metrics into itself, for cli based tool for querying metrics. Just like in riak.
I found that current dalmatiner_metrics.erl design required me to replace quite a fair chunks. I would like to propose something more modular, where you could use separate reporting modules. Existing publisher that pushes metrics into dalmatiner storage could become one of such modules.
If you are interested, you can see what I had to change to get console cli reporter: https://github.com/dalmatinerdb/dalmatinerdb/compare/test...dataloop:console-statistics
Just to get that sort of modularity one would have to re-factor 'do_metrics' function to support any collection callback, so different reporting back-ends could use the bast data structure they need.
Second change would be to move out all data pushing from tick handler. We could move it to separate callback module. I would move existing stuff to built-in module. That would allow me to write another module to push metrics to graphite (we use graphite protocol to publish metrics in dataloop).
Does it make sense?
I am to prepare pull request with it all. Just before I start working on it, I would like firstly to see if you are interested in adding such change upstream. Secondly you may have some suggestion about implementation.