-
Notifications
You must be signed in to change notification settings - Fork 931
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix get existing gauge issue #6891
Conversation
15a5493
to
039e7b5
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #6891 +/- ##
======================================
Coverage 0.00% 0.00%
======================================
Files 688 688
Lines 42590 42590
Branches 5805 5805
======================================
Misses 42590 42590 ☔ View full report in Codecov by Sentry. |
kyuubi-metrics/src/main/scala/org/apache/kyuubi/metrics/MetricsSystem.scala
Outdated
Show resolved
Hide resolved
this looks like an independent issue, though it affects #6866, please update the title with a new ticket id or leave it to let the merge script to assign automatically. |
done |
### 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]> (cherry picked from commit e12d1ff) Signed-off-by: Wang, Fei <[email protected]>
thanks, merged to master and 1.10.2 |
Why are the changes needed?
For the
com.codahale.metrics.MetricRegistry::gauge
.It
getOrAdd
the gauge with name.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.