public CacheStatisticsMetadata buildCacheStats(String name) { CacheStatisticsMetadata stats = new CacheStatisticsMetadata(); stats.setName(name); stats.setHitRatio(getCacheHitRatio()); stats.setTotalEntries(this.getTotalCacheEntries()); stats.setRequestCount(this.getRequestCount()); return stats; } }
public ModelNode wrap(CacheStatisticsMetadata object, ModelNode node) { if (object == null) return null; node.get(TOTAL_ENTRIES).set(object.getTotalEntries()); node.get(HITRATIO).set(String.valueOf(object.getHitRatio())); node.get(REQUEST_COUNT).set(object.getRequestCount()); wrapDomain(object, node); return node; }
public ModelNode wrap(CacheStatisticsMetadata object, ModelNode node) { if (object == null) return null; node.get(TOTAL_ENTRIES).set(object.getTotalEntries()); node.get(HITRATIO).set(String.valueOf(object.getHitRatio())); node.get(REQUEST_COUNT).set(object.getRequestCount()); wrapDomain(object, node); return node; }
public CacheStatisticsMetadata buildCacheStats(String name) { CacheStatisticsMetadata stats = new CacheStatisticsMetadata(); stats.setName(name); stats.setHitRatio(getCacheHitRatio()); stats.setTotalEntries(this.getTotalCacheEntries()); stats.setRequestCount(this.getRequestCount()); return stats; } }
public CacheStatisticsMetadata unwrap(ModelNode node) { if (node == null) return null; CacheStatisticsMetadata cache = new CacheStatisticsMetadata(); cache.setTotalEntries(node.get(TOTAL_ENTRIES).asInt()); cache.setHitRatio(Double.parseDouble(node.get(HITRATIO).asString())); cache.setRequestCount(node.get(REQUEST_COUNT).asInt()); unwrapDomain(cache, node); return cache; }
public CacheStatisticsMetadata unwrap(ModelNode node) { if (node == null) return null; CacheStatisticsMetadata cache = new CacheStatisticsMetadata(); cache.setTotalEntries(node.get(TOTAL_ENTRIES).asInt()); cache.setHitRatio(Double.parseDouble(node.get(HITRATIO).asString())); cache.setRequestCount(node.get(REQUEST_COUNT).asInt()); unwrapDomain(cache, node); return cache; }
public CacheStatisticsMetadata buildCacheStats(String name) { CacheStatisticsMetadata stats = new CacheStatisticsMetadata(); stats.setName(name); stats.setHitRatio(this.getRequestCount() == 0?0:((double)this.getCacheHitCount()/this.getRequestCount())*100); stats.setTotalEntries(this.getTotalCacheEntries()); stats.setRequestCount(this.getRequestCount()); return stats; } }