【问题标题】:Fetching info from JVM MBeans从 JVM MBean 获取信息
【发布时间】:2014-07-10 02:33:59
【问题描述】:

我试图使用 JVM MBean 为我的监控应用程序获取以下详细信息

    thread-states.blocked
    thread-states.waiting
    gc.ConcurrentMarkSweep.runs
    gc.ParNew.runs
    thread_count
    daemon_thread_count
    memory.heap_usage
    memory.non_heap_usage

除了

之外,我可以获取大部分
    thread-states.blocked
    thread-states.waiting
    gc.ConcurrentMarkSweep.runs
    gc.ParNew.runs

有人知道可以使用什么 MBean 和属性来收集这些值吗? PS:我在这里发布之前已经用谷歌搜索了这个

【问题讨论】:

    标签: java jvm jmx mbeans


    【解决方案1】:
    thread-states.blocked
    thread-states.waiting
    

    您可以使用getAllThreadIds() 获取每个线程的信息getThreadInfo() 并根据状态进行过滤

    gc.ConcurrentMarkSweep.runs
    gc.ParNew.runs
    

    get getGarbageCollectorMXBeans() 为 CMS 和 ParNew 和 getCollectionCount() 过滤它们

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2015-01-31
      • 2015-09-15
      • 1970-01-01
      • 2014-05-12
      • 2021-01-06
      • 2018-06-18
      • 2014-10-20
      相关资源
      最近更新 更多