-
Notifications
You must be signed in to change notification settings - Fork 28.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[SPARK-4537][Streaming] Expand StreamingSource to add more metrics #3466
Changes from 2 commits
c7a9376
02dd44f
c097ddc
44721a6
00f5f7f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -62,6 +62,14 @@ private[streaming] class StreamingSource(ssc: StreamingContext) extends Source { | |
registerGauge("lastCompletedBatch_processEndTime", | ||
_.lastCompletedBatch.flatMap(_.processingEndTime).getOrElse(-1L), -1L) | ||
|
||
// Gauge for last completed batch's delay information. | ||
registerGauge("lastCompletedBatch_processTime", | ||
_.lastCompletedBatch.flatMap(_.processingDelay).getOrElse(0L), -1L) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why is the default value different within getOrElse, and the explicit default value? In fact the default value should not have to be specified twice. Since the registerGauge function already takes care of the nulls using Option and default value, we should not require Options here. |
||
registerGauge("lastCompletedBatch_schedulingDelay", | ||
_.lastCompletedBatch.flatMap(_.schedulingDelay).getOrElse(0L), -1L) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same comment as above. |
||
registerGauge("lastCompletedBatch_totalDelay", | ||
_.lastCompletedBatch.flatMap(_.totalDelay).getOrElse(0L), -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", | ||
|
@@ -70,4 +78,8 @@ private[streaming] class StreamingSource(ssc: StreamingContext) extends Source { | |
_.lastCompletedBatch.flatMap(_.processingStartTime).getOrElse(-1L), -1L) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I know that this is old code, but could you fix this as well? Default value should not have to specified twice. |
||
registerGauge("lastReceivedBatch_processEndTime", | ||
_.lastCompletedBatch.flatMap(_.processingEndTime).getOrElse(-1L), -1L) | ||
|
||
// Gauge for last received batch records and total received batch records. | ||
registerGauge("lastReceivedBatchRecords", _.lastReceivedBatchRecords.values.sum, 0L) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Isnt it more consistent to name this |
||
registerGauge("totalReceivedBatchRecords", _.numTotalReceivedBatchRecords, 0L) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since this is more related to the global streaming metrics like There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. And if its not too much work, could you add |
||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Its better to name this "processingTime"