Search in sources :

Example 1 with CountStatistic

use of org.glassfish.j2ee.statistics.CountStatistic in project Payara by payara.

the class BeanCacheMonitorTest method testStats.

public void testStats() {
    final QueryMgr q = getQueryMgr();
    final Set beanCacheMonitors = q.queryJ2EETypeSet(XTypes.BEAN_CACHE_MONITOR);
    if (beanCacheMonitors.size() == 0) {
        warning("BeanCacheMonitorTest: no MBeans found to test.");
    } else {
        final Iterator iter = beanCacheMonitors.iterator();
        while (iter.hasNext()) {
            final BeanCacheMonitor m = (BeanCacheMonitor) iter.next();
            final EJBCacheStats s = m.getEJBCacheStats();
            // verify that we can get each Statistic; there was a problem at one time
            final BoundedRangeStatistic b1 = s.getCacheMisses();
            final BoundedRangeStatistic b2 = s.getCacheHits();
            final BoundedRangeStatistic b3 = s.getBeansInCache();
            // these were failing
            final CountStatistic c4 = s.getPassivationSuccesses();
            final CountStatistic c3 = s.getExpiredSessionsRemoved();
            final CountStatistic c2 = s.getPassivationErrors();
            final CountStatistic c1 = s.getPassivations();
        }
    }
}
Also used : QueryMgr(com.sun.appserv.management.base.QueryMgr) Set(java.util.Set) BeanCacheMonitor(com.sun.appserv.management.monitor.BeanCacheMonitor) Iterator(java.util.Iterator) BoundedRangeStatistic(org.glassfish.j2ee.statistics.BoundedRangeStatistic) CountStatistic(org.glassfish.j2ee.statistics.CountStatistic) EJBCacheStats(com.sun.appserv.management.monitor.statistics.EJBCacheStats)

Example 2 with CountStatistic

use of org.glassfish.j2ee.statistics.CountStatistic in project Payara by payara.

the class ConnectionPoolStatsTest method accessAllStatistics.

/**
 *     Verify that every Statistic can be successfully accessed.
 */
protected void accessAllStatistics(final ConnectionPoolStats s) {
    final RangeStatistic r1 = s.getNumConnUsed();
    assert (r1 != null);
    final RangeStatistic r2 = s.getNumConnFree();
    assert (r2 != null);
    final RangeStatistic r3 = s.getConnRequestWaitTime();
    assert (r3 != null);
    final CountStatistic c1 = s.getNumConnFailedValidation();
    assert (c1 != null);
    final CountStatistic c2 = s.getNumConnTimedOut();
    assert (c2 != null);
    final CountStatistic c3 = s.getWaitQueueLength();
    assert (c3 != null);
    final CountStatistic c4 = s.getNumConnCreated();
    assert (c4 != null);
    final CountStatistic c5 = s.getNumConnDestroyed();
    assert (c5 != null);
    // final CountStatistic c6	= s.getNumConnOpened();
    // assert( c6 != null );
    // final CountStatistic c7	= s.getNumConnClosed();
    // assert( c7 != null );
    final CountStatistic c8 = s.getAverageConnWaitTime();
    assert (c8 != null);
}
Also used : RangeStatistic(org.glassfish.j2ee.statistics.RangeStatistic) CountStatistic(org.glassfish.j2ee.statistics.CountStatistic)

Example 3 with CountStatistic

use of org.glassfish.j2ee.statistics.CountStatistic in project Payara by payara.

the class WebServiceEndpointMonitorTest method testStats.

public void testStats() {
    final QueryMgr q = getQueryMgr();
    final Set wsMonitors = q.queryJ2EETypeSet(XTypes.WEBSERVICE_ENDPOINT_MONITOR);
    if (wsMonitors.size() == 0) {
        warning("WebServiceEndpointMonitorTest: no MBeans found to test.");
    } else {
        Iterator itr = wsMonitors.iterator();
        while (itr.hasNext()) {
            WebServiceEndpointMonitor m = (WebServiceEndpointMonitor) itr.next();
            final WebServiceEndpointAggregateStats s = m.getWebServiceEndpointAggregateStats();
            // verify that we can get each Statistic;
            // there was a problem at one time
            final CountStatistic r1 = s.getTotalFaults();
            assert (r1 != null);
            final CountStatistic r2 = s.getTotalNumSuccess();
            assert (r2 != null);
            // final AverageRangeStatistic r3 = s.getResponseTime();
            // assert( r3 != null );
            final NumberStatistic c1 = s.getThroughput();
            assert (c1 != null);
            final CountStatistic c2 = s.getTotalAuthFailures();
            assert (c2 != null);
            final CountStatistic c3 = s.getTotalAuthSuccesses();
            assert (c3 != null);
        }
    }
}
Also used : QueryMgr(com.sun.appserv.management.base.QueryMgr) NumberStatistic(com.sun.appserv.management.j2ee.statistics.NumberStatistic) Set(java.util.Set) WebServiceEndpointAggregateStats(com.sun.appserv.management.monitor.statistics.WebServiceEndpointAggregateStats) Iterator(java.util.Iterator) WebServiceEndpointMonitor(com.sun.appserv.management.monitor.WebServiceEndpointMonitor) CountStatistic(org.glassfish.j2ee.statistics.CountStatistic)

