Commit e12d1ff
committed
[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
18be2a5 [Wang, Fei] o(1)
039e7b5 [Wang, Fei] check existing gauge
32dce6f [Wang, Fei] check gauge exists
Authored-by: Wang, Fei <[email protected]>
Signed-off-by: Wang, Fei <[email protected]>1 parent b0f3c00 commit e12d1ff
File tree
2 files changed
+18
-2
lines changed- kyuubi-metrics/src
- main/scala/org/apache/kyuubi/metrics
- test/scala/org/apache/kyuubi/metrics
2 files changed
+18
-2
lines changedLines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
61 | | - | |
62 | | - | |
| 61 | + | |
| 62 | + | |
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
| |||
Lines changed: 16 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
94 | 94 | | |
95 | 95 | | |
96 | 96 | | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
97 | 113 | | |
0 commit comments