Examples of JVMStats


Examples of javax.management.j2ee.statistics.JVMStats

        assertEquals(new Integer(runtime.availableProcessors()), kernel.getAttribute(JVM_DATA.getAbstractName(), "availableProcessors"));
    }

    public void testStatistics() throws Exception {
        assertEquals(Boolean.TRUE, kernel.getAttribute(JVM_DATA.getAbstractName(), "statisticsProvider"));
        JVMStats stats = (JVMStats) kernel.getAttribute(JVM_DATA.getAbstractName(), "stats");
        assertNotNull(stats.getHeapSize());
        assertTrue(stats.getHeapSize().getCurrent() > 0);
        assertNotNull(stats.getHeapSize().getDescription());
        assertTrue(stats.getHeapSize().getHighWaterMark() > 0);
        assertTrue(stats.getHeapSize().getLastSampleTime() > 0);
        assertTrue(stats.getHeapSize().getLowerBound() == 0);
        assertTrue(stats.getHeapSize().getLowWaterMark() > 0);
        assertNotNull(stats.getHeapSize().getName());
        assertTrue(stats.getHeapSize().getStartTime() > 0);
        assertNotNull(stats.getHeapSize().getUnit());
        assertTrue(stats.getHeapSize().getUpperBound() > 0);
        assertNotNull(stats.getUpTime());
        assertTrue(stats.getUpTime().getCount() > 0);
        assertNotNull(stats.getUpTime().getDescription());
        assertTrue(stats.getUpTime().getLastSampleTime() > 0);
        assertNotNull(stats.getUpTime().getName());
        assertTrue(stats.getUpTime().getStartTime() > 0);
        assertNotNull(stats.getUpTime().getUnit());
    }
View Full Code Here

Examples of javax.management.j2ee.statistics.JVMStats

        assertEquals(new Integer(runtime.availableProcessors()), kernel.getAttribute(JVM_DATA.getAbstractName(), "availableProcessors"));
    }

    public void testStatistics() throws Exception {
        assertEquals(Boolean.TRUE, kernel.getAttribute(JVM_DATA.getAbstractName(), "statisticsProvider"));
        JVMStats stats = (JVMStats) kernel.getAttribute(JVM_DATA.getAbstractName(), "stats");
        assertNotNull(stats.getHeapSize());
        assertTrue(stats.getHeapSize().getCurrent() > 0);
        assertNotNull(stats.getHeapSize().getDescription());
        assertTrue(stats.getHeapSize().getHighWaterMark() > 0);
        assertTrue(stats.getHeapSize().getLastSampleTime() > 0);
        assertTrue(stats.getHeapSize().getLowerBound() == 0);
        assertTrue(stats.getHeapSize().getLowWaterMark() > 0);
        assertNotNull(stats.getHeapSize().getName());
        assertTrue(stats.getHeapSize().getStartTime() > 0);
        assertNotNull(stats.getHeapSize().getUnit());
        assertTrue(stats.getHeapSize().getUpperBound() > 0);
        assertNotNull(stats.getUpTime());
        assertTrue(stats.getUpTime().getCount() > 0);
        assertNotNull(stats.getUpTime().getDescription());
        assertTrue(stats.getUpTime().getLastSampleTime() > 0);
        assertNotNull(stats.getUpTime().getName());
        assertTrue(stats.getUpTime().getStartTime() > 0);
        assertNotNull(stats.getUpTime().getUnit());
    }
View Full Code Here

Examples of javax.management.j2ee.statistics.JVMStats

        J2EEDomain[] domains = helper.getDomains();
        J2EEServer[] servers = domains[0].getServerInstances();
        JVM[] jvms = helper.getJavaVMs(servers[0]);
        long elapsed = System.currentTimeMillis() - jvms[0].getKernelBootTime().getTime();
        if(jvms[0].isStatisticsProvider()) {
            JVMStats stats = (JVMStats) ((StatisticsProvider)jvms[0]).getStats();
            BoundedRangeStatistic heap = stats.getHeapSize();
            return new DynamicServerInfo(heap.getCurrent(), heap.getHighWaterMark(), heap.getUpperBound(), elapsed);
        } else {
            return new DynamicServerInfo(elapsed);
        }
    }
