Examples of BoundedRangeStatisticImpl


Examples of org.apache.geronimo.management.stats.BoundedRangeStatisticImpl

    public Stats getStats() {
        RuntimeMXBean runmxbean = ManagementFactory.getRuntimeMXBean();
        MemoryMXBean memmxbean = ManagementFactory.getMemoryMXBean();
        MemoryUsage memUsage = memmxbean.getHeapMemoryUsage();
        CountStatisticImpl upTime;
        BoundedRangeStatisticImpl heapSize;

        if (stats == null) {
            stats = new JVMStatsImpl();
            // setup UpTime CountStatistic
            upTime = stats.getUpTimeImpl();
            upTime.setStartTime(runmxbean.getStartTime());
            upTime.setCount(runmxbean.getUptime());
            // setup Heap BoundedRangeStatistic
            heapSize = stats.getHeapSizeImpl();
            heapSize.setStartTime(runmxbean.getStartTime());
            heapSize.setBounds(0, memUsage.getMax());
            heapSize.setCurrent(memUsage.getUsed());
            heapSize.setLowWaterMark(memUsage.getUsed());
            heapSize.setHighWaterMark(memUsage.getUsed());
        } else {
            // update UpTime CountStatistic
            upTime = stats.getUpTimeImpl();
            upTime.setCount(runmxbean.getUptime());
            // update Heap BoundedRangeStatistic
            heapSize = stats.getHeapSizeImpl();
            heapSize.setBounds(0, memUsage.getMax());
            heapSize.setCurrent(memUsage.getUsed());
        }
        long now = upTime.getStartTime() + upTime.getCount();
        upTime.setLastSampleTime(now);
        heapSize.setLastSampleTime(now);

        return stats;
    }
View Full Code Here

Examples of org.apache.geronimo.management.stats.BoundedRangeStatisticImpl

                "The number of bytes sent during the observerd period", 0);
        bytesReceivedCount = new CountStatisticImpl("Bytes Received", StatisticImpl.UNIT_COUNT,
                "The number of bytes received during the observerd period", 0);
        openConnectionCount = new RangeStatisticImpl("" + "Open Connections", StatisticImpl.UNIT_COUNT,
                "Range for connections opened during the observed period", 0); // all 0's
        busyThreads = new BoundedRangeStatisticImpl("Busy Threads", StatisticImpl.UNIT_COUNT,
                "BoundedRange for Threads currently busy serving requests", 0, 0, 0);
        addStat("RequestTime", requestTime); // better name
        addStat("activeRequestCount", activeRequestCount);
        addStat("errorCount", errorCount);
        addStat("bytesSent", bytesSentCount);
View Full Code Here

Examples of org.apache.geronimo.management.stats.BoundedRangeStatisticImpl

    public Stats getStats() {
        RuntimeMXBean runmxbean = ManagementFactory.getRuntimeMXBean();
        MemoryMXBean memmxbean = ManagementFactory.getMemoryMXBean();
        MemoryUsage memUsage = memmxbean.getHeapMemoryUsage();
        CountStatisticImpl upTime;
        BoundedRangeStatisticImpl heapSize;
       
        if (stats == null) {
            stats = new JVMStatsImpl();
            // setup UpTime CountStatistic
            upTime = stats.getUpTimeImpl();
            upTime.setStartTime(runmxbean.getStartTime());
            upTime.setCount(runmxbean.getUptime());
            // setup Heap BoundedRangeStatistic
            heapSize = stats.getHeapSizeImpl();
            heapSize.setStartTime(runmxbean.getStartTime());
            heapSize.setBounds(0, memUsage.getMax());
            heapSize.setCurrent(memUsage.getUsed());
            heapSize.setLowWaterMark(memUsage.getUsed());
            heapSize.setHighWaterMark(memUsage.getUsed());
        } else {
            // update UpTime CountStatistic
            upTime = stats.getUpTimeImpl();
            upTime.setCount(runmxbean.getUptime());
            // update Heap BoundedRangeStatistic
            heapSize = stats.getHeapSizeImpl();
            heapSize.setBounds(0, memUsage.getMax());
            heapSize.setCurrent(memUsage.getUsed());
        }
        long now = upTime.getStartTime() + upTime.getCount();
        upTime.setLastSampleTime(now);
        heapSize.setLastSampleTime(now);

        return stats;
    }
View Full Code Here

