Search in sources :

Example 1 with MemoryPoolVO

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

the class MemoryWebService method createMemoryPools.

private MemoryPoolVO[] createMemoryPools() {
    List<MemoryPoolMXBean> memoryPool = ManagementFactory.getMemoryPoolMXBeans();
    MemoryPoolVO[] voes = new MemoryPoolVO[memoryPool.size()];
    int count = 0;
    for (MemoryPoolMXBean bean : memoryPool) {
        if (bean.isValid()) {
            voes[count++] = new MemoryPoolVO(bean);
        }
    }
    return voes;
}
Also used : MemoryPoolVO(org.olat.restapi.system.vo.MemoryPoolVO) MemoryPoolMXBean(java.lang.management.MemoryPoolMXBean)

Example 2 with MemoryPoolVO

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

the class MemoryWebService method getMemoryPools.

@GET
@Path("pools")
@Produces(MediaType.TEXT_PLAIN)
public Response getMemoryPools() {
    MemoryPoolVO[] voes = createMemoryPools();
    StringBuilder sb = new StringBuilder();
    for (MemoryPoolVO vo : voes) {
        sb.append(vo.getName()).append(" - ").append(vo.getType()).append(" - ").append(vo.getUsage());
    }
    return Response.ok(sb.toString()).build();
}
Also used : MemoryPoolVO(org.olat.restapi.system.vo.MemoryPoolVO) Path(javax.ws.rs.Path) Produces(javax.ws.rs.Produces) GET(javax.ws.rs.GET)

Example 3 with MemoryPoolVO

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

the class MemoryWebService method createMemoryPools.

private MemoryPoolVO[] createMemoryPools() {
    List<MemoryPoolMXBean> memoryPool = ManagementFactory.getMemoryPoolMXBeans();
    MemoryPoolVO[] voes = new MemoryPoolVO[memoryPool.size()];
    int count = 0;
    for (MemoryPoolMXBean bean : memoryPool) {
        if (bean.isValid()) {
            voes[count++] = new MemoryPoolVO(bean);
        }
    }
    return voes;
}
Also used : MemoryPoolVO(org.olat.restapi.system.vo.MemoryPoolVO) MemoryPoolMXBean(java.lang.management.MemoryPoolMXBean)

Example 4 with MemoryPoolVO

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

the class MemoryWebService method getMemoryPools.

@GET
@Path("pools")
@Produces(MediaType.TEXT_PLAIN)
public Response getMemoryPools() {
    MemoryPoolVO[] voes = createMemoryPools();
    StringBuilder sb = new StringBuilder();
    for (MemoryPoolVO vo : voes) {
        sb.append(vo.getName()).append(" - ").append(vo.getType()).append(" - ").append(vo.getUsage());
    }
    return Response.ok(sb.toString()).build();
}
Also used : MemoryPoolVO(org.olat.restapi.system.vo.MemoryPoolVO) Path(javax.ws.rs.Path) Produces(javax.ws.rs.Produces) GET(javax.ws.rs.GET)

Aggregations

MemoryPoolVO (org.olat.restapi.system.vo.MemoryPoolVO)4 MemoryPoolMXBean (java.lang.management.MemoryPoolMXBean)2 GET (javax.ws.rs.GET)2 Path (javax.ws.rs.Path)2 Produces (javax.ws.rs.Produces)2