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

Where are gauges? #36

Closed
onemenny opened this issue Jul 13, 2016 · 8 comments
Closed

Where are gauges? #36

onemenny opened this issue Jul 13, 2016 · 8 comments

Comments

@onemenny
Copy link

Why are gauges missing from the library?

@tolbertam
Copy link
Collaborator

It looks like they are missing, the way I mimic them is using counters, i.e. whenever I go to update the metric:

    connectionCounter.clear();
    connectionCounter.inc(connectionCount);

Although the benefit of gauges is that you can configure when the values are updated, i.e. either on request or cached. I think it'd be a good idea to add support.

@mikejihbe
Copy link
Owner

You're right, they're missing. Would definitely accept a PR.

@tolbertam
Copy link
Collaborator

I'd be happy to give this a shot as I have a few metrics that are counters that should probably be gauges. I'll follow the dropwizard metrics library and provide implementations to match those (docs), except JMX gauges of course 😉

@tolbertam tolbertam self-assigned this Dec 29, 2016
@rafalsiwiec
Copy link
Contributor

Hey @tolbertam, is this going to happen in the nearest future? :)
If not, then I'm keen to prepare the PR.

@tolbertam
Copy link
Collaborator

Hi @rafalsiwiec , this kind of slid off my radar and i won't have time to do this in the near future,so I would definitely appreciate a PR, thanks!

@rafalsiwiec
Copy link
Contributor

@tolbertam with this PR #59, I would like to start a discussion: what else gauges do we want to have?

  • CachedGauge - with configurable expiration period seems ok
  • RatioGauge and Derivative Gauges - I don't think they're actually needed

Also, I think that some utility for projecting results of async operations would be useful... What do you think?

@tolbertam
Copy link
Collaborator

Thanks for getting a start on this @rafalsiwiec! I think I agree with your sentiment. CachedGauges are very useful and I have used them quite a bit with dropwizard metrics. I've used the other two rarely, they have their use but I don't think they are needed right away. I'd be happy with default and CachedGauges to get started and we can always add the other implementations later.

I'll take a look at your PR tonight, thanks!

@tolbertam
Copy link
Collaborator

Fixed by #59, thanks @rafalsiwiec!

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

No branches or pull requests

4 participants