go-metrics
go-metrics copied to clipboard
percentage counter
@funkygao what's this all about? I'm going to need a little more than a code dump to explain why you want this added to go-metrics.
Sorry for the missing explaination.
Percentage counter is used to record a group of counters, each of which covers what percentage of the total counter.
For example, in a SOA infrastructure, there are several ‘calls’. I want to record:
- the total call counter
- which is the most frequently called ‘call’
- what percentage of each call
I am reticent to merge this. This functionality seems like it belongs in a metrics aggregator, such as graphite or librato - e.g. count all the different events using normal Counter, then use some sort of composite functions to calculate percentages off the total.
That aside, there are problems with the PR:
- As @rcrowley pointed out, this needs to be documented. An explanation of what it's supposed to do would be great.
- There's still a
FIXMEinSnapshot() - Unit tests would need to be added.
Let me know if you're still interested in pushing this forward, and sorry about the huge latency on PR review.