Package javax.management.j2ee.statistics

Examples of javax.management.j2ee.statistics.Stats


        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


                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

                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

                              MBeanOperationInfo.INFO);
    return mInfo;
  }
 
  public String[] getStatisticNames() {
        Stats stats = delegate.getStats();
        if (stats != null) {
            return stats.getStatisticNames();
        } else {
            return null;
        }
  }
View Full Code Here

            return null;
        }
  }
 
  public Statistic[] getStatistics() {
        Stats stats = delegate.getStats();
        if (stats == null) {
            return null;
        }

    Statistic[] statArray = stats.getStatistics();
    boolean isSerializable = checkSerializability(statArray);
    if(isSerializable) {
      final Statistic[] hackedArray = StatisticWorkaround.populateDescriptions(statArray);
      return hackedArray;
    }
View Full Code Here

 

    public void
  checkStatisticNames( final MonitoringStats mon )
  {
    final Stats  stats  = mon.getStats();
   
    final Set<String>  namesFromMon  = GSetUtil.newStringSet( mon.getStatisticNames() );
    final Set<String>  namesFromStats  = GSetUtil.newStringSet( stats.getStatisticNames() );
   
    assert( namesFromStats.equals( namesFromMon ) ):
      "statistic names from stats.getStatisticNames() != mon.getStatisticNames(): " +
      namesFromStats + " != " + namesFromMon;
  }
View Full Code Here

  }
 
    public void
  checkNumStatistics( final MonitoringStats mon )
  {
    final Stats  stats  = mon.getStats();
    assert( stats != null ) : "null Stats from: " + Util.getObjectName( mon );
    final String[]  allNames  = mon.getStatisticNames();
   
    final Statistic[]  statistics  = mon.getStatistics( allNames );
    assert( statistics.length == allNames.length ) :
View Full Code Here

  }
 
    public void
  checkGetStatistic( final MonitoringStats mon )
  {
    final Stats  stats  = mon.getStats();
   
    final ObjectName  objectName  = Util.getObjectName( mon );
   
    final String[]  names  = mon.getStatisticNames();
    for( int i = 0; i < names.length; ++i )
View Full Code Here

  }
 
    public void
  checkGetStats( final MonitoringStats mon )
  {
    final Stats  stats  = mon.getStats();
   
    final ObjectName  objectName  = Util.getObjectName( mon );
   
    final String[]  names  = stats.getStatisticNames();
    for( int i = 0; i < names.length; ++i )
    {
      final Statistic  s  = stats.getStatistic( names[ i ] );
      assert( s != null );
      assert( s.getName().equals( names[ i ] ) );
     
      checkLegalStatistic( objectName, s );
    }
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.