Github user zsxwing commented on a diff in the pull request:

    https://github.com/apache/spark/pull/20189#discussion_r160829638
  
    --- Diff: 
sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/MetricsReporter.scala
 ---
    @@ -39,14 +35,18 @@ class MetricsReporter(
     
       // Metric names should not have . in them, so that all the metrics of a 
query are identified
       // together in Ganglia as a single metric group
    -  registerGauge("inputRate-total", () => 
stream.lastProgress.inputRowsPerSecond)
    -  registerGauge("processingRate-total", () => 
stream.lastProgress.processedRowsPerSecond)
    -  registerGauge("latency", () => 
stream.lastProgress.durationMs.get("triggerExecution").longValue())
    -
    -  private def registerGauge[T](name: String, f: () => T)(implicit num: 
Numeric[T]): Unit = {
    +  registerGauge("inputRate-total", (lastProgress) => 
lastProgress.inputRowsPerSecond, 0.0)
    +  registerGauge("processingRate-total", (lastProgress) => 
lastProgress.processedRowsPerSecond, 0.0)
    +  registerGauge("latency",
    +    (lastProgress) => 
lastProgress.durationMs.get("triggerExecution").longValue(), 0L)
    +
    +  private def registerGauge[T](
    +      name: String,
    +      f: (StreamingQueryProgress) => T,
    --- End diff --
    
    nit: `(StreamingQueryProgress) => T` -> `StreamingQueryProgress => T,`


---

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

Reply via email to