Example 4 with CountStatistic

use of org.glassfish.j2ee.statistics.CountStatistic in project Payara by payara.

the class WebServiceMonitorTest method testMonitorMBeans.

public void testMonitorMBeans() {
    assert (getDomainRoot().getWebServiceMgr() != null);
    final Set<WebServiceEndpointMonitor> ms = getDomainRoot().getQueryMgr().queryJ2EETypeSet(XTypes.WEBSERVICE_ENDPOINT_MONITOR);
    for (final WebServiceEndpointMonitor m : ms) {
        System.out.println("\n \n Name of web service is " + m.getName());
        final WebServiceEndpointAggregateStats s = m.getWebServiceEndpointAggregateStats();
        // verify that we can get each Statistic;
        // there was a problem at one time
        final CountStatistic r1 = s.getTotalFaults();
        assert (r1 != null);
        System.out.println(" total num fault is " + r1.getCount());
        final CountStatistic r2 = s.getTotalNumSuccess();
        assert (r2 != null);
        System.out.println(" total num success is " + r2.getCount());
        final CountStatistic r3 = s.getAverageResponseTime();
        assert (r3 != null);
        System.out.println("avg resp is " + r3.getCount());
        final NumberStatistic c1 = s.getThroughput();
        assert (c1 != null);
        System.out.println(" through put is " + c1.getCurrent());
        final CountStatistic c2 = s.getTotalAuthFailures();
        assert (c2 != null);
        System.out.println(" total num auth success is " + c2.getCount());
        final CountStatistic c3 = s.getTotalAuthSuccesses();
        assert (c3 != null);
        System.out.println(" total num auth failure is " + c3.getCount());
    }
}
Also used : NumberStatistic(com.sun.appserv.management.j2ee.statistics.NumberStatistic) WebServiceEndpointAggregateStats(com.sun.appserv.management.monitor.statistics.WebServiceEndpointAggregateStats) WebServiceEndpointMonitor(com.sun.appserv.management.monitor.WebServiceEndpointMonitor) CountStatistic(org.glassfish.j2ee.statistics.CountStatistic)

Example 5 with CountStatistic

use of org.glassfish.j2ee.statistics.CountStatistic in project Payara by payara.

the class StatsImpl method statToString.

public String statToString() {
    StringBuffer sbuf = new StringBuffer();
    Statistic[] stats = getStatistics();
    int sz = stats.length;
    for (int i = 0; i < sz; i++) {
        if (stats[i] instanceof CountStatistic) {
            CountStatistic stat = (CountStatistic) stats[i];
            sbuf.append(stat.getName()).append("=").append(stat.getCount()).append("; ");
        } else if (stats[i] instanceof BoundedRangeStatistic) {
            BoundedRangeStatistic stat = (BoundedRangeStatistic) stats[i];
            sbuf.append(stat.getName()).append("=").append(stat.getCurrent()).append("; ");
        } else {
            sbuf.append(stats[i].getName()).append("=?");
        }
    }
    return sbuf.toString();
}
Also used : BoundedRangeStatistic(org.glassfish.j2ee.statistics.BoundedRangeStatistic) CountStatistic(org.glassfish.j2ee.statistics.CountStatistic) Statistic(org.glassfish.j2ee.statistics.Statistic) CountStatistic(org.glassfish.j2ee.statistics.CountStatistic) BoundedRangeStatistic(org.glassfish.j2ee.statistics.BoundedRangeStatistic)

Aggregations

CountStatistic (org.glassfish.j2ee.statistics.CountStatistic)5 QueryMgr (com.sun.appserv.management.base.QueryMgr)2 NumberStatistic (com.sun.appserv.management.j2ee.statistics.NumberStatistic)2 WebServiceEndpointMonitor (com.sun.appserv.management.monitor.WebServiceEndpointMonitor)2 WebServiceEndpointAggregateStats (com.sun.appserv.management.monitor.statistics.WebServiceEndpointAggregateStats)2 Iterator (java.util.Iterator)2 Set (java.util.Set)2 BoundedRangeStatistic (org.glassfish.j2ee.statistics.BoundedRangeStatistic)2 BeanCacheMonitor (com.sun.appserv.management.monitor.BeanCacheMonitor)1 EJBCacheStats (com.sun.appserv.management.monitor.statistics.EJBCacheStats)1 RangeStatistic (org.glassfish.j2ee.statistics.RangeStatistic)1 Statistic (org.glassfish.j2ee.statistics.Statistic)1