Skip to content

Commit

Permalink
Address comments.. also add back in the median/50th percentile test
Browse files Browse the repository at this point in the history
  • Loading branch information
Channyboy committed Aug 9, 2022
1 parent 2a493ab commit 31fa3e4
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
4 changes: 2 additions & 2 deletions spec/src/main/asciidoc/rest-endpoints.adoc
Expand Up @@ -427,7 +427,7 @@ distance_to_hole_meters_sum{_scope="golf_stats"} 1569.3785694223322 <3>
| Suffix{label} | TYPE | Value (Histogram method) | Units

| `<units>_max` | Gauge | `getSnapshot().getMax()` | <units>
| `<units>{quantile="0.5"}` | Summary | `getSnapshot().getMedian()` | <units>
| `<units>{quantile="0.5"}` | Summary | `getSnapshot().getValue(0.5)` | <units>
| `<units>{quantile="0.75"}` | Summary | `getSnapshot().getValue(0.75)` | <units>
| `<units>{quantile="0.95"}` | Summary | `getSnapshot().getValue(0.95)` | <units>
| `<units>{quantile="0.98"}` | Summary | `getSnapshot().getValue(0.98)` | <units>
Expand Down Expand Up @@ -474,7 +474,7 @@ myClass_myMethod_seconds_max{_scope="vendor"} 0.05507899 <3>
| Suffix{label} | TYPE | Value (Timer method) | Units

| `max_seconds` | Gauge | `getSnapshot().getMax()` | SECONDS^1^
| `seconds{quantile="0.5"}` | Summary | `getSnapshot().getMedian()` | SECONDS^1^
| `seconds{quantile="0.5"}` | Summary | `getSnapshot().getValue(0.5)` | SECONDS^1^
| `seconds{quantile="0.75"}` | Summary | `getSnapshot().getValue(0.75)` | SECONDS^1^
| `seconds{quantile="0.95"}` | Summary | `getSnapshot().getValue(0.95)` | SECONDS^1^
| `seconds{quantile="0.98"}` | Summary | `getSnapshot().getValue(0.98)` | SECONDS^1^
Expand Down
Expand Up @@ -167,6 +167,12 @@ public void testSnapshotPercentileValuesPresent() throws Exception {
Assert.assertTrue(countDown == 0);
}

@Test
public void testSnapshot50thPercentile() throws Exception {
TestUtils.assertEqualsWithTolerance(48, histogramInt.getSnapshot().getValue(0.5));
TestUtils.assertEqualsWithTolerance(480, histogramLong.getSnapshot().getValue(0.5));
}

@Test
public void testSnapshot75thPercentile() throws Exception {
TestUtils.assertEqualsWithTolerance(75, histogramInt.getSnapshot().getValue(0.75));
Expand Down
Expand Up @@ -169,6 +169,11 @@ public void testSnapshotPercentileValuesPresent() throws Exception {

}

@Test
public void testSnapshot50thPercentile() throws Exception {
TestUtils.assertEqualsWithTolerance(480, globalTimer.getSnapshot().getValue(0.5));
}

@Test
public void testSnapshot75thPercentile() throws Exception {
TestUtils.assertEqualsWithTolerance(750, globalTimer.getSnapshot().getValue(0.75));
Expand Down

0 comments on commit 31fa3e4

Please sign in to comment.