Search in sources :

Example 1 with BaseJmxValue

use of com.newrelic.agent.jmx.metrics.BaseJmxValue in project newrelic-java-agent by newrelic.

the class TomcatJmxValues method createMetrics.

private void createMetrics(String name) {
    /*
         * Only used by 7.0. The manager bean provides information about sessions. sessionCounter is the total number of
         * sessions created by this manager. ActiveSessions is the number of active sessions at this moment.
         * expiredSesions is the number of sessions that have expired. RejectedSessions is the number of sessions
         * rejected due to maxActive being reached. SessionAverageAliveTime is the average time an expired session had
         * been alive.
         */
    metrics.add(new BaseJmxValue(name + ":type=Manager,context=*,host=*,*", MetricNames.JMX_SESSION + "{context}/", new JmxMetric[] { ACTIVE_SESSIONS, EXPIRED_SESSIONS, REJECTED_SESSIONS, SESSION_ALIVE_TIME }));
    /* This is for 6.0 and 5.5. */
    metrics.add(new BaseJmxValue(name + ":type=Manager,path=*,host=*", MetricNames.JMX_SESSION + "{path}/", new JmxMetric[] { ACTIVE_SESSIONS, EXPIRED_SESSIONS, REJECTED_SESSIONS, SESSION_ALIVE_TIME }));
    /*
         * Provides information about the thread pool. The current thread count and the current number of threads which
         * are busy.
         */
    metrics.add(new BaseJmxValue(name + ":type=ThreadPool,name=*", MetricNames.JMX_THREAD_POOL + "{name}/", new JmxMetric[] { CURRENT_ACTIVE_COUNT, CURRENT_IDLE_COUNT, CURRENT_MAX_COUNT }));
    /*
         * Provides information about the data source by finding the number of active and idle connections and the max connections. 
         * In Tomcat 7, the number of max connections is represented by the maxActive attribute. In tomcat 8
         * this was changed to maxTotal, hence the two CONNECTIONS_MAX metrics.
         */
    metrics.add(new BaseJmxValue(name + ":type=DataSource,context=*,host=*," + "class=javax.sql.DataSource,name=*", MetricNames.JMX_DATASOURCES + "{name}/", new JmxMetric[] { CONNECTIONS_ACTIVE, CONNECTIONS_IDLE, CONNECTIONS_MAX, CONNECTIONS_MAX_TOMCAT_8 }));
    /*
         * Provides information about the data source when the customer is using JNDI GlobalNamingResources, which do 
         * not have a context or a host.
         */
    metrics.add(new BaseJmxValue(name + ":type=DataSource," + "class=javax.sql.DataSource,name=*", MetricNames.JMX_DATASOURCES + "{name}/", new JmxMetric[] { CONNECTIONS_ACTIVE, CONNECTIONS_IDLE, CONNECTIONS_MAX, CONNECTIONS_MAX_TOMCAT_8 }));
}
Also used : BaseJmxValue(com.newrelic.agent.jmx.metrics.BaseJmxValue) JmxMetric(com.newrelic.agent.jmx.metrics.JmxMetric)

Aggregations

BaseJmxValue (com.newrelic.agent.jmx.metrics.BaseJmxValue)1 JmxMetric (com.newrelic.agent.jmx.metrics.JmxMetric)1