Github user cloud-fan commented on a diff in the pull request:
https://github.com/apache/spark/pull/12417#discussion_r59871010
--- Diff:
core/src/main/scala/org/apache/spark/status/api/v1/AllStagesResource.scala ---
@@ -250,44 +266,62 @@ private[v1] object AllStagesResource {
resultSerializationTime = internal.resultSerializationTime,
memoryBytesSpilled = internal.memoryBytesSpilled,
diskBytesSpilled = internal.diskBytesSpilled,
- inputMetrics = internal.inputMetrics.map { convertInputMetrics },
- outputMetrics = Option(internal.outputMetrics).flatten.map {
convertOutputMetrics },
- shuffleReadMetrics = internal.shuffleReadMetrics.map {
convertShuffleReadMetrics },
- shuffleWriteMetrics = internal.shuffleWriteMetrics.map {
convertShuffleWriteMetrics }
+ inputMetrics = convertInputMetrics(internal.inputMetrics),
+ outputMetrics = convertOutputMetrics(internal.outputMetrics),
+ shuffleReadMetrics =
convertShuffleReadMetrics(internal.shuffleReadMetrics),
+ shuffleWriteMetrics =
convertShuffleWriteMetrics(internal.shuffleWriteMetrics)
)
}
- def convertInputMetrics(internal: InternalInputMetrics): InputMetrics = {
- new InputMetrics(
- bytesRead = internal.bytesRead,
- recordsRead = internal.recordsRead
- )
+ def convertInputMetrics(internal: InternalInputMetrics):
Option[InputMetrics] = {
+ if (internal.isUpdated) {
+ Some(new InputMetrics(
+ bytesRead = internal.bytesRead,
+ recordsRead = internal.recordsRead
+ ))
+ } else {
+ None
+ }
}
- def convertOutputMetrics(internal: InternalOutputMetrics): OutputMetrics
= {
- new OutputMetrics(
- bytesWritten = internal.bytesWritten,
- recordsWritten = internal.recordsWritten
- )
+ def convertOutputMetrics(internal: InternalOutputMetrics):
Option[OutputMetrics] = {
+ if (internal.isUpdated) {
+ Some(new OutputMetrics(
+ bytesWritten = internal.bytesWritten,
+ recordsWritten = internal.recordsWritten
+ ))
+ } else {
+ None
+ }
}
- def convertShuffleReadMetrics(internal: InternalShuffleReadMetrics):
ShuffleReadMetrics = {
- new ShuffleReadMetrics(
- remoteBlocksFetched = internal.remoteBlocksFetched,
- localBlocksFetched = internal.localBlocksFetched,
- fetchWaitTime = internal.fetchWaitTime,
- remoteBytesRead = internal.remoteBytesRead,
- totalBlocksFetched = internal.totalBlocksFetched,
- recordsRead = internal.recordsRead
- )
+ def convertShuffleReadMetrics(
+ internal: InternalShuffleReadMetrics): Option[ShuffleReadMetrics] = {
+ if (internal.isUpdated) {
+ Some(new ShuffleReadMetrics(
+ remoteBlocksFetched = internal.remoteBlocksFetched,
+ localBlocksFetched = internal.localBlocksFetched,
+ fetchWaitTime = internal.fetchWaitTime,
+ remoteBytesRead = internal.remoteBytesRead,
+ totalBlocksFetched = internal.totalBlocksFetched,
+ recordsRead = internal.recordsRead
--- End diff --
Looks like the internal and external shuffle read metrics don't match, the
`localBytesRead` is missing.
---
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]