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

Hard to collect double valued percentages... #23

Open
jtjeferreira opened this issue Jul 30, 2018 · 4 comments
Open

Hard to collect double valued percentages... #23

jtjeferreira opened this issue Jul 30, 2018 · 4 comments
Labels
enhancement New feature or request

Comments

@jtjeferreira
Copy link
Contributor

I am using kamon-jmx-collector to collect statistics from ehCache. However some statistics like CacheHitPercentage are stored in JMX as Double (i.e from 0.0 to 1.0). As far as I can understand, this library converts the Double to Long and I lose the precision of the percentage...

How do you think this can be improved? A user defined function to scale values?

@robvadai
Copy link
Member

Hi there,

thanks for the feedback. This sounds like a very important feature request.

I think the code needs to be updated in 2 places:

I could look at these but probably in a bit of time. Well let me know if you want to give it a go otherwise I'll let you know when I made some progress with it.

@jtjeferreira
Copy link
Contributor Author

Hi!

I think that those changes are not enough because kamon metrics only support Long:

https://github.com/kamon-io/Kamon/blob/794fbf02664ac8c31072d8b955d897901f1f22e0/kamon-core/src/main/scala/kamon/metric/Gauge.scala#L20-L28
https://github.com/kamon-io/Kamon/blob/794fbf02664ac8c31072d8b955d897901f1f22e0/kamon-core/src/main/scala/kamon/metric/Histogram.scala#L25-L31

so the only thing we can do is specify the MeasurementUnit. We can't escape the Double to Long conversion.

As soon as we find a path forward I can try to implement it...

@robvadai robvadai added the enhancement New feature or request label Nov 22, 2018
@robvadai
Copy link
Member

Hi there,

a user defined function sounds like a good idea.

Have you had a chance to think about the implementation?

I might be able to have a look at this soon.

@jtjeferreira
Copy link
Contributor Author

Hi there,

Never got the chance to give this a try... Please go ahead...

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

No branches or pull requests

2 participants