Package javax.management.j2ee.statistics

Examples of javax.management.j2ee.statistics.Stats


        // for each mbean name
        for(Iterator<String> it = mbeans.iterator(); it.hasNext(); ) {
            ArrayList<String> mbeanStatsList = new ArrayList<String>();
            String mbeanName = it.next();
            try {
                Stats stats = (Stats)mbServer.getAttribute(new ObjectName(mbeanName), "stats");
                String[] sttsName = stats.getStatisticNames();
                Statistic[] stts = stats.getStatistics();
                for(int i = 0; i < sttsName.length; i++) {
                    Statistic aStat = stats.getStatistic(sttsName[i]);
                    if(aStat instanceof RangeStatistic) {
                        mbeanStatsList.add(stts[i].getName() + " Current");
                        mbeanStatsList.add(stts[i].getName() + " Max");
                        mbeanStatsList.add(stts[i].getName() + " Min");
                    } else if(aStat instanceof CountStatistic) {
View Full Code Here


                connector.resetStats();
                webModule.resetStats();
            }
            //System.out.println("******* NOW IS " + System.currentTimeMillis());
            Stats[] allStats = { webModule.getStats(), connector.getStats() };
            Stats stats;
            for (int j = 0; j < allStats.length; j++) {
                stats = allStats[j];
                Statistic[] stts = stats.getStatistics();
                Statistic aStts;
                String[] sttsNames = stats.getStatisticNames();
                for (int i = 0; i < sttsNames.length; i++) {
                    assertFalse(sttsNames[i].equals(stts[i].getName()));
                    aStts = stats.getStatistic(sttsNames[i]);
                    assertTrue("startTime was not set", aStts.getStartTime() != 0);
                    assertTrue("lastSampleTime was not set", aStts.getLastSampleTime() != 0);
                    //System.out.println("lastSampleTime = " + aStts.getLastSampleTime() + "  startTime = " + aStts.getStartTime());
                    //System.out.println(aStts);
                }
View Full Code Here

                connector.resetStats();
                webModule.resetStats();
            }
            //System.out.println("******* NOW IS " + System.currentTimeMillis());
            Stats[] allStats = { webModule.getStats(), connector.getStats() };
            Stats stats;
            for (int j = 0; j < allStats.length; j++) {
                stats = allStats[j];
                Statistic[] stts = stats.getStatistics();
                Statistic aStts;
                String[] sttsNames = stats.getStatisticNames();
                for (int i = 0; i < sttsNames.length; i++) {
                    assertFalse(sttsNames[i].equals(stts[i].getName()));
                    aStts = stats.getStatistic(sttsNames[i]);
                    assertTrue("startTime was not set", aStts.getStartTime() != 0);
                    assertTrue("lastSampleTime was not set", aStts.getLastSampleTime() != 0);
                    //System.out.println("lastSampleTime = " + aStts.getLastSampleTime() + "  startTime = " + aStts.getStartTime());
                    //System.out.println(aStts);
                }
View Full Code Here

        Map mbeanStats = new TreeMap();
        try {
            AbstractName aname = new AbstractName(URI.create(abstractName));
            Boolean statisticsProvider = (Boolean) kernel.getAttribute(aname,
                    STATSPROVIDER_ATTRIB);
            Stats stats = (Stats) kernel.getAttribute(aname, STATS_ATTRIB);
            if (statisticsProvider.booleanValue() == true && (stats != null)) {
                String[] statisticNames = stats.getStatisticNames();
                for (int i = 0; i < statisticNames.length; i++) {
                    Statistic statistic = stats.getStatistic(statisticNames[i]);

                    Collection mbeanStat = new ArrayList();
                    String name = statistic.getName();
                    mbeanStat.add(new String[] { "Name", name });
                    String className = statistic.getClass().getName();
View Full Code Here

                    .openConnection();
            BufferedReader reader = new BufferedReader(new InputStreamReader(connection.getInputStream()));
            assertEquals(HttpURLConnection.HTTP_OK, connection.getResponseCode());
            assertEquals("Hello World", reader.readLine());
           
            Stats stats = component.getStats();
            Statistic[] stts = stats.getStatistics();
            Statistic aStts;
            String[] sttsNames = stats.getStatisticNames();
            for (int i = 0; i < sttsNames.length; i++) {
                // check that the names match the getter methods
                String sttsName = sttsNames[i];
                assertFalse(sttsName.equals(stts[i].getName()));
                try {
                stats.getClass().getMethod("get" + sttsName, new Class[0]);
                } catch (NoSuchMethodException e) {
              continue; // ignore this statistics for now, JSR77.6.10.1.1
                }
                aStts = stats.getStatistic(sttsName);
                assertTrue("startTime was not set for " + sttsName, aStts.getStartTime() != 0);
                assertTrue("lastSampleTime was not set for " + sttsName, aStts.getLastSampleTime() != 0);
                /*System.out.println("              lastSampleTime = " + aStts.getLastSampleTime() +
                  "  startTime = " + aStts.getStartTime());
                System.out.println(aStts);*/
 
View Full Code Here

                connector.resetStats();
                webModule.resetStats();
            }
            //System.out.println("******* NOW IS " + System.currentTimeMillis());
            Stats[] allStats = { webModule.getStats(), connector.getStats() };
            Stats stats;
            for (int j = 0; j < allStats.length; j++) {
                stats = allStats[j];
                Statistic[] stts = stats.getStatistics();
                Statistic aStts;
                String[] sttsNames = stats.getStatisticNames();
                for (int i = 0; i < sttsNames.length; i++) {
                    assertFalse(sttsNames[i].equals(stts[i].getName()));
                    aStts = stats.getStatistic(sttsNames[i]);
                    assertTrue("startTime was not set", aStts.getStartTime() != 0);
                    assertTrue("lastSampleTime was not set", aStts.getLastSampleTime() != 0);
                    //System.out.println("lastSampleTime = " + aStts.getLastSampleTime() + "  startTime = " + aStts.getStartTime());
                    //System.out.println(aStts);
                }
View Full Code Here

TOP

Related Classes of javax.management.j2ee.statistics.Stats

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.