View Full Code Here

Examples of javax.management.j2ee.statistics.JVMStats

        assertEquals(new Integer(runtime.availableProcessors()), kernel.getAttribute(JVM_DATA.getAbstractName(), "availableProcessors"));
    }

    public void testStatistics() throws Exception {
        assertEquals(Boolean.TRUE, kernel.getAttribute(JVM_DATA.getAbstractName(), "statisticsProvider"));
        JVMStats stats = (JVMStats) kernel.getAttribute(JVM_DATA.getAbstractName(), "stats");
        assertNotNull(stats.getHeapSize());
        assertTrue(stats.getHeapSize().getCurrent() > 0);
        assertNotNull(stats.getHeapSize().getDescription());
        assertTrue(stats.getHeapSize().getHighWaterMark() > 0);
        assertTrue(stats.getHeapSize().getLastSampleTime() > 0);
        assertTrue(stats.getHeapSize().getLowerBound() == 0);
        assertTrue(stats.getHeapSize().getLowWaterMark() > 0);
        assertNotNull(stats.getHeapSize().getName());
        assertTrue(stats.getHeapSize().getStartTime() > 0);
        assertNotNull(stats.getHeapSize().getUnit());
        assertTrue(stats.getHeapSize().getUpperBound() > 0);
        assertNotNull(stats.getUpTime());
        assertTrue(stats.getUpTime().getCount() > 0);
        assertNotNull(stats.getUpTime().getDescription());
        assertTrue(stats.getUpTime().getLastSampleTime() > 0);
        assertNotNull(stats.getUpTime().getName());
        assertTrue(stats.getUpTime().getStartTime() > 0);
        assertNotNull(stats.getUpTime().getUnit());
    }
View Full Code Here

Examples of javax.management.j2ee.statistics.JVMStats

        J2EEDomain[] domains = helper.getDomains();
        J2EEServer[] servers = domains[0].getServerInstances();
        JVM[] jvms = helper.getJavaVMs(servers[0]);
        long elapsed = System.currentTimeMillis() - jvms[0].getKernelBootTime().getTime();
        if(jvms[0].isStatisticsProvider()) {
            JVMStats stats = (JVMStats) ((StatisticsProvider)jvms[0]).getStats();
            BoundedRangeStatistic heap = stats.getHeapSize();
            return new DynamicServerInfo(heap.getCurrent(), heap.getHighWaterMark(), heap.getUpperBound(), elapsed);
        } else {
            return new DynamicServerInfo(elapsed);
        }
    }
View Full Code Here

Examples of javax.management.j2ee.statistics.JVMStats

        J2EEDomain[] domains = helper.getDomains();
        J2EEServer[] servers = domains[0].getServerInstances();
        JVM[] jvms = helper.getJavaVMs(servers[0]);
        long elapsed = System.currentTimeMillis() - jvms[0].getKernelBootTime().getTime();
        if(jvms[0].isStatisticsProvider()) {
            JVMStats stats = (JVMStats) ((StatisticsProvider)jvms[0]).getStats();
            BoundedRangeStatistic heap = stats.getHeapSize();
            return new DynamicServerInfo(heap.getCurrent(), heap.getHighWaterMark(), heap.getUpperBound(), elapsed);
        } else {
            return new DynamicServerInfo(elapsed);
        }
    }
View Full Code Here

