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

    https://github.com/apache/spark/pull/3466#discussion_r22275969
  
    --- Diff: 
streaming/src/main/scala/org/apache/spark/streaming/StreamingSource.scala ---
    @@ -55,19 +64,31 @@ private[streaming] class StreamingSource(ssc: 
StreamingContext) extends Source {
     
       // Gauge for last completed batch, useful for monitoring the streaming 
job's running status,
       // displayed data -1 for any abnormal condition.
    -  registerGauge("lastCompletedBatch_submissionTime",
    -    _.lastCompletedBatch.map(_.submissionTime).getOrElse(-1L), -1L)
    -  registerGauge("lastCompletedBatch_processStartTime",
    -    _.lastCompletedBatch.flatMap(_.processingStartTime).getOrElse(-1L), 
-1L)
    -  registerGauge("lastCompletedBatch_processEndTime",
    -    _.lastCompletedBatch.flatMap(_.processingEndTime).getOrElse(-1L), -1L)
    +  registerGaugeWithOption("lastCompletedBatch_submissionTime",
    +    _.lastCompletedBatch.map(_.submissionTime), -1L)
    +  registerGaugeWithOption("lastCompletedBatch_processingStartTime",
    +    _.lastCompletedBatch.flatMap(_.processingStartTime), -1L)
    +  registerGaugeWithOption("lastCompletedBatch_processingEndTime",
    +    _.lastCompletedBatch.flatMap(_.processingEndTime), -1L)
    +
    +  // Gauge for last completed batch's delay information.
    +  registerGaugeWithOption("lastCompletedBatch_processingDelay",
    +    _.lastCompletedBatch.flatMap(_.processingDelay), -1L)
    +  registerGaugeWithOption("lastCompletedBatch_schedulingDelay",
    +    _.lastCompletedBatch.flatMap(_.schedulingDelay), -1L)
    +  registerGaugeWithOption("lastCompletedBatch_totalDelay",
    +    _.lastCompletedBatch.flatMap(_.totalDelay), -1L)
     
       // Gauge for last received batch, useful for monitoring the streaming 
job's running status,
       // displayed data -1 for any abnormal condition.
    -  registerGauge("lastReceivedBatch_submissionTime",
    -    _.lastCompletedBatch.map(_.submissionTime).getOrElse(-1L), -1L)
    -  registerGauge("lastReceivedBatch_processStartTime",
    -    _.lastCompletedBatch.flatMap(_.processingStartTime).getOrElse(-1L), 
-1L)
    -  registerGauge("lastReceivedBatch_processEndTime",
    -    _.lastCompletedBatch.flatMap(_.processingEndTime).getOrElse(-1L), -1L)
    +  registerGaugeWithOption("lastReceivedBatch_submissionTime",
    +    _.lastCompletedBatch.map(_.submissionTime), -1L)
    +  registerGaugeWithOption("lastReceivedBatch_processingStartTime",
    +    _.lastCompletedBatch.flatMap(_.processingStartTime), -1L)
    +  registerGaugeWithOption("lastReceivedBatch_processingEndTime",
    +    _.lastCompletedBatch.flatMap(_.processingEndTime), -1L)
    +
    +  // Gauge for last received batch records and total received batch 
records.
    +  registerGauge("lastReceivedBatchRecords", 
_.lastReceivedBatchRecords.values.sum, 0L)
    +  registerGauge("totalReceivedBatchRecords", 
_.numTotalReceivedBatchRecords, 0L)
    --- End diff --
    
    Since this is more related to the global streaming metrics like 
`totalCompletedBatches`, it might be more consistent to put these near them and 
naming it `totalReceivedRecords` (please update the corresponding field in the 
listener as well if you change this). 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

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

Reply via email to