kyuubi/kyuubi-metrics
Wang, Fei e12d1ff881 [KYUUBI #6891] Fix get existing gauge issue
### 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>
2025-01-23 11:55:37 +08:00
..
src [KYUUBI #6891] Fix get existing gauge issue 2025-01-23 11:55:37 +08:00
pom.xml [KYUUBI #6769] [RELEASE] Bump 1.11.0-SNAPSHOT 2024-10-23 17:10:56 +08:00