Closed onemenny closed 5 years ago
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.
You're right, they're missing. Would definitely accept a PR.
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 😉
Hey @tolbertam, is this going to happen in the nearest future? :) If not, then I'm keen to prepare the PR.
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!
@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 okRatioGauge
and Derivative Gauges
- I don't think they're actually neededAlso, I think that some utility for projecting results of async operations would be useful... What do you think?
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!
Fixed by #59, thanks @rafalsiwiec!
Why are gauges missing from the library?