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

MetricsRegistry: Support both types of histograms #118

Closed
wants to merge 1 commit into from

Conversation

amnonh
Copy link
Contributor

@amnonh amnonh commented Jun 24, 2020

There are two types of histograms, the older deprecated histogram and
the new estimated_histogram.

This patch changes the implementation of MetricsRegistry so the JmxTimer
would support both types, similiar to JmxHistogram.

Fixes #117

Signed-off-by: Amnon Heiman [email protected]

There are two types of histograms, the older deprecated histogram and
the new estimated_histogram.

This patch changes the implementation of MetricsRegistry so the JmxTimer
would support both types, similiar to JmxHistogram.

Fixes scylladb#117

Signed-off-by: Amnon Heiman <[email protected]>
@amnonh amnonh requested a review from penberg as a code owner June 24, 2020 08:41
histogram = new Histogram(obj.getJsonObject("hist"));
} else if (obj.containsKey("buckets")) {
histogram = new Histogram(new EstimatedHistogram(obj));
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The logic in JmxHistogram has an additional else path:

        @Override
        public void update(JsonObject obj) {
            if (obj.containsKey("hist")) {
                obj = obj.getJsonObject("hist");
            }
            if (obj.containsKey("buckets")) {
                histogram = new Histogram(new EstimatedHistogram(obj));
            } else {
                histogram = new Histogram(obj);
            }
        }

Which one of the two is correct?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's mutually exclusive (it's either hist or buckets) but I'm closing this PR because I will take a different path

@amnonh
Copy link
Contributor Author

amnonh commented Jul 14, 2020

I'm going to take a different path with the implementation

@amnonh amnonh closed this Jul 14, 2020
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

Successfully merging this pull request may close these issues.

Scylla JMX should accept both Histogram formats
2 participants