Examples of org.apache.geronimo.management.stats.BoundedRangeStatisticImpl

                "The number of bytes sent during the observerd period", 0);
        bytesReceivedCount = new CountStatisticImpl("Bytes Received", StatisticImpl.UNIT_COUNT,
                "The number of bytes received during the observerd period", 0);
        openConnectionCount = new RangeStatisticImpl("" + "Open Connections", StatisticImpl.UNIT_COUNT,
                "Range for connections opened during the observed period", 0); // all 0's
        busyThreads = new BoundedRangeStatisticImpl("Busy Threads", StatisticImpl.UNIT_COUNT,
                "BoundedRange for Threads currently busy serving requests", 0, 0, 0);
        addStat("RequestTime", requestTime); // better name
        addStat("activeRequestCount", activeRequestCount);
        addStat("errorCount", errorCount);
        addStat("bytesSent", bytesSentCount);
View Full Code Here

Examples of org.apache.geronimo.management.stats.BoundedRangeStatisticImpl

                "The number of bytes sent during the observerd period", 0);
        bytesReceivedCount = new CountStatisticImpl("Bytes Received", StatisticImpl.UNIT_COUNT,
                "The number of bytes received during the observerd period", 0);
        openConnectionCount = new RangeStatisticImpl("" + "Open Connections", StatisticImpl.UNIT_COUNT,
                "Range for connections opened during the observed period", 0); // all 0's
        busyThreads = new BoundedRangeStatisticImpl("Busy Threads", StatisticImpl.UNIT_COUNT,
                "BoundedRange for Threads currently busy serving requests", 0, 0, 0);
        addStat("RequestTime", requestTime); // better name
        addStat("activeRequestCount", activeRequestCount);
        addStat("errorCount", errorCount);
        addStat("bytesSent", bytesSentCount);
View Full Code Here

Examples of org.apache.geronimo.management.stats.BoundedRangeStatisticImpl

    public Stats getStats() {
        RuntimeMXBean runmxbean = ManagementFactory.getRuntimeMXBean();
        MemoryMXBean memmxbean = ManagementFactory.getMemoryMXBean();
        MemoryUsage memUsage = memmxbean.getHeapMemoryUsage();
        CountStatisticImpl upTime;
        BoundedRangeStatisticImpl heapSize;
       
        if (stats == null) {
            stats = new JVMStatsImpl();
            // setup UpTime CountStatistic
            upTime = stats.getUpTimeImpl();
            upTime.setStartTime(runmxbean.getStartTime());
            upTime.setCount(runmxbean.getUptime());
            // setup Heap BoundedRangeStatistic
            heapSize = stats.getHeapSizeImpl();
            heapSize.setStartTime(runmxbean.getStartTime());
            heapSize.setBounds(0, memUsage.getMax());
            heapSize.setCurrent(memUsage.getUsed());
            heapSize.setLowWaterMark(memUsage.getUsed());
            heapSize.setHighWaterMark(memUsage.getUsed());
        } else {
            // update UpTime CountStatistic
            upTime = stats.getUpTimeImpl();
            upTime.setCount(runmxbean.getUptime());
            // update Heap BoundedRangeStatistic
            heapSize = stats.getHeapSizeImpl();
            heapSize.setBounds(0, memUsage.getMax());
            heapSize.setCurrent(memUsage.getUsed());
        }
        long now = upTime.getStartTime() + upTime.getCount();
        upTime.setLastSampleTime(now);
        heapSize.setLastSampleTime(now);

        return stats;
    }
View Full Code Here

Examples of org.glassfish.external.statistics.impl.BoundedRangeStatisticImpl

                threadPool.numberOfAvailableThreads(), stringNumberOfAvailableThreads, "count",
                threadPool.getWorkQueue(0).toString(),
                time, time);

        currentNumberOfThreads =
                new BoundedRangeStatisticImpl(
                threadPool.currentNumberOfThreads(), threadPool.maximumNumberOfThreads(), threadPool.minimumNumberOfThreads(), java.lang.Long.MAX_VALUE, 0,
                stringCurrentNumberOfThreads, "count",
                threadPool.getWorkQueue(0).toString(),
                time, time);

        averageWorkCompletionTime =
                new BoundedRangeStatisticImpl(
                threadPool.averageWorkCompletionTime(), 0, 0, java.lang.Long.MAX_VALUE, 0,
                stringAverageWorkCompletionTime, "Milliseconds",
                threadPool.getWorkQueue(0).toString(),
                time, time);

        // WorkQueue workItems = threadPool.getWorkQueue(0);

        totalWorkItemsAdded =
                new CountStatisticImpl(
                workQueue.totalWorkItemsAdded(), stringTotalWorkItemsAdded, "count",
                workQueue.getName(),
                time, time);

        numberOfWorkItemsInQueue =
                new BoundedRangeStatisticImpl(
                workQueue.workItemsInQueue(), 0, 0, java.lang.Long.MAX_VALUE, 0,
                stringNumberOfWorkItemsInQueue, "count",
                workQueue.getName(),
                time, time);

        averageTimeInQueue =
                new BoundedRangeStatisticImpl(
                workQueue.averageTimeInQueue(), 0, 0, java.lang.Long.MAX_VALUE, 0,
                stringAverageTimeInQueue, "Milliseconds",
                workQueue.getName(),
                time, time);
