### Why are the changes needed?
For the `com.codahale.metrics.MetricRegistry::gauge`.
It `getOrAdd` the gauge with name.
```
public <T extends Gauge> T gauge(String name) {
return (Gauge)this.getOrAdd(name, MetricRegistry.MetricBuilder.GAUGES);
}
```
So we have to get all the gauges to check whether the gauge exists.
### How was this patch tested?
UT.
### Was this patch authored or co-authored using generative AI tooling?
No.
Closes #6891 from turboFei/gauge_exists.
Closes #6891
18be2a521 [Wang, Fei] o(1)
039e7b5eb [Wang, Fei] check existing gauge
32dce6fb1 [Wang, Fei] check gauge exists
Authored-by: Wang, Fei <fwang12@ebay.com>
Signed-off-by: Wang, Fei <fwang12@ebay.com>
|
||
|---|---|---|
| .. | ||
| src | ||
| pom.xml | ||