Skip to content

Commit

Permalink
Display the CPU time consumed by the statement in the Engine tab
Browse files Browse the repository at this point in the history
  • Loading branch information
XorSum committed Feb 28, 2024
1 parent 444d4aa commit 0638ec9
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,7 @@ case class EnginePage(parent: EngineTab) extends WebUIPage("") {
("Start Time", true, None),
("Finish Time", true, None),
("Duration", true, None),
("Cpu Time", true, None),
("Total Statements", true, None))

headerStatRow(
Expand All @@ -428,6 +429,7 @@ case class EnginePage(parent: EngineTab) extends WebUIPage("") {
<td> {formatDate(session.startTime)} </td>
<td> {if (session.endTime > 0) formatDate(session.endTime)} </td>
<td> {formatDuration(session.duration)} </td>
<td> {formatDuration(session.sessionCpuTime / 1000000)} </td>
<td> {session.totalOperations} </td>
</tr>
}
Expand Down Expand Up @@ -484,6 +486,7 @@ private class StatementStatsPagedTable(
("Create Time", true, None),
("Finish Time", true, None),
("Duration", true, None),
("Cpu Time", true, None),
("Statement", true, None),
("State", true, None),
("Query Details", true, None),
Expand Down Expand Up @@ -523,6 +526,7 @@ private class StatementStatsPagedTable(
<td >
{formatDuration(event.duration)}
</td>
<td> {formatDuration(event.operationCpuTime.getOrElse(0L) / 1000000)} </td>
<td>
<span class="description-input">
{event.statement}
Expand Down Expand Up @@ -592,6 +596,7 @@ private class SessionStatsTableDataSource(
case "Start Time" => Ordering.by(_.startTime)
case "Finish Time" => Ordering.by(_.endTime)
case "Duration" => Ordering.by(_.duration)
case "Cpu Time" => Ordering.by(_.sessionCpuTime)
case "Total Statements" => Ordering.by(_.totalOperations)
case unknownColumn => throw new IllegalArgumentException(s"Unknown column: $unknownColumn")
}
Expand Down Expand Up @@ -627,6 +632,7 @@ private class StatementStatsTableDataSource(
case "Create Time" => Ordering.by(_.createTime)
case "Finish Time" => Ordering.by(_.completeTime)
case "Duration" => Ordering.by(_.duration)
case "Cpu Time" => Ordering.by(_.operationCpuTime.getOrElse(0L))
case "Statement" => Ordering.by(_.statement)
case "State" => Ordering.by(_.state)
case "Query Details" => Ordering.by(_.executionId)
Expand Down

0 comments on commit 0638ec9

Please sign in to comment.