Package org.jboss.resource.statistic.pool

Examples of org.jboss.resource.statistic.pool.ManagedConnectionPoolStatistics


  
   @ManagementOperation(description="Obtain a statistics report",
         impact=Impact.ReadOnly)
   public Object listStatistics()
   {
      ManagedConnectionPoolStatistics stats = null;
     
      if (poolingStrategy instanceof StatisticsReporter)
      {
        
         StatisticsReporter reporter = (StatisticsReporter) poolingStrategy;
         stats = (ManagedConnectionPoolStatistics)reporter.listStatistics();
         stats.setCriteria(getCriteria());
         stats.setName(getManagedConnectionFactoryName().toString());
        
      }
     
      return stats;     
   }
View Full Code Here


         }
      }
        
      public JBossStatistics listStatistics()
      {  
         final ManagedConnectionPoolStatistics subPoolStats = new JBossManagedConnectionPoolStatistics(subPools.size());
        
         subPoolStats.setBlockingTimeout(poolParams.blockingTimeout);
         subPoolStats.setIdleTimeout(poolParams.idleTimeout);
         subPoolStats.setMax(poolParams.maxSize);
         subPoolStats.setMin(poolParams.minSize);
         subPoolStats.setPrefill(poolParams.prefill);
         subPoolStats.setNoTxnSeperatePool(noTxSeparatePools);
        
         for(Iterator iter = subPools.values().iterator(); iter.hasNext();)
         {  
            JBossSubPoolStatistics stat = new JBossSubPoolStatistics();
            SubPoolContext subContext = (SubPoolContext)iter.next();
            final InternalManagedConnectionPool internalPool = subContext.getSubPool();
            stat.setAvailableConnections(internalPool.getAvailableConnections());
            stat.setConnectionsDestroyed(internalPool.getConnectionDestroyedCount());
            stat.setConnectionsInUse(internalPool.getConnectionInUseCount());
            stat.setMaxConnectionsInUse(internalPool.getMaxConnectionsInUseCount());
            stat.setTotalBlockTime(internalPool.getTotalBlockTime());
            stat.setAverageBlockTime(internalPool.getAverageBlockTime());
            stat.setMaxWaitTime(internalPool.getMaxWaitTime());
            stat.setTotalTimedOut(internalPool.getTimedOut());
            subPoolStats.addSubPool(stat);
         }

         return (JBossStatistics)subPoolStats;
      }
View Full Code Here

      //Do a diff
      Object rawStatistics = StatisticsHelper.listRawStatistics(getServer());
     
      StatisticsFormatter defaultFormatter = StatisticsHelper.getDefaultFormatter();
     
      ManagedConnectionPoolStatistics stats = (ManagedConnectionPoolStatistics)rawStatistics;
     
      String rawFormat = (String)defaultFormatter.formatStatistics((JBossStatistics)stats);
     
      assertEquals(formattedStats, rawFormat);
     
View Full Code Here

      StringWriter xmlout = new StringWriter();
      StreamResult result = new StreamResult(xmlout);

      transformer.transform(new DOMSource(doc.getFirstChild()), result);
     
      ManagedConnectionPoolStatistics rawStatistics = (ManagedConnectionPoolStatistics)getServer().invoke(POOL_NAME, RAW_STATS_METHOD, new Object[0], new String[0]);
      JBossXmlSubPoolStatisticFormatter xmlFormatter = new JBossXmlSubPoolStatisticFormatter();
      String xml2 = (String)xmlFormatter.formatSubPoolStatistics(rawStatistics);
     
      Document doc2 = builder.parse(new InputSource(new StringReader(xml2)));
View Full Code Here

      assertTrue(formattedStats instanceof String);
     
      JBossDefaultSubPoolStatisticFormatter defaultFormatter = new JBossDefaultSubPoolStatisticFormatter();
     
      Object rawStatistics = listRawStatistics();
      ManagedConnectionPoolStatistics stats = (ManagedConnectionPoolStatistics)rawStatistics;
     
      String rawFormat = (String)defaultFormatter.formatSubPoolStatistics(stats);
     
      assertEquals(formattedStats, rawFormat);
     
