Skip to content

Commit 5e0e324

Browse files
committed
fix: impact metric serialization and overload
1 parent 04c42e3 commit 5e0e324

2 files changed

Lines changed: 9 additions & 0 deletions

File tree

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
11
package io.getunleash.impactmetrics;
22

3+
import com.google.gson.annotations.SerializedName;
4+
35
public enum MetricType {
6+
@SerializedName("counter")
47
COUNTER,
8+
@SerializedName("gauge")
59
GAUGE,
10+
@SerializedName("histogram")
611
HISTOGRAM
712
}

src/main/java/io/getunleash/impactmetrics/MetricsAPI.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,10 @@ public void defineGauge(String name, String help) {
4343
metricRegistry.gauge(new MetricOptions(name, help, labelNames));
4444
}
4545

46+
public void defineHistogram(String name, String help) {
47+
defineHistogram(name, help, null);
48+
}
49+
4650
public void defineHistogram(String name, String help, @Nullable List<Double> buckets) {
4751
if (name == null || name.isEmpty() || help == null || help.isEmpty()) {
4852
LOGGER.warn("Histogram name or help cannot be empty: {}, {}", name, help);

0 commit comments

Comments
 (0)