Skip to content

Commit

Permalink
[KYUUBI #2976] Expose session name into kyuubi engine tab
Browse files Browse the repository at this point in the history
### _Why are the changes needed?_

Expose the session name in engine tab to make it more clear.

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

- [x] Add screenshots for manual tests if appropriate
<img width="1724" alt="image" src="https://user-images.githubusercontent.com/6757692/176633011-7a3e9af3-7949-4a45-a7bc-8debebc2d376.png">

- [ ] [Run test](https://kyuubi.apache.org/docs/latest/develop_tools/testing.html#running-tests) locally before make a pull request

Closes #2976 from turboFei/session_name.

Closes #2976

0597561 [Fei Wang] save
03b577c [Fei Wang] expose session name

Authored-by: Fei Wang <fwang12@ebay.com>
Signed-off-by: Fei Wang <fwang12@ebay.com>
  • Loading branch information
turboFei committed Jun 30, 2022
1 parent cec8b03 commit 2d0bb9f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
Expand Up @@ -39,6 +39,7 @@ import org.apache.kyuubi.events.KyuubiEvent
*/
case class SessionEvent(
@KVIndexParam sessionId: String,
name: String,
engineId: String,
username: String,
ip: String,
Expand Down Expand Up @@ -67,6 +68,7 @@ object SessionEvent {
def apply(session: SparkSessionImpl): SessionEvent = {
new SessionEvent(
session.handle.identifier.toString,
session.name.getOrElse(""),
KyuubiSparkUtil.engineId,
session.user,
session.ipAddress,
Expand Down
Expand Up @@ -250,6 +250,7 @@ case class EnginePage(parent: EngineTab) extends WebUIPage("") {
("Client IP", true, None),
("Server IP", true, None),
("Session ID", true, None),
("Session Name", true, None),
("Start Time", true, None),
("Finish Time", true, None),
("Duration", true, None),
Expand All @@ -275,6 +276,7 @@ case class EnginePage(parent: EngineTab) extends WebUIPage("") {
<td> {session.ip} </td>
<td> {session.serverIp} </td>
<td> <a href={sessionLink}> {session.sessionId} </a> </td>
<td> {session.name} </td>
<td> {formatDate(session.startTime)} </td>
<td> {if (session.endTime > 0) formatDate(session.endTime)} </td>
<td> {formatDurationVerbose(session.duration)} </td>
Expand Down Expand Up @@ -428,6 +430,7 @@ private class SessionStatsTableDataSource(
case "Client IP" => Ordering.by(_.ip)
case "Server IP" => Ordering.by(_.serverIp)
case "Session ID" => Ordering.by(_.sessionId)
case "Session Name" => Ordering.by(_.name)
case "Start Time" => Ordering.by(_.startTime)
case "Finish Time" => Ordering.by(_.endTime)
case "Duration" => Ordering.by(_.duration)
Expand Down

0 comments on commit 2d0bb9f

Please sign in to comment.