Search in sources :

Example 1 with WebServiceEndpointMonitor

use of com.sun.appserv.management.monitor.WebServiceEndpointMonitor 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 2 with WebServiceEndpointMonitor

use of com.sun.appserv.management.monitor.WebServiceEndpointMonitor in project Payara by payara.

the class WebServiceMgrTest method testGetWebServiceNames.

public void testGetWebServiceNames() {
    java.util.Map m = null;
    m = getDomainRoot().getWebServiceMgr().getWebServiceEndpointKeys();
    if (m == null) {
        System.out.println("No web services found ");
        return;
    }
    System.out.println("Number of web services " + m.keySet().size());
    System.out.println("Fully qualified names...");
    for (Iterator iter = m.keySet().iterator(); iter.hasNext(); ) {
        String key = (String) iter.next();
        System.out.println("Looking for runtime objects for " + key);
        Set<WebServiceEndpoint> epSet = getDomainRoot().getWebServiceMgr().getWebServiceEndpointSet(key, "server");
        if (epSet != null) {
            System.out.println("Found " + epSet.size() + " for " + key);
            for (Iterator epItr = epSet.iterator(); epItr.hasNext(); ) {
                WebServiceEndpoint ep = (WebServiceEndpoint) epItr.next();
                System.out.println("Found " + ep.getName());
                WebServiceEndpointMonitor epm = (WebServiceEndpointMonitor) ep.getMonitoringPeer();
                System.out.println("Monitoing peer for  " + ep.getName() + " is " + epm);
            }
        }
    }
    System.out.println("Display names...");
    for (Iterator iter = m.values().iterator(); iter.hasNext(); ) {
        System.out.println((String) iter.next());
    }
    assert (true);
}
Also used : WebServiceEndpoint(com.sun.appserv.management.j2ee.WebServiceEndpoint) Map(java.util.Map) Iterator(java.util.Iterator) WebServiceEndpointMonitor(com.sun.appserv.management.monitor.WebServiceEndpointMonitor)

Example 3 with WebServiceEndpointMonitor

use of com.sun.appserv.management.monitor.WebServiceEndpointMonitor 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)

Aggregations

WebServiceEndpointMonitor (com.sun.appserv.management.monitor.WebServiceEndpointMonitor)3 NumberStatistic (com.sun.appserv.management.j2ee.statistics.NumberStatistic)2 WebServiceEndpointAggregateStats (com.sun.appserv.management.monitor.statistics.WebServiceEndpointAggregateStats)2 Iterator (java.util.Iterator)2 CountStatistic (org.glassfish.j2ee.statistics.CountStatistic)2 QueryMgr (com.sun.appserv.management.base.QueryMgr)1 WebServiceEndpoint (com.sun.appserv.management.j2ee.WebServiceEndpoint)1 Map (java.util.Map)1 Set (java.util.Set)1