private NearCacheStats getNearCacheStats(LocalInstanceStats localInstanceStats) { if (localInstanceStats instanceof LocalMapStatsImpl) { LocalMapStats localMapStats = (LocalMapStats) localInstanceStats; return localMapStats.getNearCacheStats(); } else if (localInstanceStats instanceof CacheStatistics) { CacheStatistics localMapStats = (CacheStatistics) localInstanceStats; return localMapStats.getNearCacheStatistics(); } else { return null; } }
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());
@Override public Long call() throws Exception { IMap<Long, Document> xddCache = hzInstance.getMap(CN_XDM_DOCUMENT); IMap<DataKey, Element> xdmCache = hzInstance.getMap(CN_XDM_ELEMENT); LocalMapStats stats = xddCache.getLocalMapStats(); long size = stats.getBackupEntryMemoryCost() + stats.getOwnedEntryMemoryCost(); stats = xdmCache.getLocalMapStats(); size += stats.getBackupEntryMemoryCost() + stats.getOwnedEntryMemoryCost(); return size; }
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; }
public HazelcastCacheStatistics(LocalMapStats localMapStats, long totalSize) { long hits = localMapStats.getHits(); setHitCount(hits); long total = localMapStats.getGetOperationCount(); long actualSize = localMapStats.getOwnedEntryMemoryCost(); setActualSize(actualSize);
@ManagedAnnotation("localHits") @ManagedDescription("the number of hits (reads) of the locally owned entries.") public long getLocalHits() { return localMapStatsDelegate.getLocalStats().getHits(); }
@ManagedAnnotation("localOwnedEntryCount") @ManagedDescription("number of entries owned on this member") public long getLocalOwnedEntryCount() { return localMapStatsDelegate.getLocalStats().getOwnedEntryCount(); }
@ManagedAnnotation("localOwnedEntryMemoryCost") @ManagedDescription("memory cost (number of bytes) of owned entries on this member") public long getLocalOwnedEntryMemoryCost() { return localMapStatsDelegate.getLocalStats().getOwnedEntryMemoryCost(); }
@Override public int getVersion() { if (detached) throw detachedException(); return (int) distributedMap.getLocalMapStats().getPutOperationCount(); }
@ManagedAnnotation("localBackupEntryMemoryCost") @ManagedDescription("memory cost (number of bytes) of backup entries on this member.") public long getLocalBackupEntryMemoryCost() { return localMapStatsDelegate.getLocalStats().getBackupEntryMemoryCost(); }
@ManagedAnnotation("localGetOperationCount") @ManagedDescription("number of get operations on this member") public long getLocalGetOperationCount() { return localMapStatsDelegate.getLocalStats().getGetOperationCount(); }
@ManagedAnnotation("localBackupEntryCount") @ManagedDescription("the number of backup entries hold on this member") public long getLocalBackupEntryCount() { return localMapStatsDelegate.getLocalStats().getBackupEntryCount(); }
@ManagedAnnotation("localBackupCount") @ManagedDescription("the number of backups per entry on this member") public int getLocalBackupCount() { return localMapStatsDelegate.getLocalStats().getBackupCount(); }
public HazelcastCacheStatistics(LocalMapStats localMapStats, long totalSize) { long hits = localMapStats.getHits(); setHitCount(hits); long total = localMapStats.getGetOperationCount(); long actualSize = localMapStats.getOwnedEntryMemoryCost(); setActualSize(actualSize);
@ManagedAnnotation("localHits") @ManagedDescription("the number of hits (reads) of the locally owned entries.") public long getLocalHits() { return localMapStatsDelegate.getLocalStats().getHits(); }
@ManagedAnnotation("localOwnedEntryCount") @ManagedDescription("number of entries owned on this member") public long getLocalOwnedEntryCount() { return localMapStatsDelegate.getLocalStats().getOwnedEntryCount(); }
@ManagedAnnotation("localOwnedEntryMemoryCost") @ManagedDescription("memory cost (number of bytes) of owned entries on this member") public long getLocalOwnedEntryMemoryCost() { return localMapStatsDelegate.getLocalStats().getOwnedEntryMemoryCost(); }
@ManagedAnnotation("localPutOperationCount") @ManagedDescription("the number of put operations on this member") public long getLocalPutOperationCount() { return localMapStatsDelegate.getLocalStats().getPutOperationCount(); }
@ManagedAnnotation("localBackupEntryMemoryCost") @ManagedDescription("memory cost (number of bytes) of backup entries on this member.") public long getLocalBackupEntryMemoryCost() { return localMapStatsDelegate.getLocalStats().getBackupEntryMemoryCost(); }
@ManagedAnnotation("localGetOperationCount") @ManagedDescription("number of get operations on this member") public long getLocalGetOperationCount() { return localMapStatsDelegate.getLocalStats().getGetOperationCount(); }