Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: dynamic gauge #87

Open
oakad opened this issue Sep 10, 2018 · 0 comments
Open

Feature request: dynamic gauge #87

oakad opened this issue Sep 10, 2018 · 0 comments

Comments

@oakad
Copy link

oakad commented Sep 10, 2018

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant