protected static void printNearCacheStats(ICache<Integer, Article> cache) { NearCacheStats stats = cache.getLocalCacheStatistics().getNearCacheStatistics(); System.out.printf("The Near Cache contains %d entries.%n", stats.getOwnedEntryCount()); System.out.printf("The first article instance was retrieved from the remote instance (Near Cache misses: %d).%n", stats.getMisses()); System.out.printf( "The second and third article instance were retrieved from the local Near Cache (Near Cache hits: %d).%n", stats.getHits()); }
protected static void printNearCacheStats(IMap<?, Article> map) { NearCacheStats stats = map.getLocalMapStats().getNearCacheStats(); System.out.printf("The Near Cache contains %d entries.%n", stats.getOwnedEntryCount()); System.out.printf("The first article instance was retrieved from the remote instance (Near Cache misses: %d).%n", stats.getMisses()); System.out.printf( "The second and third article instance were retrieved from the local Near Cache (Near Cache hits: %d).%n", stats.getHits()); }
@Override public void run(String... arg0) { Instant after = Instant.now(); Duration duration = Duration.between(before.getBefore(), after); IMap<String, Airport> airportsMap = hazelcastInstance.getMap(MyConstants.MAP_NAME_AIRPORTS); NearCacheStats airportsMapNearCacheStats = airportsMap.getLocalMapStats().getNearCacheStats(); System.out.printf("===================================== %n"); System.out.printf("=== R E S U L T S === %n"); System.out.printf("===================================== %n"); System.out.printf("=== Map : '%s'%n", airportsMap.getName()); System.out.printf("=== Calls............. : '%d'%n", fraudService.getCalls()); System.out.printf("=== Alerts............ : '%d'%n", fraudService.getAlerts()); if (airportsMapNearCacheStats != null) { System.out.printf("=== Near Cache hits... : '%d'%n", airportsMapNearCacheStats.getHits()); System.out.printf("=== Near Cache misses. : '%d'%n", airportsMapNearCacheStats.getMisses()); } System.out.printf("===================================== %n"); System.out.printf("=== Run time for tests : '%s'%n", duration); System.out.printf("===================================== %n"); } }
protected static void printNearCacheStats(ICache<?, ?> cache, String message) { NearCacheStats stats = cache.getLocalCacheStatistics().getNearCacheStatistics(); System.out.printf("%s (%d entries, %d hits, %d misses, %d evictions, %d expirations)%n", message, stats.getOwnedEntryCount(), stats.getHits(), stats.getMisses(), stats.getEvictions(), stats.getExpirations()); }
protected static void printNearCacheStats(IMap<?, Article> map, String message) { NearCacheStats stats = map.getLocalMapStats().getNearCacheStats(); System.out.printf("%s (%d entries, %d hits, %d misses, %d evictions, %d expirations)%n", message, stats.getOwnedEntryCount(), stats.getHits(), stats.getMisses(), stats.getEvictions(), stats.getExpirations()); }