Search in sources :

Example 1 with ClasseStatisticsVO

use of org.olat.restapi.system.vo.ClasseStatisticsVO in project OpenOLAT by OpenOLAT.

the class SystemTest method testRuntimeClassesStatsSystem.

@Test
public void testRuntimeClassesStatsSystem() throws IOException, URISyntaxException {
    RestConnection conn = new RestConnection();
    assertTrue(conn.login("administrator", "openolat"));
    URI systemUri = conn.getContextURI().path("system").path("monitoring").path("runtime").path("classes").build();
    ClasseStatisticsVO classesInfos = conn.get(systemUri, ClasseStatisticsVO.class);
    assertNotNull(classesInfos);
    assertTrue(classesInfos.getLoadedClassCount() > 0);
    assertTrue(classesInfos.getTotalLoadedClassCount() > 0);
    assertTrue(classesInfos.getUnloadedClassCount() >= 0);
    conn.shutdown();
}
Also used : ClasseStatisticsVO(org.olat.restapi.system.vo.ClasseStatisticsVO) URI(java.net.URI) Test(org.junit.Test)

Example 2 with ClasseStatisticsVO

use of org.olat.restapi.system.vo.ClasseStatisticsVO in project OpenOLAT by OpenOLAT.

the class RuntimeWebService method getClasseStatisticsVO.

private ClasseStatisticsVO getClasseStatisticsVO() {
    ClasseStatisticsVO stats = new ClasseStatisticsVO();
    ClassLoadingMXBean bean = ManagementFactory.getClassLoadingMXBean();
    stats.setLoadedClassCount(bean.getLoadedClassCount());
    stats.setTotalLoadedClassCount(bean.getTotalLoadedClassCount());
    stats.setUnloadedClassCount(bean.getUnloadedClassCount());
    return stats;
}
Also used : ClasseStatisticsVO(org.olat.restapi.system.vo.ClasseStatisticsVO) ClassLoadingMXBean(java.lang.management.ClassLoadingMXBean)

Example 3 with ClasseStatisticsVO

use of org.olat.restapi.system.vo.ClasseStatisticsVO in project openolat by klemens.

the class RuntimeWebService method getClasseStatisticsVO.

private ClasseStatisticsVO getClasseStatisticsVO() {
    ClasseStatisticsVO stats = new ClasseStatisticsVO();
    ClassLoadingMXBean bean = ManagementFactory.getClassLoadingMXBean();
    stats.setLoadedClassCount(bean.getLoadedClassCount());
    stats.setTotalLoadedClassCount(bean.getTotalLoadedClassCount());
    stats.setUnloadedClassCount(bean.getUnloadedClassCount());
    return stats;
}
Also used : ClasseStatisticsVO(org.olat.restapi.system.vo.ClasseStatisticsVO) ClassLoadingMXBean(java.lang.management.ClassLoadingMXBean)

Example 4 with ClasseStatisticsVO

use of org.olat.restapi.system.vo.ClasseStatisticsVO in project openolat by klemens.

the class SystemTest method testRuntimeClassesStatsSystem.

@Test
public void testRuntimeClassesStatsSystem() throws IOException, URISyntaxException {
    RestConnection conn = new RestConnection();
    assertTrue(conn.login("administrator", "openolat"));
    URI systemUri = conn.getContextURI().path("system").path("monitoring").path("runtime").path("classes").build();
    ClasseStatisticsVO classesInfos = conn.get(systemUri, ClasseStatisticsVO.class);
    assertNotNull(classesInfos);
    assertTrue(classesInfos.getLoadedClassCount() > 0);
    assertTrue(classesInfos.getTotalLoadedClassCount() > 0);
    assertTrue(classesInfos.getUnloadedClassCount() >= 0);
    conn.shutdown();
}
Also used : ClasseStatisticsVO(org.olat.restapi.system.vo.ClasseStatisticsVO) URI(java.net.URI) Test(org.junit.Test)

Aggregations

ClasseStatisticsVO (org.olat.restapi.system.vo.ClasseStatisticsVO)4 ClassLoadingMXBean (java.lang.management.ClassLoadingMXBean)2 URI (java.net.URI)2 Test (org.junit.Test)2