posix4e / rust-metrics

Multi reporter metrics library (carbon, graphite, postgresql, prometheus)
Other
99 stars 19 forks source link

Remove from reporter #65

Closed eb4890 closed 7 years ago

eb4890 commented 7 years ago

This adds a new method on the console and carbon reporters that can be used to remove a metric from their records.

This will be used in the following cases:

The end goal is to have this as a method on Reporter, but I thought I would get feedback on carbon and console before implementing the more tricky prometheus metrics.

I've not refactored much as I'm not so sure of the desired end state.

Looking at the prometheus code it looks like it is going to be interesting to implement removal as the metrics are stored in an Lrucache with a timestamp as the key. I would have to store that id with a metric (and have a sender send it back) or change the id to be a
hash of the name rather than a time stamp? That seems like the best plan to me.

posix4e commented 7 years ago

sgtm