davidyuan1223 commented on code in PR #5410:
URL: https://github.com/apache/kyuubi/pull/5410#discussion_r1369494931


##########
externals/kyuubi-spark-sql-engine/src/main/scala/org/apache/spark/kyuubi/SparkConsoleProgressBar.scala:
##########
@@ -81,7 +93,11 @@ class SparkConsoleProgressBar(
     val width = TerminalWidth / stages.size

Review Comment:
   i use the debug to test the width
   1. this show the lastProgressbar show there only 1 stage, the bar show there 
have 3 stages
   
![image-20231024104430257](https://github.com/apache/kyuubi/assets/51512358/ac435c2f-c336-41e4-a5d3-eefa6171ea0b)
   
   2. our terminalWidth default is 80, i think it's the best width to show 
progress info, the follow show when we make the default terminalWith is 180, it 
will show too long
   
![image-20231024104935906](https://github.com/apache/kyuubi/assets/51512358/f609e613-5ffd-43d5-9c92-64b5b1027006)
   
   there are 2 advice to improvement this
   1. only display 1 stage at the same time
   2. the not improvement logic is. 
   ```
   // length 9
   val header = s"[Stage ${s.stageId}:"
   // length 12~15
   val tailer = s"(${s.numCompleteTasks} + ${s.numActiveTasks}) / $total]"
   // if there have 3 stages, the width is 27. it will show 3~6 precent info
   val w = width - header.length - tailer.length
   ```
   we can add jobHeader.length in the expr `val w = width - header.length - 
tailer.length + jobHeader.lenght`, because we add job Info, so i think it's the 
best way
   
![image](https://github.com/apache/kyuubi/assets/51512358/d20f985d-4fac-4f76-8290-63c726767c27)
   just like the photo , the bar show 3 stages at the same time, the 
lastProgressBar show only 1 stage at the same time
   
   
   the photo is my debug and test,first and third line show only 1 stage 
display, second line show if 3 stages at the same time
   
![image](https://github.com/apache/kyuubi/assets/51512358/e7a1be7e-1b3d-414a-98d6-2d1ae4accfb6)
   
   what do you think? @wForget @cxzl25 
   



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

To unsubscribe, e-mail: [email protected]

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