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

Update Histogram/Timer's Snapshot #712

Merged
merged 5 commits into from
Aug 16, 2022

Conversation

Channyboy
Copy link
Contributor

@Channyboy Channyboy commented Aug 9, 2022

Update Snapshot used by Histogram and Timer

  • Removed getMedian, getXXXPercentile, getMin, getStdDev, getValues from Snapshot
  • Added inner static class PercentileValue to Snapshot, percentileValues() method to Snapshot
  • Spec updates
  • TCK updates

^methods removed were those that can not be supported by micrometer

fixes #695
fixes #696

public double get999thPercentile() {
return getValue(0.999);
}
public abstract long size();
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Use long instead of int to match up with micrometer.


/**
* Returns the highest value in the snapshot.
*
* @return the highest value
*/
public abstract long getMax();
public abstract double getMax();
Copy link
Contributor Author

Choose a reason for hiding this comment

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

use double to match up with micrometer

@@ -140,34 +141,72 @@ public void testSnapshotValues() throws Exception {
SAMPLE_LONG_DATA, histogramLong.getSnapshot().getValues());
}

@Test
public void testSnapshotPercentileValuesPresent() throws Exception {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

not sure if we really need to test this?

Copy link
Member

Choose a reason for hiding this comment

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

seems reasonable for this release, given those are the expected percentiles

@@ -154,56 +155,63 @@ public void testSnapshotValues() throws Exception {
SAMPLE_LONG_DATA, globalTimer.getSnapshot().getValues());
}

@Test
public void testSnapshotPercentileValuesPresent() throws Exception {

Copy link
Contributor Author

Choose a reason for hiding this comment

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

not sure if we really need to test this?

- Removed getMedian, getXXXPercentile, getMin, getStdDev, getValues from Snapshot
- Added inner static class PercentileValue to Snapshot, percentileValues() method to Snapshot
- Spec updates
- TCK updates
spec/src/main/asciidoc/rest-endpoints.adoc Show resolved Hide resolved
spec/src/main/asciidoc/rest-endpoints.adoc Outdated Show resolved Hide resolved
@@ -140,34 +141,72 @@ public void testSnapshotValues() throws Exception {
SAMPLE_LONG_DATA, histogramLong.getSnapshot().getValues());
}

@Test
public void testSnapshotPercentileValuesPresent() throws Exception {
Copy link
Member

Choose a reason for hiding this comment

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

seems reasonable for this release, given those are the expected percentiles

Copy link
Member

@donbourne donbourne left a comment

Choose a reason for hiding this comment

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

LGTM

@Channyboy Channyboy changed the title [Draft] Update Histogram/Timer's Snapshot Update Histogram/Timer's Snapshot Aug 10, 2022
Copy link
Member

@donbourne donbourne left a comment

Choose a reason for hiding this comment

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

LGTM

@Channyboy Channyboy merged commit a13ddae into eclipse:master Aug 16, 2022
@Channyboy Channyboy deleted the 695-696-snapshot branch October 3, 2022 17:10
@Channyboy Channyboy added this to the 5.0 milestone Jan 30, 2023
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.

make Snapshot allow for flexible percentiles modify Snapshot to work with Micrometer
3 participants