From cff7eb6256ccf98b087f93d6c3c06903aba9084a Mon Sep 17 00:00:00 2001 From: liangbowen Date: Thu, 6 Jul 2023 17:11:29 +0800 Subject: [PATCH] [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 Signed-off-by: liangbowen --- .../src/main/scala/org/apache/spark/ui/EnginePage.scala | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/externals/kyuubi-spark-sql-engine/src/main/scala/org/apache/spark/ui/EnginePage.scala b/externals/kyuubi-spark-sql-engine/src/main/scala/org/apache/spark/ui/EnginePage.scala index a2a2931f4..83626dac5 100644 --- a/externals/kyuubi-spark-sql-engine/src/main/scala/org/apache/spark/ui/EnginePage.scala +++ b/externals/kyuubi-spark-sql-engine/src/main/scala/org/apache/spark/ui/EnginePage.scala @@ -292,7 +292,7 @@ case class EnginePage(parent: EngineTab) extends WebUIPage("") { {session.name} {formatDate(session.startTime)} {if (session.endTime > 0) formatDate(session.endTime)} - {formatDurationVerbose(session.duration)} + {formatDuration(session.duration)} {session.totalOperations} } @@ -386,7 +386,7 @@ private class StatementStatsPagedTable( {if (event.completeTime > 0) formatDate(event.completeTime)} - {formatDurationVerbose(event.duration)} + {formatDuration(event.duration)}