Skip to content

Commit

Permalink
[KYUUBI #4364] Add metrics for user opened connections with session type
Browse files Browse the repository at this point in the history
### _Why are the changes needed?_

Add metrics for user opened connections with session type

### _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/develop_tools/testing.html#running-tests) locally before make a pull request

Closes #4364 from turboFei/user_session_type.

Closes #4364

d9505f2 [fwang12] get

Authored-by: fwang12 <fwang12@ebay.com>
Signed-off-by: fwang12 <fwang12@ebay.com>
  • Loading branch information
turboFei committed Feb 18, 2023
1 parent ba1a868 commit e60855f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/monitor/metrics.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ These metrics include:
| `kyuubi.connection.total` | `${sessionType}` | counter | 1.7.0 | <div style='width: 150pt;word-wrap: break-word;white-space: normal'> cumulative connection count with session type `${sessionType}`</div> |
| `kyuubi.connection.opened` | | gauge | 1.2.0 | <div style='width: 150pt;word-wrap: break-word;white-space: normal'> current active connection count</div> |
| `kyuubi.connection.opened` | `${user}` | counter | 1.2.0 | <div style='width: 150pt;word-wrap: break-word;white-space: normal'> current active connections count requested by a `${user}`</div> |
| `kyuubi.connection.opened` | `${user}`</br>`${sessionType}` | counter | 1.7.0 | <div style='width: 150pt;word-wrap: break-word;white-space: normal'> current active connections count requested by a `${user}` with session type `${sessionType}`</div> |
| `kyuubi.connection.opened` | `${sessionType}` | counter | 1.7.0 | <div style='width: 150pt;word-wrap: break-word;white-space: normal'> current active connections count with session type `${sessionType}`</div> |
| `kyuubi.connection.failed` | | counter | 1.2.0 | <div style='width: 150pt;word-wrap: break-word;white-space: normal'> cumulative failed connection count</div> |
| `kyuubi.connection.failed` | `${user}` | counter | 1.2.0 | <div style='width: 150pt;word-wrap: break-word;white-space: normal'> cumulative failed connections for a `${user}`</div> |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,13 @@ abstract class KyuubiSession(
ms.incCount(CONN_TOTAL)
ms.incCount(MetricRegistry.name(CONN_TOTAL, sessionType.toString))
ms.incCount(MetricRegistry.name(CONN_OPEN, user))
ms.incCount(MetricRegistry.name(CONN_OPEN, user, sessionType.toString))
ms.incCount(MetricRegistry.name(CONN_OPEN, sessionType.toString))
}

protected def traceMetricsOnClose(): Unit = MetricsSystem.tracing { ms =>
ms.decCount(MetricRegistry.name(CONN_OPEN, user))
ms.decCount(MetricRegistry.name(CONN_OPEN, user, sessionType.toString))
ms.decCount(MetricRegistry.name(CONN_OPEN, sessionType.toString))
}
}

0 comments on commit e60855f

Please sign in to comment.