2013-05-31 134 views
2

我想監視jboss中的HTTP偵聽器線程爲7.我該怎麼做? 有沒有任何MBeans,女巫允許這樣做?Jboss as7監測HTTP偵聽器線程

網絡子系統只包含一般信息,但我想監控:

  • ​​
  • http-thread-current
  • http-thread-busy
  • http-thread-spare-max
  • http-thread-spare-min

回答

1

我需要獲取有關HttpThreads,不僅jvm線程的信息。 我修改了standalone.xml的線程子系統並通過Jboss DMR我得到了http線程度量。

ModelNode request = new ModelNode(); 
request.get(ClientConstants.OP).set("read-resource"); 
request.get(ClientConstants.OP_ADDR).add("subsystem", "threads"); 
request.get("recursive").set(true); 
request.get("include-runtime").set(true); 
final ModelNode response = client.execute(new OperationBuilder(request).build()); 
return response.get(ClientConstants.RESULT).get("bounded-queue-thread-pool").get("http_queue"); 

Standalone.xml線程子系統的樣子:

<subsystem xmlns="urn:jboss:domain:threads:1.1"> 
<thread-factory name="my_tf" group-name="group1" thread-name-pattern="my_tf_" priority="1"/> 
<bounded-queue-thread-pool name="http_queue" allow-core-timeout="true"> 
<core-threads count="100"/> 
<queue-length count="50"/> 
<max-threads count="200"/> 
<keepalive-time time="30" unit="minutes"/> 
<thread-factory name="my_tf"/> 
</bounded-queue-thread-pool> 
</subsystem>