akiyamaneko commented on a change in pull request #30030:
URL: https://github.com/apache/spark/pull/30030#discussion_r508747975



##########
File path: core/src/main/resources/org/apache/spark/ui/static/utils.js
##########
@@ -39,7 +39,7 @@ function formatDuration(milliseconds) {
 
 function formatBytes(bytes, type) {
     if (type !== 'display') return bytes;
-    if (bytes == 0) return '0.0 B';
+    if (bytes <= 0) return '0.0 B';

Review comment:
       @gengliangwang sorry for the delay,I had tried to reproduce the problem 
   When many tasks  failed  in a  stage,  the `shuffleTotalReads` metric can be 
-1L 
sometime([storeTypes.scala](https://github.com/apache/spark/blob/46ad325e56abd95c0ffdbe64aad78582da8c725d/core/src/main/scala/org/apache/spark/status/storeTypes.scala#L344))
   
   the code: 
[AppStatusStore#taskSummary](https://github.com/apache/spark/blob/46ad325e56abd95c0ffdbe64aad78582da8c725d/core/src/main/scala/org/apache/spark/status/AppStatusStore.scala#L165)
 may has bug, It doesn't consider negative values: 
[AppStatusStore.toValues](https://github.com/apache/spark/blob/46ad325e56abd95c0ffdbe64aad78582da8c725d/core/src/main/scala/org/apache/spark/status/AppStatusStore.scala#L206)
 and 
[AppStatusStore.scanTasks](https://github.com/apache/spark/blob/46ad325e56abd95c0ffdbe64aad78582da8c725d/core/src/main/scala/org/apache/spark/status/AppStatusStore.scala#L267)
   
   do you think is it necessary to ensure the non-negative metric value ? 
   I have found the 
restAPI:`http://host:18081/api/v1/applications/application_Id/stages/stageId/attemptId/taskSummary`
 can return negative metrics values like `shuffleReadMetrics.readBytes`, 
`totalBlocksFetched`.
   
   
   
   




----------------------------------------------------------------
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.

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