[SPARK-31081][UI][SQL] Make display of stageId/stageAttemptId/taskId of sql metrics toggleable#27927
[SPARK-31081][UI][SQL] Make display of stageId/stageAttemptId/taskId of sql metrics toggleable#27927sarutak wants to merge 6 commits intoapache:masterfrom
Conversation
|
Test build #119879 has finished for PR 27927 at commit
|
|
Test build #119890 has finished for PR 27927 at commit
|
|
Test build #119897 has finished for PR 27927 at commit
|
| }); | ||
| var isChecked = window.localStorage.getItem("stageId-and-taskId-checked") == "true"; | ||
| $("#stageId-and-taskId-checkbox").prop("checked", isChecked); | ||
| $(".stageId-and-taskId-metrics").hide(); |
There was a problem hiding this comment.
this line seems unneeded.
| } | ||
|
|
||
| // labelSeparator should be a non-graphical character in order not to affect the width of boxes. | ||
| var labelSeparator = "\x01"; |
There was a problem hiding this comment.
Could you explain more about the labelSeparator as "\x01" here? It seem that the label of cluster will contain the <span class='stageId-and-taskId-metrics'> as well.
There was a problem hiding this comment.
It seem that the label of cluster will contain the as well
Yes, but we can't add <span class='stageId-and-and-taskId-metrics'> here because the label type of cluster is not html.
I tried to make the label type html but I found that the DAG had broken layout.
The width of boxes are determined based on the length of text by dagre-d3.
So if the separator character has width (graphical), the width of boxes are slightly widened against the original texts.
| </div> | ||
| <div> | ||
| <input type="checkbox" id="stageId-and-taskId-checkbox"></input> | ||
| <span>Show Stage/Task IDs</span> |
There was a problem hiding this comment.
how about
Show Stage/Task IDs with the max metrics
There was a problem hiding this comment.
Maybe we should just have this be the entire format:
Show the Stage (Stage Attempt): Task ID that corresponds to the max metric
|
@sarutak Thanks for improving this!! cc @tgravescs @Ngone51 as well |
|
@sarutak thanks for picking this up. |
Ngone51
left a comment
There was a problem hiding this comment.
I don't know this part well but only a minor nit. Overall, it looks good and cool from the screenshot!
| if (isChecked) { | ||
| additionalMetrics.show(); | ||
| } else { | ||
| additionalMetrics.hide(); | ||
| } |
Maybe, it depends on OS. I use Pop!_OS which is based on Ubuntu. |
|
I've reflected comments and modified the captures in the description. |
|
Test build #120155 has finished for PR 27927 at commit
|
|
Test build #120157 has finished for PR 27927 at commit
|
|
Thanks, merging to master/3.0 |
…of sql metrics toggleable ### What changes were proposed in this pull request? This is another solution for `SPARK-31081` and #27849 . I added a checkbox which can toggle display of stageId/taskid in the SQL's DAG page. Mainly, I implemented the toggleable texts in boxes with HTML label feature provided by `dagre-d3`. The additional metrics are enclosed by `<span>` and control the appearance of the text. But the exception is additional metrics in clusters. We can use HTML label for cluster but layout will be broken so I choosed normal text label for clusters. Due to that, this solution contains a little bit tricky code in`spark-sql-viz.js` to manipulate the metric texts and generate DOMs. ### Why are the changes needed? It makes metrics harder to read after #26843 and user may not interest in extra info(stageId/StageAttemptId/taskId ) when they do not need debug. #27849 control the appearance by a new configuration property but providing a checkbox is more flexible. ### Does this PR introduce any user-facing change? Yes. [Additional metrics shown]  [Additional metrics hidden]  ### How was this patch tested? Tested manually with a simple DataFrame operation. * The appearance of additional metrics in the boxes are controlled by the newly added checkbox. * No error found with JS-debugger. * Checked/not-checked state is preserved after reloading. Closes #27927 from sarutak/SPARK-31081. Authored-by: Kousuke Saruta <sarutak@oss.nttdata.com> Signed-off-by: Gengliang Wang <gengliang.wang@databricks.com> (cherry picked from commit 999c9ed) Signed-off-by: Gengliang Wang <gengliang.wang@databricks.com>
|
|
||
| // labelSeparator should be a non-graphical character in order not to affect the width of boxes. | ||
| var labelSeparator = "\x01"; | ||
| var stageAndTaskMetricsPattern = "^(.*)(\\(stage.*attempt.*task[^)]*\\))(.*)$"; |
There was a problem hiding this comment.
Not related to this PR, but a minor comment: now we display task info like stage 1 (attempt 2): task 3. A more standard (and simpler) way to refer to a stage is stage 1.2: task 3.
@sarutak can you help fix it?
There was a problem hiding this comment.
That makes sense. I'll fix it.
…StageId ### What changes were proposed in this pull request? In ExecutionPage, metrics format for stageId, attemptId and taskId are displayed like `(stageId (attemptId): taskId)` for now. I changed this format like `(stageId.attemptId taskId)`. ### Why are the changes needed? As cloud-fan suggested [here](#27927 (comment)), `stageId.attemptId` is more standard in Spark. ### Does this PR introduce any user-facing change? Yes. Before applying this change, we can see the UI like as follows.  And after this change applied, we can like as follows.  ### How was this patch tested? Modified `SQLMetricsSuite` and manual test. Closes #28039 from sarutak/improve-metrics-format. Authored-by: Kousuke Saruta <sarutak@oss.nttdata.com> Signed-off-by: Wenchen Fan <wenchen@databricks.com>
…StageId ### What changes were proposed in this pull request? In ExecutionPage, metrics format for stageId, attemptId and taskId are displayed like `(stageId (attemptId): taskId)` for now. I changed this format like `(stageId.attemptId taskId)`. ### Why are the changes needed? As cloud-fan suggested [here](#27927 (comment)), `stageId.attemptId` is more standard in Spark. ### Does this PR introduce any user-facing change? Yes. Before applying this change, we can see the UI like as follows.  And after this change applied, we can like as follows.  ### How was this patch tested? Modified `SQLMetricsSuite` and manual test. Closes #28039 from sarutak/improve-metrics-format. Authored-by: Kousuke Saruta <sarutak@oss.nttdata.com> Signed-off-by: Wenchen Fan <wenchen@databricks.com> (cherry picked from commit bc37fdc) Signed-off-by: Wenchen Fan <wenchen@databricks.com>
…of sql metrics toggleable ### What changes were proposed in this pull request? This is another solution for `SPARK-31081` and apache#27849 . I added a checkbox which can toggle display of stageId/taskid in the SQL's DAG page. Mainly, I implemented the toggleable texts in boxes with HTML label feature provided by `dagre-d3`. The additional metrics are enclosed by `<span>` and control the appearance of the text. But the exception is additional metrics in clusters. We can use HTML label for cluster but layout will be broken so I choosed normal text label for clusters. Due to that, this solution contains a little bit tricky code in`spark-sql-viz.js` to manipulate the metric texts and generate DOMs. ### Why are the changes needed? It makes metrics harder to read after apache#26843 and user may not interest in extra info(stageId/StageAttemptId/taskId ) when they do not need debug. apache#27849 control the appearance by a new configuration property but providing a checkbox is more flexible. ### Does this PR introduce any user-facing change? Yes. [Additional metrics shown]  [Additional metrics hidden]  ### How was this patch tested? Tested manually with a simple DataFrame operation. * The appearance of additional metrics in the boxes are controlled by the newly added checkbox. * No error found with JS-debugger. * Checked/not-checked state is preserved after reloading. Closes apache#27927 from sarutak/SPARK-31081. Authored-by: Kousuke Saruta <sarutak@oss.nttdata.com> Signed-off-by: Gengliang Wang <gengliang.wang@databricks.com>
…StageId ### What changes were proposed in this pull request? In ExecutionPage, metrics format for stageId, attemptId and taskId are displayed like `(stageId (attemptId): taskId)` for now. I changed this format like `(stageId.attemptId taskId)`. ### Why are the changes needed? As cloud-fan suggested [here](apache#27927 (comment)), `stageId.attemptId` is more standard in Spark. ### Does this PR introduce any user-facing change? Yes. Before applying this change, we can see the UI like as follows.  And after this change applied, we can like as follows.  ### How was this patch tested? Modified `SQLMetricsSuite` and manual test. Closes apache#28039 from sarutak/improve-metrics-format. Authored-by: Kousuke Saruta <sarutak@oss.nttdata.com> Signed-off-by: Wenchen Fan <wenchen@databricks.com>

What changes were proposed in this pull request?
This is another solution for
SPARK-31081and #27849 .I added a checkbox which can toggle display of stageId/taskid in the SQL's DAG page.
Mainly, I implemented the toggleable texts in boxes with HTML label feature provided by
dagre-d3.The additional metrics are enclosed by
<span>and control the appearance of the text.But the exception is additional metrics in clusters.
We can use HTML label for cluster but layout will be broken so I choosed normal text label for clusters.
Due to that, this solution contains a little bit tricky code in
spark-sql-viz.jsto manipulate the metric texts and generate DOMs.Why are the changes needed?
It makes metrics harder to read after #26843 and user may not interest in extra info(stageId/StageAttemptId/taskId ) when they do not need debug.
#27849 control the appearance by a new configuration property but providing a checkbox is more flexible.
Does this PR introduce any user-facing change?
Yes.

[Additional metrics shown]
[Additional metrics hidden]

How was this patch tested?
Tested manually with a simple DataFrame operation.