<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<subsystem xmlns="urn:org.hawkular.agent:agent:1.0" enabled="${hawkular.agent.enabled:true}" immutable="${hawkular.agent.immutable:false}" in-container="${hawkular.agent.in-container:false}" auto-discovery-scan-period-secs="600" min-collection-interval-secs="${hawkular.agent.minCollectionIntervalSecs:30}">

    <diagnostics enabled="true" report-to="LOG" interval="1" time-units="minutes"/>

    <storage-adapter type="HAWKULAR" tenant-id="${hawkular.rest.tenantId:hawkular}" feed-id="${hawkular.rest.feedId:autogenerate}" username="${hawkular.rest.user}" password="${hawkular.rest.password}"/>

    <!-- EAP6 metadata below -->

    <metric-set-dmr name="WildFly Memory Metrics" enabled="true">
      <metric-dmr name="Heap Used" interval="30" time-units="seconds" metric-units="bytes" path="/core-service=platform-mbean/type=memory" attribute="heap-memory-usage#used"/>
      <metric-dmr name="Heap Committed" interval="1" time-units="minutes" metric-units="bytes" path="/core-service=platform-mbean/type=memory" attribute="heap-memory-usage#committed"/>
      <metric-dmr name="Heap Max" interval="1" time-units="minutes" metric-units="bytes" path="/core-service=platform-mbean/type=memory" attribute="heap-memory-usage#max"/>
      <metric-dmr name="NonHeap Used" interval="30" time-units="seconds" metric-units="bytes" path="/core-service=platform-mbean/type=memory" attribute="non-heap-memory-usage#used"/>
      <metric-dmr name="NonHeap Committed" interval="1" time-units="minutes" metric-units="bytes" path="/core-service=platform-mbean/type=memory" attribute="non-heap-memory-usage#committed"/>
      <metric-dmr name="Accumulated GC Duration" metric-type="counter" interval="1" time-units="minutes" metric-units="milliseconds" path="/core-service=platform-mbean/type=garbage-collector/name=*" attribute="collection-time"/>
    </metric-set-dmr>

    <metric-set-dmr name="WildFly Threading Metrics" enabled="true">
      <metric-dmr name="Thread Count" interval="2" time-units="minutes" metric-units="none" path="/core-service=platform-mbean/type=threading" attribute="thread-count"/>
    </metric-set-dmr>

    <metric-set-dmr name="WildFly Aggregated Web Metrics" enabled="true">
      <metric-dmr name="Aggregated Active Web Sessions" interval="1" time-units="minutes" path="/deployment=*/subsystem=web" attribute="active-sessions"/>
      <metric-dmr name="Aggregated Max Active Web Sessions" interval="1" time-units="minutes" path="/deployment=*/subsystem=web" attribute="max-active-sessions"/>
      <metric-dmr name="Aggregated Expired Web Sessions" metric-type="counter" interval="1" time-units="minutes" path="/deployment=*/subsystem=web" attribute="expired-sessions"/>
      <metric-dmr name="Aggregated Rejected Web Sessions" metric-type="counter" interval="1" time-units="minutes" path="/deployment=*/subsystem=web" attribute="rejected-sessions"/>
      <metric-dmr name="Aggregated Servlet Request Time" metric-type="counter" interval="1" time-units="minutes" path="/deployment=*/subsystem=web/servlet=*" attribute="processingTime"/>
      <metric-dmr name="Aggregated Servlet Request Count" metric-type="counter" interval="1" time-units="minutes" path="/deployment=*/subsystem=web/servlet=*" attribute="requestCount"/>
    </metric-set-dmr>

    <metric-set-dmr name="Web Subsystem Metrics" enabled="true">
      <metric-dmr name="Active Sessions" interval="2" time-units="minutes" path="/subsystem=web" attribute="active-sessions"/>
      <metric-dmr name="Sessions Created" metric-type="counter" interval="2" time-units="minutes" path="/subsystem=web" attribute="sessions-created"/>
      <metric-dmr name="Expired Sessions" metric-type="counter" interval="2" time-units="minutes" path="/subsystem=web" attribute="expired-sessions"/>
      <metric-dmr name="Rejected Sessions" metric-type="counter" interval="2" time-units="minutes" path="/subsystem=web" attribute="rejected-sessions"/>
      <metric-dmr name="Max Active Sessions" interval="2" time-units="minutes" path="/subsystem=web" attribute="max-active-sessions"/>
    </metric-set-dmr>

    <metric-set-dmr name="Servlet Metrics" enabled="true">
      <metric-dmr name="Max Request Time" interval="5" time-units="minutes" metric-units="milliseconds" path="/" attribute="maxTime"/>
      <metric-dmr name="Min Request Time" interval="5" time-units="minutes" metric-units="milliseconds" path="/" attribute="min-time"/>
      <metric-dmr name="Total Request Time" interval="5" time-units="minutes" metric-units="milliseconds" path="/" attribute="processingTime"/>
      <metric-dmr name="Request Count" metric-type="counter" interval="5" time-units="minutes" path="/" attribute="requestCount"/>
    </metric-set-dmr>

    <metric-set-dmr name="Singleton EJB Metrics" enabled="true">
      <metric-dmr name="Execution Time" interval="5" time-units="minutes" path="/" attribute="execution-time"/>
      <metric-dmr name="Invocations" metric-type="counter" interval="5" time-units="minutes" path="/" attribute="invocations"/>
      <metric-dmr name="Peak Concurrent Invocations" interval="5" time-units="minutes" path="/" attribute="peak-concurrent-invocations"/>
      <metric-dmr name="Wait Time" interval="5" time-units="minutes" path="/" attribute="wait-time"/>
    </metric-set-dmr>

    <metric-set-dmr name="Message Driven EJB Metrics" enabled="true">
      <metric-dmr name="Execution Time" interval="5" time-units="minutes" path="/" attribute="execution-time"/>
      <metric-dmr name="Invocations" metric-type="counter" interval="5" time-units="minutes" path="/" attribute="invocations"/>
      <metric-dmr name="Peak Concurrent Invocations" interval="5" time-units="minutes" path="/" attribute="peak-concurrent-invocations"/>
      <metric-dmr name="Wait Time" interval="5" time-units="minutes" path="/" attribute="wait-time"/>
      <metric-dmr name="Pool Available Count" interval="5" time-units="minutes" path="/" attribute="pool-available-count"/>
      <metric-dmr name="Pool Create Count" interval="5" time-units="minutes" path="/" attribute="pool-create-count"/>
      <metric-dmr name="Pool Current Size" interval="5" time-units="minutes" path="/" attribute="pool-current-size"/>
      <metric-dmr name="Pool Max Size" interval="5" time-units="minutes" path="/" attribute="pool-max-size"/>
      <metric-dmr name="Pool Remove Count" interval="5" time-units="minutes" path="/" attribute="pool-remove-count"/>
    </metric-set-dmr>

    <metric-set-dmr name="Stateless Session EJB Metrics" enabled="true">
      <metric-dmr name="Execution Time" interval="5" time-units="minutes" path="/" attribute="execution-time"/>
      <metric-dmr name="Invocations" metric-type="counter" interval="5" time-units="minutes" path="/" attribute="invocations"/>
      <metric-dmr name="Peak Concurrent Invocations" interval="5" time-units="minutes" path="/" attribute="peak-concurrent-invocations"/>
      <metric-dmr name="Wait Time" interval="5" time-units="minutes" path="/" attribute="wait-time"/>
      <metric-dmr name="Pool Availabile Count" interval="5" time-units="minutes" path="/" attribute="pool-available-count"/>
      <metric-dmr name="Pool Create Count" interval="5" time-units="minutes" path="/" attribute="pool-create-count"/>
      <metric-dmr name="Pool Current Size" interval="5" time-units="minutes" path="/" attribute="pool-current-size"/>
      <metric-dmr name="Pool Max Size" interval="5" time-units="minutes" path="/" attribute="pool-max-size"/>
      <metric-dmr name="Pool Remove Count" interval="5" time-units="minutes" path="/" attribute="pool-remove-count"/>
    </metric-set-dmr>

    <metric-set-dmr name="Stateful Session EJB Metrics" enabled="true">
      <metric-dmr name="Execution Time" interval="5" time-units="minutes" path="/" attribute="execution-time"/>
      <metric-dmr name="Invocations" metric-type="counter" interval="5" time-units="minutes" path="/" attribute="invocations"/>
      <metric-dmr name="Peak Concurrent Invocations" interval="5" time-units="minutes" path="/" attribute="peak-concurrent-invocations"/>
      <metric-dmr name="Wait Time" interval="5" time-units="minutes" path="/" attribute="wait-time"/>
      <metric-dmr name="Cache Size" interval="5" time-units="minutes" path="/" attribute="cache-size"/>
      <metric-dmr name="Total Size" interval="5" time-units="minutes" path="/" attribute="total-size"/>
    </metric-set-dmr>

    <metric-set-dmr name="Datasource JDBC Metrics" enabled="true">
      <metric-dmr name="Prepared Statement Cache Access Count" interval="10" time-units="minutes" path="/statistics=jdbc" attribute="PreparedStatementCacheAccessCount"/>
      <metric-dmr name="Prepared Statement Cache Add Count" interval="10" time-units="minutes" path="/statistics=jdbc" attribute="PreparedStatementCacheAddCount"/>
      <metric-dmr name="Prepared Statement Cache Current Size" interval="10" time-units="minutes" path="/statistics=jdbc" attribute="PreparedStatementCacheCurrentSize"/>
      <metric-dmr name="Prepared Statement Cache Delete Count" interval="10" time-units="minutes" path="/statistics=jdbc" attribute="PreparedStatementCacheDeleteCount"/>
      <metric-dmr name="Prepared Statement Cache Hit Count" interval="10" time-units="minutes" path="/statistics=jdbc" attribute="PreparedStatementCacheHitCount"/>
      <metric-dmr name="Prepared Statement Cache Miss Count" interval="10" time-units="minutes" path="/statistics=jdbc" attribute="PreparedStatementCacheMissCount"/>
    </metric-set-dmr>

    <metric-set-dmr name="Datasource Pool Metrics" enabled="true">
      <metric-dmr name="Active Count" interval="30" time-units="seconds" path="/statistics=pool" attribute="ActiveCount"/>
      <metric-dmr name="Available Count" interval="30" time-units="seconds" path="/statistics=pool" attribute="AvailableCount"/>
      <metric-dmr name="Average Blocking Time" interval="10" time-units="minutes" path="/statistics=pool" attribute="AverageBlockingTime"/>
      <metric-dmr name="Average Creation Time" interval="30" time-units="seconds" path="/statistics=pool" attribute="AverageCreationTime"/>
      <metric-dmr name="Created Count" interval="10" time-units="minutes" path="/statistics=pool" attribute="CreatedCount"/>
      <metric-dmr name="Destroyed Count" interval="10" time-units="minutes" path="/statistics=pool" attribute="DestroyedCount"/>
      <metric-dmr name="In Use Count" interval="30" time-units="seconds" path="/statistics=pool" attribute="InUseCount"/>
      <metric-dmr name="Max Creation Time" interval="10" time-units="minutes" path="/statistics=pool" attribute="MaxCreationTime"/>
      <metric-dmr name="Max Used Count" interval="10" time-units="minutes" path="/statistics=pool" attribute="MaxUsedCount"/>
      <metric-dmr name="Max Wait Count" interval="10" time-units="minutes" path="/statistics=pool" attribute="MaxWaitCount"/>
      <metric-dmr name="Max Wait Time" interval="10" time-units="minutes" path="/statistics=pool" attribute="MaxWaitTime"/>
      <metric-dmr name="Timed Out" interval="30" time-units="seconds" path="/statistics=pool" attribute="TimedOut"/>
      <metric-dmr name="Total Blocking Time" interval="10" time-units="minutes" path="/statistics=pool" attribute="TotalBlockingTime"/>
      <metric-dmr name="Total Creation Time" interval="10" time-units="minutes" path="/statistics=pool" attribute="TotalCreationTime"/>
    </metric-set-dmr>

    <metric-set-dmr name="Transactions Metrics" enabled="true">
      <metric-dmr name="Number of Aborted Transactions" metric-type="counter" interval="30" time-units="seconds" path="/" attribute="number-of-aborted-transactions"/>
      <metric-dmr name="Number of Application Rollbacks" metric-type="counter" interval="30" time-units="seconds" path="/" attribute="number-of-application-rollbacks"/>
      <metric-dmr name="Number of Committed Transactions" metric-type="counter" interval="30" time-units="seconds" path="/" attribute="number-of-committed-transactions"/>
      <metric-dmr name="Number of Heuristics" metric-type="counter" interval="30" time-units="seconds" path="/" attribute="number-of-heuristics"/>
      <metric-dmr name="Number of In-Flight Transactions" interval="30" time-units="seconds" path="/" attribute="number-of-inflight-transactions"/>
      <metric-dmr name="Number of Nested Transactions" metric-type="counter" interval="30" time-units="seconds" path="/" attribute="number-of-nested-transactions"/>
      <metric-dmr name="Number of Resource Rollbacks" metric-type="counter" interval="30" time-units="seconds" path="/" attribute="number-of-resource-rollbacks"/>
      <metric-dmr name="Number of Timed Out Transactions" metric-type="counter" interval="30" time-units="seconds" path="/" attribute="number-of-timed-out-transactions"/>
      <metric-dmr name="Number of Transactions" metric-type="counter" interval="30" time-units="seconds" path="/" attribute="number-of-transactions"/>
    </metric-set-dmr>

    <metric-set-dmr name="JMS Queue Metrics" enabled="true">
      <metric-dmr name="Consumer Count" interval="30" time-units="seconds" path="/" attribute="consumer-count"/>
      <metric-dmr name="Delivering Count" interval="30" time-units="seconds" path="/" attribute="delivering-count"/>
      <metric-dmr name="Message Count" interval="30" time-units="seconds" path="/" attribute="message-count"/>
      <metric-dmr name="Messages Added" metric-type="counter" interval="30" time-units="seconds" path="/" attribute="messages-added"/>
      <metric-dmr name="Scheduled Count" interval="30" time-units="seconds" path="/" attribute="scheduled-count"/>
    </metric-set-dmr>

    <metric-set-dmr name="JMS Topic Metrics" enabled="true">
      <metric-dmr name="Durable Message Count" interval="30" time-units="seconds" path="/" attribute="durable-message-count"/>
      <metric-dmr name="Durable Subscription Count" interval="30" time-units="seconds" path="/" attribute="durable-subscription-count"/>
      <metric-dmr name="Delivering Count" interval="30" time-units="seconds" path="/" attribute="delivering-count"/>
      <metric-dmr name="Message Count" interval="30" time-units="seconds" path="/" attribute="message-count"/>
      <metric-dmr name="Messages Added" metric-type="counter" interval="30" time-units="seconds" path="/" attribute="messages-added"/>
      <metric-dmr name="Non-Durable Message Count" interval="30" time-units="seconds" path="/" attribute="non-durable-message-count"/>
      <metric-dmr name="Non-Durable Subscription Count" interval="30" time-units="seconds" path="/" attribute="non-durable-subscription-count"/>
      <metric-dmr name="Subscription Count" interval="30" time-units="seconds" path="/" attribute="subscription-count"/>
    </metric-set-dmr>

    <avail-set-dmr name="Server Availability" enabled="true">
      <avail-dmr name="Server Availability" interval="30" time-units="seconds" path="/" attribute="server-state" up-regex="run.*"/>
    </avail-set-dmr>

    <avail-set-dmr name="Deployment Status" enabled="true">
      <avail-dmr name="Deployment Status" interval="1" time-units="minutes" path="/" attribute="status" up-regex="OK"/>
    </avail-set-dmr>

    <resource-type-set-dmr name="Standalone Environment" enabled="true">
      <resource-type-dmr name="WildFly Server" resource-name-template="WildFly Server [%ManagedServerName]" path="/" metric-sets="WildFly Memory Metrics,WildFly Threading Metrics,WildFly Aggregated Web Metrics" avail-sets="Server Availability">
        <resource-config-dmr name="Name" attribute="name"/>
        <resource-config-dmr name="Product Name" attribute="product-name"/>
        <resource-config-dmr name="Version" attribute="product-version"/>
        <resource-config-dmr name="Running Mode" attribute="running-mode"/>
        <resource-config-dmr name="Server State" attribute="server-state"/>
        <resource-config-dmr name="Home Directory" path="/core-service=server-environment" attribute="home-dir"/>
        <resource-config-dmr name="Node Name" path="/core-service=server-environment" attribute="node-name"/>
        <resource-config-dmr name="Hostname" path="/core-service=server-environment" attribute="qualified-host-name"/>
        <resource-config-dmr name="Bound Address" path="/socket-binding-group=standard-sockets/socket-binding=http" attribute="bound-address"/>
        <resource-config-dmr name="Immutable" path="/subsystem=hawkular-wildfly-agent" attribute="immutable" resolve-expressions="true"/>
        <resource-config-dmr name="In Container" path="/subsystem=hawkular-wildfly-agent" attribute="in-container" resolve-expressions="true"/>

        <operation-dmr name="JDR" internal-name="generate-jdr-report" path="/subsystem=jdr"/>
        <operation-dmr name="Reload" internal-name="reload" modifies="true">
          <param name="admin-only" type="bool" description="Whether the server should start in running mode ADMIN_ONLY when it restarts" default-value="false"/>
          <param name="use-current-server-config" type="bool" default-value="false"/>
        </operation-dmr>
        <operation-dmr name="Shutdown" internal-name="shutdown" modifies="true"> <!-- shutdown and restart -->
          <param name="restart" type="bool" default-value="false" description="Should the server be restarted after shutdown?"/>
        </operation-dmr>
        <operation-dmr name="Deploy" internal-name="deploy" modifies="true"/>
        <operation-dmr name="Undeploy" internal-name="undeploy" modifies="true"/>
        <operation-dmr name="Enable Deployment" internal-name="enable-deployment" modifies="true"/>
        <operation-dmr name="Disable Deployment" internal-name="disable-deployment" modifies="true"/>
        <operation-dmr name="Restart Deployment" internal-name="restart-deployment" modifies="true"/>
      </resource-type-dmr>
    </resource-type-set-dmr>

    <resource-type-set-dmr name="Domain Environment" enabled="true">
      <resource-type-dmr name="Host Controller" resource-name-template="Host Controller [%ManagedServerName]" path="/">
        <resource-config-dmr name="Product Name" attribute="product-name"/>
        <resource-config-dmr name="Version" attribute="product-version"/>
        <resource-config-dmr name="Process Type" attribute="process-type"/> <!-- (Host|Domain) Controller -->
        <resource-config-dmr name="Local Host Name" attribute="local-host-name"/>

        <operation-dmr name="Restart Servers" internal-name="restart-servers" modifies="true">
        </operation-dmr>
        <operation-dmr name="Start Servers" internal-name="start-servers" modifies="true">
        </operation-dmr>
        <operation-dmr name="Stop Servers" internal-name="stop-servers" modifies="true">
        </operation-dmr>
        <operation-dmr name="Deploy" internal-name="deploy" modifies="true"/>
        <operation-dmr name="Undeploy" internal-name="undeploy" modifies="true"/>
        <operation-dmr name="Enable Deployment" internal-name="enable-deployment" modifies="true"/>
        <operation-dmr name="Disable Deployment" internal-name="disable-deployment" modifies="true"/>
        <operation-dmr name="Restart Deployment" internal-name="restart-deployment" modifies="true"/>
      </resource-type-dmr>

      <resource-type-dmr name="Domain Profile" resource-name-template="Domain Profile [%-]" path="/profile=*" parents="Host Controller">
        <resource-config-dmr name="Name" attribute="name"/>
      </resource-type-dmr>

      <resource-type-dmr name="Domain Server Group" resource-name-template="Domain Server Group [%-]" path="/server-group=*" parents="Host Controller">
        <resource-config-dmr name="Profile" attribute="profile"/>

        <operation-dmr name="Restart Servers" internal-name="restart-servers" modifies="true">
        </operation-dmr>
        <operation-dmr name="Start Servers" internal-name="start-servers" modifies="true">
        </operation-dmr>
        <operation-dmr name="Stop Servers" internal-name="stop-servers" modifies="true">
        </operation-dmr>
      </resource-type-dmr>

      <resource-type-dmr name="Domain Host" resource-name-template="Domain Host [%-]" path="/host=*" parents="Host Controller" metric-sets="WildFly Memory Metrics,WildFly Threading Metrics">
        <resource-config-dmr name="Name" attribute="name"/>
        <resource-config-dmr name="Product Name" attribute="product-name"/>
        <resource-config-dmr name="Version" attribute="product-version"/>
        <resource-config-dmr name="Is Domain Controller" attribute="master"/>
        <resource-config-dmr name="Host State" attribute="host-state"/>
        <resource-config-dmr name="Running Mode" attribute="running-mode"/>
        <resource-config-dmr name="Server State" attribute="server-state"/>
        <resource-config-dmr name="Home Directory" path="/core-service=host-environment" attribute="home-dir"/>

        <operation-dmr name="Reload" internal-name="reload" modifies="true"/>
        <operation-dmr name="Shutdown" internal-name="shutdown" modifies="true">
          <param name="restart" type="bool" description="If true, once shutdown the host controller will be restarted again."/>
        </operation-dmr>
      </resource-type-dmr>

      <resource-type-dmr name="Domain WildFly Server" resource-name-template="Domain WildFly Server [%-]" path="/server=*" parents="Domain Host" metric-sets="WildFly Memory Metrics,WildFly Threading Metrics,WildFly Aggregated Web Metrics" avail-sets="Server Availability">
        <resource-config-dmr name="Name" attribute="name"/>
        <resource-config-dmr name="Host" attribute="host"/>
        <resource-config-dmr name="Product Name" attribute="product-name"/>
        <resource-config-dmr name="Version" attribute="product-version"/>
        <resource-config-dmr name="Profile Name" attribute="profile-name"/>
        <resource-config-dmr name="Server Group" attribute="server-group"/>
        <resource-config-dmr name="Running Mode" attribute="running-mode"/>
        <resource-config-dmr name="Server State" attribute="server-state"/>
        <resource-config-dmr name="Hostname" path="/core-service=server-environment" attribute="qualified-host-name"/>
        <resource-config-dmr name="Node Name" path="/core-service=server-environment" attribute="node-name"/>
        <resource-config-dmr name="Initial Running Mode" path="/core-service=server-environment" attribute="initial-running-mode"/>
        <resource-config-dmr name="Base Directory" path="/core-service=server-environment" attribute="base-dir"/>
      </resource-type-dmr>

      <resource-type-dmr name="Domain WildFly Server Controller" resource-name-template="Domain WildFly Server Controller [%-]" path="/server-config=*" parents="Domain Host">
        <resource-config-dmr name="Name" attribute="name"/>
        <resource-config-dmr name="Server Group" attribute="group"/>
        <resource-config-dmr name="Auto Start" attribute="auto-start"/>
        <resource-config-dmr name="Status" attribute="status"/>

        <operation-dmr name="Destroy" internal-name="destroy" modifies="true"/>
        <operation-dmr name="Kill" internal-name="kill" modifies="true"/>
        <operation-dmr name="Restart" internal-name="restart" modifies="true">
          <param name="server" description="The name of the server."/>
          <param name="blocking" type="bool" default-value="false" description="Wait until the servers are stopped before returning from the operation."/>
        </operation-dmr>
        <operation-dmr name="Start" internal-name="start" modifies="true">
          <param name="server" description="The name of the server."/>
          <param name="blocking" type="bool" default-value="false" description="Wait until the servers are stopped before returning from the operation."/>
        </operation-dmr>
        <operation-dmr name="Stop" internal-name="stop" modifies="true">
          <param name="server" description="The name of the server."/>
          <param name="blocking" type="bool" default-value="false" description="Wait until the servers are stopped before returning from the operation."/>
        </operation-dmr>
      </resource-type-dmr>

    </resource-type-set-dmr>

    <resource-type-set-dmr name="Hawkular" enabled="true">
      <resource-type-dmr name="Hawkular WildFly Agent" resource-name-template="Hawkular WildFly Agent" path="/subsystem=hawkular-wildfly-agent" parents="WildFly Server,Domain WildFly Server,Domain Host">
        <resource-config-dmr name="Immutable" attribute="immutable" resolve-expressions="true"/>
        <resource-config-dmr name="In Container" attribute="in-container" resolve-expressions="true"/>

        <operation-dmr name="Status" internal-name="status"/>
        <operation-dmr name="Inventory Discovery Scan" internal-name="fullDiscoveryScan"/>
      </resource-type-dmr>
    </resource-type-set-dmr>

    <resource-type-set-dmr name="Deployment" enabled="true">
      <resource-type-dmr name="Deployment" resource-name-template="Deployment [%-]" path="/deployment=*" parents="WildFly Server,Domain WildFly Server" metric-sets="Web Subsystem Metrics" avail-sets="Deployment Status">
        <operation-dmr name="Redeploy" internal-name="redeploy" modifies="true"/>
        <operation-dmr name="Remove" internal-name="remove" modifies="true"/>
        <operation-dmr name="Undeploy" internal-name="undeploy" modifies="true"/>
      </resource-type-dmr>

      <resource-type-dmr name="SubDeployment" resource-name-template="SubDeployment [%-]" path="/subdeployment=*" parents="Deployment" metric-sets="Web Subsystem Metrics">
      </resource-type-dmr>

    </resource-type-set-dmr>

    <resource-type-set-dmr name="Web Component" enabled="true">
      <resource-type-dmr name="Servlet" resource-name-template="Servlet [%-]" path="/subsystem=web/servlet=*" parents="Deployment,SubDeployment" metric-sets="Servlet Metrics"/>
    </resource-type-set-dmr>

    <resource-type-set-dmr name="EJB" enabled="true">
      <resource-type-dmr name="Singleton EJB" resource-name-template="Singleton EJB [%-]" path="/subsystem=ejb3/singleton-bean=*" parents="Deployment,SubDeployment" metric-sets="Singleton EJB Metrics"/>

      <resource-type-dmr name="Message Driven EJB" resource-name-template="Message Driven EJB [%-]" path="/subsystem=ejb3/message-driven-bean=*" parents="Deployment,SubDeployment" metric-sets="Message Driven EJB Metrics"/>

      <resource-type-dmr name="Stateless Session EJB" resource-name-template="Stateless Session EJB [%-]" path="/subsystem=ejb3/stateless-session-bean=*" parents="Deployment,SubDeployment" metric-sets="Stateless Session EJB Metrics"/>

      <resource-type-dmr name="Stateful Session EJB" resource-name-template="Stateful Session EJB [%-]" path="/subsystem=ejb3/stateful-session-bean=*" parents="Deployment,SubDeployment" metric-sets="Stateful Session EJB Metrics"/>
    </resource-type-set-dmr>

    <resource-type-set-dmr name="Datasource" enabled="true">
      <resource-type-dmr name="Datasource" resource-name-template="Datasource [%-]" path="/subsystem=datasources/data-source=*" parents="WildFly Server,Domain WildFly Server" metric-sets="Datasource Pool Metrics,Datasource JDBC Metrics">
        <resource-config-dmr name="Connection URL" attribute="connection-url" resolve-expressions="false"/>
        <resource-config-dmr name="Driver Name" attribute="driver-name"/>
        <resource-config-dmr name="Driver Class" attribute="driver-class"/>
        <resource-config-dmr name="Datasource Class" attribute="datasource-class"/>
        <resource-config-dmr name="Enabled" attribute="enabled"/>
        <resource-config-dmr name="JNDI Name" attribute="jndi-name"/>
        <resource-config-dmr name="Username" attribute="user-name"/>
        <resource-config-dmr name="Password" attribute="password"/>
        <resource-config-dmr name="Security Domain" attribute="security-domain"/>
        <resource-config-dmr name="Connection Properties" path="/connection-properties=*" attribute="value"/>
      </resource-type-dmr>
    </resource-type-set-dmr>

    <resource-type-set-dmr name="XA Datasource" enabled="true">
      <resource-type-dmr name="XA Datasource" resource-name-template="XA Datasource [%-]" path="/subsystem=datasources/xa-data-source=*" parents="WildFly Server,Domain WildFly Server" metric-sets="Datasource Pool Metrics,Datasource JDBC Metrics">
        <resource-config-dmr name="Driver Name" attribute="driver-name"/>
        <resource-config-dmr name="XA Datasource Class" attribute="xa-datasource-class"/>
        <resource-config-dmr name="Enabled" attribute="enabled"/>
        <resource-config-dmr name="JNDI Name" attribute="jndi-name"/>
        <resource-config-dmr name="Username" attribute="user-name"/>
        <resource-config-dmr name="Password" attribute="password"/>
        <resource-config-dmr name="Security Domain" attribute="security-domain"/>
        <resource-config-dmr name="Datasource Properties" path="/xa-datasource-properties=*" attribute="value"/>
      </resource-type-dmr>
    </resource-type-set-dmr>

    <resource-type-set-dmr name="JDBC Driver" enabled="true">
      <resource-type-dmr name="JDBC Driver" resource-name-template="JDBC Driver [%-]" path="/subsystem=datasources/jdbc-driver=*" parents="WildFly Server,Domain WildFly Server">
        <resource-config-dmr name="Driver Class" attribute="driver-class-name"/>
        <resource-config-dmr name="Module Name" attribute="driver-module-name"/>
        <resource-config-dmr name="Driver Name" attribute="driver-name"/>
        <resource-config-dmr name="XA DS Class" attribute="driver-xa-datasource-class-name"/>
      </resource-type-dmr>
    </resource-type-set-dmr>

    <resource-type-set-dmr name="Transaction Manager" enabled="true">
      <resource-type-dmr name="Transaction Manager" resource-name-template="Transaction Manager" path="/subsystem=transactions" parents="WildFly Server,Domain WildFly Server" metric-sets="Transactions Metrics"/>
    </resource-type-set-dmr>

    <resource-type-set-dmr name="Messaging" enabled="true">
      <resource-type-dmr name="Messaging Server" resource-name-template="Messaging Server [%-]" path="/subsystem=messaging/hornetq-server=*" parents="WildFly Server,Domain WildFly Server"/>
      <resource-type-dmr name="JMS Queue" resource-name-template="JMS Queue [%-]" path="/jms-queue=*" parents="Messaging Server" metric-sets="JMS Queue Metrics"/>
      <resource-type-dmr name="JMS Topic" resource-name-template="JMS Topic [%-]" path="/jms-topic=*" parents="Messaging Server" metric-sets="JMS Topic Metrics"/>
    </resource-type-set-dmr>

    <resource-type-set-dmr name="Socket Binding Group" enabled="true">
      <resource-type-dmr name="Socket Binding Group" resource-name-template="Socket Binding Group [%-]" path="/socket-binding-group=*" parents="WildFly Server,Host Controller">
        <resource-config-dmr name="Name" attribute="name"/>
        <resource-config-dmr name="Port Offset" attribute="port-offset" resolve-expressions="false"/>
        <resource-config-dmr name="Default Interface" attribute="default-interface"/>
      </resource-type-dmr>
      <resource-type-dmr name="Socket Binding" resource-name-template="Socket Binding [%-]" path="/socket-binding=*" parents="Socket Binding Group">
        <resource-config-dmr name="Name" attribute="name"/>
        <resource-config-dmr name="Interface" attribute="interface"/>
        <resource-config-dmr name="Port" attribute="port" resolve-expressions="false"/>
        <resource-config-dmr name="Multicast Address" attribute="multicast-address" resolve-expressions="false"/>
        <resource-config-dmr name="Multicast Port" attribute="multicast-port"/>
      </resource-type-dmr>
      <resource-type-dmr name="Remote Destination Outbound Socket Binding" resource-name-template="Remote Destination Outbound Socket Binding [%-]" path="/remote-destination-outbound-socket-binding=*" parents="Socket Binding Group">
        <resource-config-dmr name="Host" attribute="host"/>
        <resource-config-dmr name="Port" attribute="port"/>
      </resource-type-dmr>
    </resource-type-set-dmr>

    <resource-type-set-dmr name="Clustering" enabled="true">
      <resource-type-dmr name="ModCluster" resource-name-template="ModCluster" path="/subsystem=modcluster" parents="WildFly Server,Domain WildFly Server">
        <resource-config-dmr name="Connector" attribute="connector" path="/mod-cluster-config=configuration"/>
        <resource-config-dmr name="Advertise Socket Binding" attribute="advertise-socket" path="/mod-cluster-config=configuration"/>
      </resource-type-dmr>

      <resource-type-dmr name="JGroups" resource-name-template="JGroups" path="/subsystem=jgroups" parents="WildFly Server,Domain WildFly Server">
      </resource-type-dmr>

      <resource-type-dmr name="Infinispan" resource-name-template="Infinispan" path="/subsystem=infinispan" parents="WildFly Server,Domain WildFly Server">
      </resource-type-dmr>

      <resource-type-dmr name="Infinispan Cache Container" resource-name-template="Infinispan Cache Container [%-]" path="/cache-container=*" parents="Infinispan">
        <resource-config-dmr name="Cluster Name" attribute="cluster-name"/>
        <resource-config-dmr name="Coordinator Address" attribute="coordinator-address"/>
        <resource-config-dmr name="Is Coordinator" attribute="is-coordinator"/>
      </resource-type-dmr>
    </resource-type-set-dmr>

    <!-- JMX metadata for monitoring Jolokia-enabled or local JMX applications -->

    <avail-set-jmx name="RuntimeAvailsJMX" enabled="true">
      <avail-jmx name="VM Avail" interval="30" time-units="seconds" attribute="StartTime" up-regex="[0123456789]+"/>
    </avail-set-jmx>

    <avail-set-jmx name="MemoryPoolAvailsJMX" enabled="true">
      <avail-jmx name="Memory Pool Avail" interval="30" time-units="seconds" attribute="Valid" up-regex="[tT].*"/>
    </avail-set-jmx>

    <metric-set-jmx name="RuntimeMetricsJMX" enabled="true">
      <metric-jmx name="VM Uptime" interval="30" time-units="seconds" metric-units="milliseconds" attribute="Uptime"/>
      <metric-jmx name="Used Heap Memory" interval="30" time-units="seconds" metric-units="bytes" object-name="java.lang:type=Memory" attribute="HeapMemoryUsage#used"/>
      <metric-jmx name="Aggregate GC Collection Time" interval="30" time-units="seconds" metric-units="milliseconds" object-name="java.lang:type=GarbageCollector,name=*" attribute="CollectionTime"/>
    </metric-set-jmx>

    <metric-set-jmx name="MemoryPoolMetricsJMX" enabled="true">
      <metric-jmx name="Initial" interval="2" time-units="minutes" metric-units="bytes" attribute="Usage#init"/>
      <metric-jmx name="Used" interval="1" time-units="minutes" metric-units="bytes" attribute="Usage#used"/>
      <metric-jmx name="Committed" interval="1" time-units="minutes" metric-units="bytes" attribute="Usage#committed"/>
      <metric-jmx name="Max" interval="2" time-units="minutes" metric-units="bytes" attribute="Usage#max"/>
    </metric-set-jmx>

    <resource-type-set-jmx name="MainJMX" enabled="true">
      <resource-type-jmx name="Runtime MBean" resource-name-template="JMX [%_ManagedServerName%][%type%]" object-name="java.lang:type=Runtime" metric-sets="RuntimeMetricsJMX" avail-sets="RuntimeAvailsJMX">
        <resource-config-jmx name="OS Name" object-name="java.lang:type=OperatingSystem" attribute="Name"/>
        <resource-config-jmx name="Java VM Name" attribute="VmName"/>
      </resource-type-jmx>
    </resource-type-set-jmx>

    <resource-type-set-jmx name="MemoryPoolJMX" enabled="true">
      <resource-type-jmx name="Memory Pool MBean" parents="Runtime MBean" resource-name-template="JMX [%_ManagedServerName%] %type% %name%" object-name="java.lang:type=MemoryPool,name=*" metric-sets="MemoryPoolMetricsJMX" avail-sets="MemoryPoolAvailsJMX">
        <resource-config-jmx name="Type" attribute="Type"/>
      </resource-type-jmx>
    </resource-type-set-jmx>

    <managed-servers>
      <remote-dmr name="Another Remote Server" enabled="false" host="localhost" port="9990" username="adminUser" password="adminPass" resource-type-sets="Standalone Environment,Deployment,Web Component,EJB,Datasource,XA Datasource,JDBC Driver,Transaction Manager,Messaging,Socket Binding Group,Clustering"/>

      <local-dmr name="Local" enabled="true" resource-type-sets="Standalone Environment,Deployment,Web Component,EJB,Datasource,XA Datasource,JDBC Driver,Transaction Manager,Messaging,Socket Binding Group,Clustering,Hawkular"/>

      <remote-jmx name="Remote JMX" enabled="false" resource-type-sets="MainJMX,MemoryPoolJMX" url="http://localhost:8080/jolokia-war"/>

      <local-jmx name="Local JMX" enabled="false" resource-type-sets="MainJMX,MemoryPoolJMX"/>

    </managed-servers>

    <platform enabled="true">
      <file-stores enabled="true" interval="5" time-units="minutes"/>
      <memory enabled="true" interval="1" time-units="minutes"/>
      <processors enabled="true" interval="1" time-units="minutes"/>
      <power-sources enabled="false" interval="5" time-units="minutes"/>
    </platform>

  </subsystem>
