pan3793 commented on code in PR #6891:
URL: https://github.com/apache/kyuubi/pull/6891#discussion_r1923964175


##########
kyuubi-metrics/src/main/scala/org/apache/kyuubi/metrics/MetricsSystem.scala:
##########
@@ -58,8 +60,8 @@ class MetricsSystem extends CompositeService("MetricsSystem") 
{
     meter.mark(value)
   }
 
-  def getGauge[T](name: String): Option[Gauge[T]] = {
-    Option(registry.gauge(name))
+  def getGauge(name: String): Option[Gauge[_]] = {
+    registry.getGauges((metricsName, _) => { metricsName == name 
}).asScala.map(_._2).headOption

Review Comment:
   semantic is correct, but performance is poor, is it possible to have an O(1) 
approach? if impossible and perf is acceptable, please leave a brief comment to 
explain that.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscr...@kyuubi.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscr...@kyuubi.apache.org
For additional commands, e-mail: notifications-h...@kyuubi.apache.org

Reply via email to