Skip to content

Commit

Permalink
o(1)
Browse files Browse the repository at this point in the history
  • Loading branch information
turboFei committed Jan 22, 2025
1 parent 039e7b5 commit 18be2a5
Showing 1 changed file with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ package org.apache.kyuubi.metrics
import java.lang.management.ManagementFactory
import java.util.concurrent.TimeUnit

import scala.collection.JavaConverters._

import com.codahale.metrics.{Gauge, MetricRegistry, Snapshot}
import com.codahale.metrics.jvm._

Expand Down Expand Up @@ -61,7 +59,7 @@ class MetricsSystem extends CompositeService("MetricsSystem") {
}

def getGauge(name: String): Option[Gauge[_]] = {
registry.getGauges((metricsName, _) => { metricsName == name }).asScala.map(_._2).headOption
Option(registry.getGauges().get(name))
}

def registerGauge[T](name: String, value: => T, default: T): Unit = {
Expand Down

0 comments on commit 18be2a5

Please sign in to comment.