View Full Code Here

Examples of org.glassfish.external.statistics.impl.BoundedRangeStatisticImpl

                threadPool.numberOfAvailableThreads(), stringNumberOfAvailableThreads, "count",
                threadPool.getWorkQueue(0).toString(),
                time, time);

        currentNumberOfThreads =
                new BoundedRangeStatisticImpl(
                threadPool.currentNumberOfThreads(), threadPool.maximumNumberOfThreads(), threadPool.minimumNumberOfThreads(), java.lang.Long.MAX_VALUE, 0,
                stringCurrentNumberOfThreads, "count",
                threadPool.getWorkQueue(0).toString(),
                time, time);

        averageWorkCompletionTime =
                new BoundedRangeStatisticImpl(
                threadPool.averageWorkCompletionTime(), 0, 0, java.lang.Long.MAX_VALUE, 0,
                stringAverageWorkCompletionTime, "Milliseconds",
                threadPool.getWorkQueue(0).toString(),
                time, time);

        // WorkQueue workItems = threadPool.getWorkQueue(0);

        totalWorkItemsAdded =
                new CountStatisticImpl(
                workQueue.totalWorkItemsAdded(), stringTotalWorkItemsAdded, "count",
                workQueue.getName(),
                time, time);

        numberOfWorkItemsInQueue =
                new BoundedRangeStatisticImpl(
                workQueue.workItemsInQueue(), 0, 0, java.lang.Long.MAX_VALUE, 0,
                stringNumberOfWorkItemsInQueue, "count",
                workQueue.getName(),
                time, time);

        averageTimeInQueue =
                new BoundedRangeStatisticImpl(
                workQueue.averageTimeInQueue(), 0, 0, java.lang.Long.MAX_VALUE, 0,
                stringAverageTimeInQueue, "Milliseconds",
                workQueue.getName(),
                time, time);
View Full Code Here

Examples of org.jboss.management.j2ee.statistics.BoundedRangeStatisticImpl

   {
      TimeStatisticImpl waitTime = null;
      TimeStatisticImpl useTime = null;
      CountStatisticImpl closeCount = null;
      CountStatisticImpl createCount = null;
      BoundedRangeStatisticImpl freePoolSize = null;
      BoundedRangeStatisticImpl poolSize = null;
      RangeStatisticImpl waitingThreadCount = null;
      try
      {
         if (poolStats == null)
         {
            Integer max = (Integer) server.getAttribute(poolServiceName, "MaxSize");
            freePoolSize = new BoundedRangeStatisticImpl("FreePoolSize", "1",
                    "The free connection count", 0, max.longValue());
            poolSize = new BoundedRangeStatisticImpl("PoolSize", "1",
                    "The connection count", 0, max.longValue());
            poolStats = new JCAConnectionPoolStatsImpl(getobjectName(), jsr77MCFName,
                    waitTime, useTime, closeCount, createCount, freePoolSize, poolSize,
                    waitingThreadCount);
         }
         createCount = (CountStatisticImpl) poolStats.getCreateCount();
         closeCount = (CountStatisticImpl) poolStats.getCloseCount();
         freePoolSize = (BoundedRangeStatisticImpl) poolStats.getFreePoolSize();
         poolSize = (BoundedRangeStatisticImpl) poolStats.getPoolSize();

         // Update the stats
         Integer isize = (Integer) server.getAttribute(poolServiceName, "ConnectionCreatedCount");
         createCount.set(isize.longValue());
         isize = (Integer) server.getAttribute(poolServiceName, "ConnectionDestroyedCount");
         closeCount.set(isize.longValue());
         isize = (Integer) server.getAttribute(poolServiceName, "ConnectionCount");
         poolSize.set(isize.longValue());
         Long lsize = (Long) server.getAttribute(poolServiceName, "AvailableConnectionCount");
         freePoolSize.set(lsize.longValue());
      }
      catch (Exception e)
      {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.