private static long totalEntryCountOnNode(String name, HazelcastInstance instance) { IMap map = instance.getMap(name); LocalMapStats localMapStats = map.getLocalMapStats(); long ownedEntryCount = localMapStats.getOwnedEntryCount(); long backupEntryCount = localMapStats.getBackupEntryCount(); return ownedEntryCount + backupEntryCount; }
IMap map = Hazelcast.getMap("test"); for (int i = 0; i < 100; i++) { map.put(i, i); map.get(i); } LocalMapStats stats = map.getLocalMapStats(); System.err.println(stats.getHits()); System.err.println(stats.getOwnedEntryCount());
@ManagedAnnotation("localOwnedEntryCount") @ManagedDescription("number of entries owned on this member") public long getLocalOwnedEntryCount() { return localMapStatsDelegate.getLocalStats().getOwnedEntryCount(); }
@ManagedAnnotation("localOwnedEntryCount") @ManagedDescription("number of entries owned on this member") public long getLocalOwnedEntryCount() { return localMapStatsDelegate.getLocalStats().getOwnedEntryCount(); }