dongjoon-hyun commented on code in PR #42416:
URL: https://github.com/apache/spark/pull/42416#discussion_r1289041739


##########
core/src/test/scala/org/apache/spark/metrics/sink/StatsdSinkSuite.scala:
##########
@@ -171,5 +174,32 @@ class StatsdSinkSuite extends SparkFunSuite {
       }
     }
   }
+
+
+  test("metrics StatsD sink with filtered Gauge") {
+    withSocketAndSink { (socket, sink) =>
+      val gauge = new Gauge[Double] {
+        override def getValue: Double = 1.23
+      }
+
+      val filteredMetricKeys = Set(
+        "test-123.driver.CodeGenerator.generatedMethodSize",
+        "test-123.driver.CodeGenerator.generatedMethodSize"
+      )
+
+      filteredMetricKeys.foreach(sink.registry.register(_, gauge))
+
+      sink.registry.register("test-123.driver.spark.streaming.local.latency", 
gauge)
+      sink.report()
+
+      val p = new DatagramPacket(new Array[Byte](socketBufferSize), 
socketBufferSize)

Review Comment:
   Could you fix the compilation error, @ramesh-muthusamy ?
   ```
   [info] compiling 330 Scala sources and 29 Java sources to 
/home/runner/work/spark/spark/core/target/scala-2.12/test-classes ...
   [error] 
/home/runner/work/spark/spark/core/src/test/scala/org/apache/spark/metrics/sink/StatsdSinkSuite.scala:195:50:
 not found: value socketBufferSize
   [error]       val p = new DatagramPacket(new Array[Byte](socketBufferSize), 
socketBufferSize)
   [error]                                                  ^
   [error] 
/home/runner/work/spark/spark/core/src/test/scala/org/apache/spark/metrics/sink/StatsdSinkSuite.scala:195:69:
 not found: value socketBufferSize
   [error]       val p = new DatagramPacket(new Array[Byte](socketBufferSize), 
socketBufferSize)
   [error]                                                                     ^
   [error] two errors found
   ```



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to