Skip to content

Commit 0526abb

Browse files
committed
apply to kyuubi.metrics.reporters
1 parent 4b74cd2 commit 0526abb

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

kyuubi-metrics/src/main/scala/org/apache/kyuubi/metrics/MetricsConf.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ object MetricsConf {
3232
.booleanConf
3333
.createWithDefault(true)
3434

35-
val METRICS_REPORTERS: ConfigEntry[Seq[String]] = buildConf("kyuubi.metrics.reporters")
35+
val METRICS_REPORTERS: ConfigEntry[Set[String]] = buildConf("kyuubi.metrics.reporters")
3636
.doc("A comma-separated list for all metrics reporters" +
3737
"<ul>" +
3838
" <li>CONSOLE - ConsoleReporter which outputs measurements to CONSOLE periodically.</li>" +
@@ -44,11 +44,11 @@ object MetricsConf {
4444
.version("1.2.0")
4545
.stringConf
4646
.transformToUpperCase
47-
.toSequence()
47+
.toSet()
4848
.checkValue(
4949
_.forall(ReporterType.values.map(_.toString).contains),
5050
s"the reporter type should be one or more of ${ReporterType.values.mkString(",")}")
51-
.createWithDefault(Seq(JSON.toString))
51+
.createWithDefault(Set(JSON.toString))
5252

5353
val METRICS_CONSOLE_INTERVAL: ConfigEntry[Long] = buildConf("kyuubi.metrics.console.interval")
5454
.doc("How often should report metrics to console")

kyuubi-metrics/src/test/scala/org/apache/kyuubi/metrics/MetricsSystemSuite.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ class MetricsSystemSuite extends KyuubiFunSuite {
4949

5050
val conf = KyuubiConf()
5151
.set(MetricsConf.METRICS_ENABLED, true)
52-
.set(MetricsConf.METRICS_REPORTERS, Seq(ReporterType.PROMETHEUS.toString))
52+
.set(MetricsConf.METRICS_REPORTERS, Set(ReporterType.PROMETHEUS.toString))
5353
.set(MetricsConf.METRICS_PROMETHEUS_PORT, 0) // random port
5454
.set(MetricsConf.METRICS_PROMETHEUS_PATH, testContextPath)
5555
val metricsSystem = new MetricsSystem()
@@ -77,7 +77,7 @@ class MetricsSystemSuite extends KyuubiFunSuite {
7777
.set(MetricsConf.METRICS_ENABLED, true)
7878
.set(
7979
MetricsConf.METRICS_REPORTERS,
80-
ReporterType.values.filterNot(_ == ReporterType.PROMETHEUS).map(_.toString).toSeq)
80+
ReporterType.values.filterNot(_ == ReporterType.PROMETHEUS).map(_.toString))
8181
.set(MetricsConf.METRICS_JSON_INTERVAL, Duration.ofSeconds(1).toMillis)
8282
.set(MetricsConf.METRICS_JSON_LOCATION, reportPath.toString)
8383
val metricsSystem = new MetricsSystem()

kyuubi-server/src/test/scala/org/apache/kyuubi/server/BackendServiceMetricSuite.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import org.scalatest.time.SpanSugar.convertIntToGrainOfTime
2525

2626
import org.apache.kyuubi.{Utils, WithKyuubiServer}
2727
import org.apache.kyuubi.config.KyuubiConf
28-
import org.apache.kyuubi.metrics.MetricsConf
28+
import org.apache.kyuubi.metrics.{MetricsConf, ReporterType}
2929
import org.apache.kyuubi.metrics.MetricsConstants._
3030
import org.apache.kyuubi.operation.HiveJDBCTestHelper
3131

@@ -36,7 +36,7 @@ class BackendServiceMetricSuite extends WithKyuubiServer with HiveJDBCTestHelper
3636
val reportPath: Path = Utils.createTempDir()
3737
override protected val conf: KyuubiConf = {
3838
KyuubiConf()
39-
.set(MetricsConf.METRICS_REPORTERS, Seq("JSON"))
39+
.set(MetricsConf.METRICS_REPORTERS, Set(ReporterType.JSON.toString))
4040
.set(MetricsConf.METRICS_JSON_LOCATION, reportPath.toString)
4141
.set(MetricsConf.METRICS_JSON_INTERVAL, Duration.ofMillis(100).toMillis)
4242
}

0 commit comments

Comments
 (0)