[KYUUBI #1699] Improve codahale metric
<!-- Thanks for sending a pull request! Here are some tips for you: 1. If this is your first time, please read our contributor guidelines: https://kyuubi.readthedocs.io/en/latest/community/contributions.html 2. If the PR is related to an issue in https://github.com/apache/incubator-kyuubi/issues, add '[KYUUBI #XXXX]' in your PR title, e.g., '[KYUUBI #XXXX] Your PR title ...'. 3. If the PR is unfinished, add '[WIP]' in your PR title, e.g., '[WIP][KYUUBI #XXXX] Your PR title ...'. --> ### _Why are the changes needed?_ <!-- Please clarify why the changes are needed. For instance, 1. If you add a feature, you can talk about the use case of it. 2. If you fix a bug, you can clarify why it is a bug. --> Improve the codahale metric registered in MetricsSystem. ### _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 Before:  After:  - [x] [Run test](https://kyuubi.readthedocs.io/en/latest/develop_tools/testing.html#running-tests) locally before make a pull request Closes #1782 from zhenjiaguo/improve_codahale_metric. Closes #1699 73ac95be [zhenjiaguo] improve codahale metric Authored-by: zhenjiaguo <zhenjiaguo@gmail.com> Signed-off-by: Kent Yao <yao@apache.org>
This commit is contained in:
parent
53bbbb7161
commit
7ef612cdea
@ -21,6 +21,12 @@ object MetricsConstants {
|
||||
|
||||
final private val KYUUBI = "kyuubi."
|
||||
|
||||
final val GC_METRIC: String = KYUUBI + "gc"
|
||||
final val MEMORY_USAGE: String = KYUUBI + "memory_usage"
|
||||
final val BUFFER_POOL: String = KYUUBI + "buffer_pool"
|
||||
final val THREAD_STATE: String = KYUUBI + "thread_state"
|
||||
final val CLASS_LOADING: String = KYUUBI + "class_loading"
|
||||
|
||||
final val EXEC_POOL_ALIVE: String = KYUUBI + "exec.pool.threads.alive"
|
||||
final val EXEC_POOL_ACTIVE: String = KYUUBI + "exec.pool.threads.active"
|
||||
|
||||
|
||||
@ -67,10 +67,13 @@ class MetricsSystem extends CompositeService("MetricsSystem") {
|
||||
}
|
||||
|
||||
override def initialize(conf: KyuubiConf): Unit = synchronized {
|
||||
registry.registerAll(new GarbageCollectorMetricSet)
|
||||
registry.registerAll(new MemoryUsageGaugeSet)
|
||||
registry.registerAll(new BufferPoolMetricSet(ManagementFactory.getPlatformMBeanServer))
|
||||
registry.registerAll(new ThreadStatesGaugeSet)
|
||||
registry.registerAll(MetricsConstants.GC_METRIC, new GarbageCollectorMetricSet)
|
||||
registry.registerAll(MetricsConstants.MEMORY_USAGE, new MemoryUsageGaugeSet)
|
||||
registry.registerAll(
|
||||
MetricsConstants.BUFFER_POOL,
|
||||
new BufferPoolMetricSet(ManagementFactory.getPlatformMBeanServer))
|
||||
registry.registerAll(MetricsConstants.THREAD_STATE, new ThreadStatesGaugeSet)
|
||||
registry.registerAll(MetricsConstants.CLASS_LOADING, new ClassLoadingGaugeSet)
|
||||
|
||||
conf.get(METRICS_REPORTERS).map(ReporterType.withName).foreach {
|
||||
case JSON => addService(new JsonReporterService(registry))
|
||||
|
||||
Loading…
Reference in New Issue
Block a user