use of org.apache.archiva.rest.api.model.CacheEntry in project archiva by apache.
the class DefaultSystemStatusService method getCacheEntries.
@Override
public List<CacheEntry> getCacheEntries() throws ArchivaRestServiceException {
List<CacheEntry> cacheEntries = new ArrayList<CacheEntry>(caches.size());
DecimalFormat decimalFormat = new DecimalFormat("#%");
for (Map.Entry<String, Cache> entry : caches.entrySet()) {
CacheStatistics cacheStatistics = entry.getValue().getStatistics();
cacheEntries.add(new CacheEntry(entry.getKey(), cacheStatistics.getSize(), cacheStatistics.getCacheHits(), cacheStatistics.getCacheMiss(), decimalFormat.format(cacheStatistics.getCacheHitRate()).toString(), cacheStatistics.getInMemorySize()));
}
Collections.sort(cacheEntries, new CacheEntryComparator());
return cacheEntries;
}
Aggregations