go-metrics icon indicating copy to clipboard operation
go-metrics copied to clipboard

percentage counter

Open funkygao opened this issue 11 years ago • 3 comments
trafficstars

funkygao avatar Mar 20 '14 14:03 funkygao

@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.

rcrowley avatar Mar 22 '14 19:03 rcrowley

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:

  1. the total call counter
  2. which is the most frequently called ‘call’
  3. what percentage of each call

funkygao avatar Mar 24 '14 02:03 funkygao

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 FIXME in Snapshot()
  • 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.

mihasya avatar Jul 04 '15 19:07 mihasya