此内容没有您所选择的语言版本。

11.11. Enabling the JBoss Metrics Plug-in


The JBoss Metrics plug-in supports JBoss EAP 6 and JBossAS 7 version cartridges and is used to print JBoss metrics to stdout.
Enable the JBoss metrics plug-in by ensuring your JBoss application has the following in the application's standalone.xml file within the <extensions> element:
<extension module="com.openshift.metrics"/>
Copy to Clipboard Toggle word wrap
Then configure the metrics subsystem inside the <profile> element to look similar to the following:

Example 11.16. JBoss Metrics Plug-in XML

<subsystem xmlns="urn:redhat:openshift:metrics:1.0">
  <max-line-length>1024</max-line-length>
  <metrics-group cron="*/5 * * * * ?">
    <source type="jboss" path="core-service=platform-mbean/type=memory-pool/name=CMS_Old_Gen">
      <metric source-key="usage.used" publish-key="oldgen.used" />
      <metric source-key="usage.max" publish-key="oldgen.max" />
      <metric source-key="usage.committed" publish-key="oldgen.committed" />
    </source>
    <source path="java.lang:type=Memory" type="mbean">
      <metric source-key="HeapMemoryUsage.used" publish-key="jmx.heap.used"/>
    </source>
  </metrics-group>
</subsystem>
Copy to Clipboard Toggle word wrap
As in the above example, you can specify one or more sources inside a metrics group. Anything that is a valid JBoss resource, such as core-service=platform-mbean/type=memory-pool/name=CMS_Old_Gen, or a valid MBean, such as java.lang:type=Memory can be a source. Each source has a type (jboss or mbean) and a path, which is the name of the resource. A source contains one or more data points that can be read and published. You can specify a source-key (the location in the source of the data point) and a publish-key (the label of the information when written to stdout). Metrics are printed to stdout similar to the following:

Example 11.17. Logged Metrics Data

Jun 10 16:25:39 vm openshift-platform[29398]: type=metric appName=php6 gear=53961099e659c55b08000102 app=53961099e659c55b08000102 ns=demo quota.blocks.used=988 quota.blocks.limit=1048576 quota.files.used=229 quota.files.limit=80000
Copy to Clipboard Toggle word wrap
You can specify one or more metrics-group entries in order to group together the data points you wish to emit at any interval. For example, to emit memory data every 10 seconds but database connection pool data every 30 seconds, you would need two different metrics groups, because their schedules are different.
Note that you can add enabled="false" to any <metrics-group>, <source>, or <metric> attribute to disable it from being logged:
<metrics-group enabled="false">
Copy to Clipboard Toggle word wrap
返回顶部
Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。 了解我们当前的更新.

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

Theme

© 2025 Red Hat