[KYUUBI #5025] Use formatDuration instead of formatDurationVerbose in SparkUI's engine tab

### _Why are the changes needed?_

- previously used `formatDurationVerbose` generates duration with dedicated unit parts
- Spark UI itself also uses `formatDuration` in its Job/Stage pages for displaying duration
   - `JobDataUtil.getFormattedDuration` in AllJobsPage, and `formatDuration` used in `getFormattedDuration` , https://github.com/apache/spark/blob/v3.3.2/core/src/main/scala/org/apache/spark/ui/jobs/JobDataUtil.scala#L32

Before:
![image](https://github.com/apache/kyuubi/assets/1935105/e7fce841-5519-4bf9-bc04-701ea2a90dae)

After:
![image](https://github.com/apache/kyuubi/assets/1935105/b2805183-b7ea-4d4a-af9e-d532019dae31)

### _How was this patch tested?_
- [ ] Add some test cases that check the changes thoroughly including negative and positive cases if possible

- [ ] Add screenshots for manual tests if appropriate

- [x] [Run test](https://kyuubi.readthedocs.io/en/master/contributing/code/testing.html#running-tests) locally before make a pull request

Closes #5025 from bowenliang123/format-duration.

Closes #5025

dc214acac [liangbowen] use formatDuration instead of formatDurationVerbose for duration in Engine tab

Authored-by: liangbowen <liangbowen@gf.com.cn>
Signed-off-by: liangbowen <liangbowen@gf.com.cn>
This commit is contained in:
liangbowen 2023-07-06 17:11:29 +08:00
parent 11dcd30e88
commit cff7eb6256

View File

@ -292,7 +292,7 @@ case class EnginePage(parent: EngineTab) extends WebUIPage("") {
<td> {session.name} </td>
<td> {formatDate(session.startTime)} </td>
<td> {if (session.endTime > 0) formatDate(session.endTime)} </td>
<td> {formatDurationVerbose(session.duration)} </td>
<td> {formatDuration(session.duration)} </td>
<td> {session.totalOperations} </td>
</tr>
}
@ -386,7 +386,7 @@ private class StatementStatsPagedTable(
{if (event.completeTime > 0) formatDate(event.completeTime)}
</td>
<td >
{formatDurationVerbose(event.duration)}
{formatDuration(event.duration)}
</td>
<td>
<span class="description-input">