Skip to content

Commit cf018d1

Browse files
committed
Address code review comments.
Signed-off-by: Brian Brazil <[email protected]>
1 parent 784db17 commit cf018d1

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

simpleclient/src/main/java/io/prometheus/client/Counter.java

+6
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,12 @@
6464
* </pre>
6565
* These can be aggregated and processed together much more easily in the Prometheus
6666
* server than individual metrics for each labelset.
67+
*
68+
* If there is a suffix of <code>_total</code> on the metric name, it will be
69+
* removed. When exposing the time series for counter value, a
70+
* <code>_total</code> suffix will be added. This is for compatibility between
71+
* OpenMetrics and the Prometheus text format, as OpenMetrics requires the
72+
* <code>_total</code> suffix.
6773
*/
6874
public class Counter extends SimpleCollector<Counter.Child> implements Collector.Describable {
6975

simpleclient/src/main/java/io/prometheus/client/SimpleCollector.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ public B namespace(String namespace) {
216216
return (B)this;
217217
}
218218
/**
219-
* Set the uit of the metric. Required.
219+
* Set the unit of the metric. Required.
220220
*/
221221
public B unit(String unit) {
222222
this.unit = unit;

simpleclient_caffeine/src/test/java/io/prometheus/client/cache/caffeine/CacheMetricsCollectorTest.java

-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@ public void loadingCacheExposesMetricsForLoadsAndExceptions() throws Exception {
7070
}
7171
cache.get("user3");
7272

73-
7473
assertMetric(registry, "caffeine_cache_hit_total", "loadingusers", 1.0);
7574
assertMetric(registry, "caffeine_cache_miss_total", "loadingusers", 3.0);
7675

0 commit comments

Comments
 (0)