Мне нужно получить информацию о HttpThreads, а не только jvm threads. Я изменил подсистему подписи 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>
Спасибо за упоминания о нем Алесь. Я думаю, что я обновлю статью, чтобы включить ее в конфигурацию 7. –
Спасибо, это было полезно! – VoV4a