Skip to content

Commit f4c0c8c

Browse files
committed
Fix assertion in HistogramTest
Median of 1..11 = 6
1 parent 1488ecc commit f4c0c8c

File tree

1 file changed

+6
-6
lines changed
  • simpleclient_common/src/test/java/io/prometheus/client/exporter/common

1 file changed

+6
-6
lines changed

simpleclient_common/src/test/java/io/prometheus/client/exporter/common/ExemplarTest.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -310,15 +310,15 @@ public void testSummaryNoLabels() throws IOException {
310310
.help("help")
311311
.quantile(0.5, 0.01)
312312
.register(registry);
313-
for (int i=1; i<=11; i++) { // median is 5
313+
for (int i=1; i<=11; i++) { // median is 6
314314
noLabelsDefaultExemplar.observe(i);
315315
}
316316
// Summaries don't have Exemplars according to the OpenMetrics spec.
317-
assertOpenMetrics100Format("no_labels{quantile=\"0.5\"} 5.0\n");
317+
assertOpenMetrics100Format("no_labels{quantile=\"0.5\"} 6.0\n");
318318
assertOpenMetrics100Format("no_labels_count 11.0\n");
319319
assertOpenMetrics100Format("no_labels_sum 66.0\n");
320320

321-
assert004Format("no_labels{quantile=\"0.5\",} 5.0\n");
321+
assert004Format("no_labels{quantile=\"0.5\",} 6.0\n");
322322
assert004Format("no_labels_count 11.0\n");
323323
assert004Format("no_labels_sum 66.0\n");
324324
}
@@ -331,15 +331,15 @@ public void testSummaryLabels() throws IOException {
331331
.labelNames("label")
332332
.quantile(0.5, 0.01)
333333
.register(registry);
334-
for (int i=1; i<=11; i++) { // median is 5
334+
for (int i=1; i<=11; i++) { // median is 6
335335
labelsNoExemplar.labels("test").observe(i);
336336
}
337337
// Summaries don't have Exemplars according to the OpenMetrics spec.
338-
assertOpenMetrics100Format("labels{label=\"test\",quantile=\"0.5\"} 5.0\n");
338+
assertOpenMetrics100Format("labels{label=\"test\",quantile=\"0.5\"} 6.0\n");
339339
assertOpenMetrics100Format("labels_count{label=\"test\"} 11.0\n");
340340
assertOpenMetrics100Format("labels_sum{label=\"test\"} 66.0\n");
341341

342-
assert004Format("labels{label=\"test\",quantile=\"0.5\",} 5.0\n");
342+
assert004Format("labels{label=\"test\",quantile=\"0.5\",} 6.0\n");
343343
assert004Format("labels_count{label=\"test\",} 11.0\n");
344344
assert004Format("labels_sum{label=\"test\",} 66.0\n");
345345
}

0 commit comments

Comments
 (0)