Skip to content

Commit a97dc80

Browse files
committed
Address comment from Peng
1 parent 8670ce5 commit a97dc80

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

flint-core/src/main/java/org/opensearch/flint/core/RestHighLevelClientWrapper.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ private <T> T execute(String metricNamePrefix, IOCallable<T> operation) throws I
138138
* @param metricNamePrefix the prefix for the metric name which is used to construct the full metric name for success
139139
*/
140140
private void recordOperationSuccess(String metricNamePrefix) {
141-
String successMetricName = metricNamePrefix + ".200.count";
141+
String successMetricName = metricNamePrefix + ".2xx.count";
142142
MetricsUtil.incrementCounter(successMetricName);
143143
}
144144

flint-core/src/main/java/org/opensearch/flint/core/metrics/MetricsUtil.java

+7
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,13 @@ public final class MetricsUtil {
2424
private MetricsUtil() {
2525
}
2626

27+
/**
28+
* Increments the Counter metric associated with the given metric name.
29+
* If the counter does not exist, it is created before being incremented.
30+
*
31+
* @param metricName The name of the metric for which the counter is incremented.
32+
* This name is used to retrieve or create the counter.
33+
*/
2734
public static void incrementCounter(String metricName) {
2835
Counter counter = getOrCreateCounter(metricName);
2936
if (counter != null) {

0 commit comments

Comments
 (0)