tally icon indicating copy to clipboard operation
tally copied to clipboard

Feature request: dynamic gauge

Open oakad opened this issue 7 years ago • 0 comments

In many cases it is necessary to report the current value of a certain variable. Other metric systems (such as Dropwizard one on Java) allow an user to bind a metric name to a function. That function gets called on every metric aggregation scan and its returned value is applied directly as momentary metric value.

Something to the tune of:

func measureChannel() float64 {
  return float64(len(someChan))
}

//....

g := tallyScope.DynamicGauge("channel_gauge", measureChannel)

Whereupon, channel_gauge metric will be set to a value returned by measureChannel function, when called on metric reporter defined intervals.

oakad avatar Sep 10 '18 08:09 oakad