Skip to content

Commit

Permalink
Fix assertion in HistogramTest
Browse files Browse the repository at this point in the history
Median of 1..11 = 6
  • Loading branch information
DieBauer committed Jan 22, 2022
1 parent 1488ecc commit f4c0c8c
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -310,15 +310,15 @@ public void testSummaryNoLabels() throws IOException {
.help("help")
.quantile(0.5, 0.01)
.register(registry);
for (int i=1; i<=11; i++) { // median is 5
for (int i=1; i<=11; i++) { // median is 6
noLabelsDefaultExemplar.observe(i);
}
// Summaries don't have Exemplars according to the OpenMetrics spec.
assertOpenMetrics100Format("no_labels{quantile=\"0.5\"} 5.0\n");
assertOpenMetrics100Format("no_labels{quantile=\"0.5\"} 6.0\n");
assertOpenMetrics100Format("no_labels_count 11.0\n");
assertOpenMetrics100Format("no_labels_sum 66.0\n");

assert004Format("no_labels{quantile=\"0.5\",} 5.0\n");
assert004Format("no_labels{quantile=\"0.5\",} 6.0\n");
assert004Format("no_labels_count 11.0\n");
assert004Format("no_labels_sum 66.0\n");
}
Expand All @@ -331,15 +331,15 @@ public void testSummaryLabels() throws IOException {
.labelNames("label")
.quantile(0.5, 0.01)
.register(registry);
for (int i=1; i<=11; i++) { // median is 5
for (int i=1; i<=11; i++) { // median is 6
labelsNoExemplar.labels("test").observe(i);
}
// Summaries don't have Exemplars according to the OpenMetrics spec.
assertOpenMetrics100Format("labels{label=\"test\",quantile=\"0.5\"} 5.0\n");
assertOpenMetrics100Format("labels{label=\"test\",quantile=\"0.5\"} 6.0\n");
assertOpenMetrics100Format("labels_count{label=\"test\"} 11.0\n");
assertOpenMetrics100Format("labels_sum{label=\"test\"} 66.0\n");

assert004Format("labels{label=\"test\",quantile=\"0.5\",} 5.0\n");
assert004Format("labels{label=\"test\",quantile=\"0.5\",} 6.0\n");
assert004Format("labels_count{label=\"test\",} 11.0\n");
assert004Format("labels_sum{label=\"test\",} 66.0\n");
}
Expand Down

0 comments on commit f4c0c8c

Please sign in to comment.