Package javax.management.j2ee.statistics

Examples of javax.management.j2ee.statistics.Statistic


    public void reset() {
        Statistic[] stats = getStatistics();
        int size = stats.length;
        for (int i = 0; i < size; i++) {
            Statistic stat = stats[i];
            if (stat instanceof Resettable) {
                Resettable r = (Resettable)stat;
                r.reset();
            }
        }
View Full Code Here


            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);
                }
            }
            Thread.sleep(1000)// collection interval
View Full Code Here

         StatelessSessionBeanStats stats = (StatelessSessionBeanStats)
            jsr77MEJB.getAttribute(ejb, "stats");
         String[] statNames = stats.getStatisticNames();
         for (int s = 0; s < statNames.length; s++)
         {
            Statistic theStat = stats.getStatistic(statNames[s]);
            getLog().debug(theStat);
         }
      }
      jsr77MEJB.remove();
   }
View Full Code Here

            (StatelessSessionBeanStats) jsr77MEJB.getAttribute(oName,
               "stats");
         Statistic[] allStats = stats.getStatistics();
         for (int s = 0; s < allStats.length; s++)
         {
            Statistic theStat = allStats[s];
            getLog().debug(theStat);
         }
      }
      jsr77MEJB.remove();
   }
View Full Code Here

    * @param name
    * @return
    */
   public Statistic getStatistic(String name)
   {
      Statistic stat = (Statistic) statistics.get(name);
      return stat;
   }
View Full Code Here

                    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();
                    // mbeanStat.add(new String[] { "Type", className });
                    mbeanStat.add(new String[] { "Description",
                            statistic.getDescription() });
                    mbeanStat.add(new String[] { "Unit", statistic.getUnit() });
                    Date startTime = new Date(statistic.getStartTime());
                    mbeanStat.add(new String[] { "Start Time",
                            startTime.toString() });
                    Date lastSampleTime = new Date(statistic
                            .getLastSampleTime());
                    mbeanStat.add(new String[] { "Last Sample Time",
                            lastSampleTime.toString() });

                    if (statistic instanceof CountStatistic) {
View Full Code Here

            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);
                }
            }
            Thread.sleep(1000)// collection interval
View Full Code Here

                    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();
                    // mbeanStat.add(new String[] { "Type", className });
                    mbeanStat.add(new String[] { "Description",
                            statistic.getDescription() });
                    mbeanStat.add(new String[] { "Unit", statistic.getUnit() });
                    Date startTime = new Date(statistic.getStartTime());
                    mbeanStat.add(new String[] { "Start Time",
                            startTime.toString() });
                    Date lastSampleTime = new Date(statistic
                            .getLastSampleTime());
                    mbeanStat.add(new String[] { "Last Sample Time",
                            lastSampleTime.toString() });

                    if (statistic instanceof CountStatistic) {
View Full Code Here

            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);
                }
            }
            Thread.sleep(1000)// collection interval
View Full Code Here

  testStatsImplRequiresStatistics()
    throws IOException, ClassNotFoundException
  {
    try
    {
        Statistic x = null;
       
        final Statistic s   = new CountStatisticImpl( "x","x","x",0,0,0);
      final Map<String,Statistic>  m  = MapUtil.newMap( "foo", s );
      final StatsImpl  si  = new StatsImpl( m );
      serializeTest( si );
    }
    catch( IllegalArgumentException e )
View Full Code Here

TOP

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

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.