Examples of javax.management.j2ee.statistics.JVMStats

        J2EEDomain[] domains = helper.getDomains();
        J2EEServer[] servers = helper.getServers(domains[0]);
        JVM[] jvms = helper.getJavaVMs(servers[0]);
        long elapsed = System.currentTimeMillis() - jvms[0].getKernelBootTime().getTime();
        if(jvms[0].isStatisticsProvider()) {
            JVMStats stats = (JVMStats) ((StatisticsProvider)jvms[0]).getStats();
            BoundedRangeStatistic heap = stats.getHeapSize();
            return new DynamicServerInfo(heap.getCurrent(), heap.getHighWaterMark(), heap.getUpperBound(), elapsed);
        } else {
            return new DynamicServerInfo(elapsed);
        }
    }
View Full Code Here

Examples of javax.management.j2ee.statistics.JVMStats

        assertEquals(new Integer(runtime.availableProcessors()), kernel.getAttribute(JVM_NAME, "availableProcessors"));
    }

    public void testStatistics() throws Exception {
        assertEquals(Boolean.TRUE, kernel.getAttribute(JVM_NAME, "statisticsProvider"));
        JVMStats stats = (JVMStats) kernel.getAttribute(JVM_NAME, "stats");
        assertNotNull(stats.getHeapSize());
        assertTrue(stats.getHeapSize().getCurrent() > 0);
        assertNotNull(stats.getHeapSize().getDescription());
        assertTrue(stats.getHeapSize().getHighWaterMark() > 0);
        assertTrue(stats.getHeapSize().getLastSampleTime() > 0);
        assertTrue(stats.getHeapSize().getLowerBound() == 0);
        assertTrue(stats.getHeapSize().getLowWaterMark() > 0);
        assertNotNull(stats.getHeapSize().getName());
        assertTrue(stats.getHeapSize().getStartTime() > 0);
        assertNotNull(stats.getHeapSize().getUnit());
        assertTrue(stats.getHeapSize().getUpperBound() > 0);
        assertNotNull(stats.getUpTime());
        assertTrue(stats.getUpTime().getCount() > 0);
        assertNotNull(stats.getUpTime().getDescription());
        assertTrue(stats.getUpTime().getLastSampleTime() > 0);
        assertNotNull(stats.getUpTime().getName());
        assertTrue(stats.getUpTime().getStartTime() > 0);
        assertNotNull(stats.getUpTime().getUnit());
    }
View Full Code Here

Examples of org.elasticsearch.monitor.jvm.JvmStats

//            monitorDeadlock();
            monitorLongGc();
        }

        private void monitorLongGc() {
            JvmStats currentJvmStats = jvmStats();

            for (int i = 0; i < currentJvmStats.gc().collectors().length; i++) {
                GarbageCollector gc = currentJvmStats.gc().collectors()[i];
                if (gc.lastGc() != null && lastJvmStats.gc.collectors()[i].lastGc() != null) {
                    GarbageCollector.LastGc lastGc = gc.lastGc();
                    if (lastGc.startTime == lastJvmStats.gc.collectors()[i].lastGc().startTime()) {
                        // we already handled this one...
                        continue;
View Full Code Here

Examples of org.elasticsearch.monitor.jvm.JvmStats

                    new InetSocketTransportAddress("localhost", 44200)
            );
            when(httpInfo.address()).thenReturn(boundTransportAddress);

            JvmService jvmService = mock(JvmService.class);
            JvmStats jvmStats = mock(JvmStats.class);
            JvmStats.Mem jvmStatsMem = mock(JvmStats.Mem.class);
            ByteSizeValue heapByteSizeValueMax = mock(ByteSizeValue.class);
            when(heapByteSizeValueMax.bytes()).thenReturn(123456L);
            when(jvmStatsMem.getHeapMax()).thenReturn(heapByteSizeValueMax);
            when(jvmStatsMem.getHeapUsed()).thenReturn(heapByteSizeValueMax);

            when(jvmStats.mem()).thenReturn(jvmStatsMem);
            when(jvmService.stats()).thenReturn(jvmStats);
            bind(JvmService.class).toInstance(jvmService);

            bind(ReferenceResolver.class).to(GlobalReferenceResolver.class).asEagerSingleton();
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.