View Full Code Here

      //Do a diff
      Object rawStatistics = StatisticsHelper.listRawStatistics(getServer());
     
      StatisticsFormatter defaultFormatter = StatisticsHelper.getDefaultFormatter();
     
      ManagedConnectionPoolStatistics stats = (ManagedConnectionPoolStatistics)rawStatistics;
     
      String rawFormat = (String)defaultFormatter.formatStatistics((JBossStatistics)stats);
     
      assertEquals(formattedStats, rawFormat);
     
View Full Code Here

      StringWriter xmlout = new StringWriter();
      StreamResult result = new StreamResult(xmlout);

      transformer.transform(new DOMSource(doc.getFirstChild()), result);
     
      ManagedConnectionPoolStatistics rawStatistics = (ManagedConnectionPoolStatistics)getServer().invoke(POOL_NAME, RAW_STATS_METHOD, new Object[0], new String[0]);
      JBossXmlSubPoolStatisticFormatter xmlFormatter = new JBossXmlSubPoolStatisticFormatter();
      String xml2 = (String)xmlFormatter.formatSubPoolStatistics(rawStatistics);
     
      Document doc2 = builder.parse(new InputSource(new StringReader(xml2)));
View Full Code Here

      assertTrue(formattedStats instanceof String);
     
      JBossDefaultSubPoolStatisticFormatter defaultFormatter = new JBossDefaultSubPoolStatisticFormatter();
     
      Object rawStatistics = listRawStatistics();
      ManagedConnectionPoolStatistics stats = (ManagedConnectionPoolStatistics)rawStatistics;
     
      String rawFormat = (String)defaultFormatter.formatSubPoolStatistics(stats);
     
      assertEquals(formattedStats, rawFormat);
     
View Full Code Here

  
   @ManagementOperation(description="Obtain a statistics report",
         impact=Impact.ReadOnly)
   public Object listStatistics()
   {
      ManagedConnectionPoolStatistics stats = null;
     
      if (poolingStrategy instanceof StatisticsReporter)
      {
        
         StatisticsReporter reporter = (StatisticsReporter) poolingStrategy;
         stats = (ManagedConnectionPoolStatistics)reporter.listStatistics();
         stats.setCriteria(getCriteria());
         stats.setName(getManagedConnectionFactoryName().toString());
        
      }
     
      return stats;     
   }
View Full Code Here

         }
      }
        
      public JBossStatistics listStatistics()
      {  
         final ManagedConnectionPoolStatistics subPoolStats = new JBossManagedConnectionPoolStatistics(subPools.size());
        
         subPoolStats.setBlockingTimeout(poolParams.blockingTimeout);
         subPoolStats.setIdleTimeout(poolParams.idleTimeout);
         subPoolStats.setMax(poolParams.maxSize);
         subPoolStats.setMin(poolParams.minSize);
         subPoolStats.setPrefill(poolParams.prefill);
         subPoolStats.setNoTxnSeperatePool(noTxSeparatePools);
        
         for(Iterator iter = subPools.values().iterator(); iter.hasNext();)
         {  
            JBossSubPoolStatistics stat = new JBossSubPoolStatistics();
            SubPoolContext subContext = (SubPoolContext)iter.next();
            Boolean trackByTxn = (subContext.getTrackByTx() != null) ? Boolean.TRUE : Boolean.FALSE;
            stat.setTrackByTxn(trackByTxn);
            final InternalManagedConnectionPool internalPool = subContext.getSubPool();
            stat.setAvailableConnections(internalPool.getAvailableConnections());
            stat.setConnectionsDestroyed(internalPool.getConnectionDestroyedCount());
            stat.setConnectionsInUse(internalPool.getConnectionInUseCount());
            stat.setMaxConnectionsInUse(internalPool.getMaxConnectionsInUseCount());
            stat.setTotalBlockTime(internalPool.getTotalBlockTime());
            stat.setAverageBlockTime(internalPool.getAverageBlockTime());
            stat.setMaxWaitTime(internalPool.getMaxWaitTime());
            stat.setTotalTimedOut(internalPool.getTimedOut());
            subPoolStats.addSubPool(stat);
         }

         return (JBossStatistics)subPoolStats;
      }
View Full Code Here

TOP

Related Classes of org.jboss.resource.statistic.pool.ManagedConnectionPoolStatistics

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.