use of fi.otavanopisto.muikku.plugins.schooldatapyramus.rest.cache.EntityCacheStatistics.Statistics in project muikku by otavanopisto.
the class PyramusSystemRESTService method ping.
@GET
@Path("/cache/statistics")
@RESTPermit(handling = Handling.UNSECURED)
public Response ping() {
Map<String, Map<String, CachePathStatistics>> result = new HashMap<>();
for (String cacheType : entityCacheStatistics.getCacheTypes()) {
Statistics statistics = entityCacheStatistics.getStatistics(cacheType);
Map<String, CachePathStatistics> pathStatistics = new HashMap<>();
for (String path : statistics.getPaths()) {
pathStatistics.put(path, new CachePathStatistics(statistics.getHits(path), statistics.getMisses(path), statistics.getSkips(path)));
}
result.put(cacheType, pathStatistics);
}
return Response.ok(result).build();
}
Aggregations