本文整理汇总了Java中com.hazelcast.monitor.LocalMapStats类的典型用法代码示例。如果您正苦于以下问题:Java LocalMapStats类的具体用法?Java LocalMapStats怎么用?Java LocalMapStats使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
LocalMapStats类属于com.hazelcast.monitor包,在下文中一共展示了LocalMapStats类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: issue614
import com.hazelcast.monitor.LocalMapStats; //导入依赖的package包/类
@Test
public void issue614() {
final ConcurrentMap<Long, String> STORE =
new ConcurrentHashMap<Long, String>();
STORE.put(1l, "Event1");
STORE.put(2l, "Event2");
STORE.put(3l, "Event3");
STORE.put(4l, "Event4");
STORE.put(5l, "Event5");
STORE.put(6l, "Event6");
Config config = new Config();
config
.getMapConfig("map")
.setMapStoreConfig(new MapStoreConfig()
.setWriteDelaySeconds(1)
.setImplementation(new SimpleMapStore<Long, String>(STORE)));
HazelcastInstance h = Hazelcast.newHazelcastInstance(config);
IMap map = h.getMap("map");
Collection collection = map.values();
LocalMapStats localMapStats = map.getLocalMapStats();
assertEquals(0, localMapStats.getDirtyEntryCount());
}
开发者ID:health-and-care-developer-network,项目名称:health-and-care-developer-network,代码行数:23,代码来源:MapStoreTest.java
示例2: fillModel
import com.hazelcast.monitor.LocalMapStats; //导入依赖的package包/类
public void fillModel(@NotNull Map<String, Object> model, @NotNull HttpServletRequest request) {
HazelcastInstance instance = Hazelcast.getHazelcastInstanceByName(INSTANCE_NAME);
if (instance != null) {
IMap<String, byte[]> taskCache = instance.getMap(TASK_CACHE_NAME);
LocalMapStats statistics = taskCache.getLocalMapStats();
model.put("statistics", statistics);
}
}
示例3: getCacheStatistics
import com.hazelcast.monitor.LocalMapStats; //导入依赖的package包/类
@Override
public CacheStatistics getCacheStatistics(CacheManager cacheManager,
HazelcastCache cache) {
DefaultCacheStatistics statistics = new DefaultCacheStatistics();
LocalMapStats mapStatistics = ((IMap<?, ?>) cache.getNativeCache())
.getLocalMapStats();
statistics.setSize(mapStatistics.getOwnedEntryCount());
statistics.setGetCacheCounts(mapStatistics.getHits(),
mapStatistics.getGetOperationCount() - mapStatistics.getHits());
return statistics;
}
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:12,代码来源:HazelcastCacheStatisticsProvider.java
示例4: call
import com.hazelcast.monitor.LocalMapStats; //导入依赖的package包/类
@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;
}
示例5: totalEntryCountOnNode
import com.hazelcast.monitor.LocalMapStats; //导入依赖的package包/类
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;
}
示例6: toString
import com.hazelcast.monitor.LocalMapStats; //导入依赖的package包/类
@Override
public void toString(final StringBuilder builder) {
final LocalMapStats localMapStats = map.getLocalMapStats();
builder.append("Creation time: ")
.append(localMapStats.getCreationTime())
.append(", ")
.append("Cluster size: ")
.append(clusterSize)
.append(", ")
.append("Owned entry count: ")
.append(localMapStats.getOwnedEntryCount())
.append(", ")
.append("Backup entry count: ")
.append(localMapStats.getBackupEntryCount())
.append(", ")
.append("Backup count: ")
.append(localMapStats.getBackupCount())
.append(", ")
.append("Hits count: ")
.append(localMapStats.getHits())
.append(", ")
.append("Last update time: ")
.append(localMapStats.getLastUpdateTime())
.append(", ")
.append("Last access time: ")
.append(localMapStats.getLastAccessTime())
.append(", ")
.append("Locked entry count: ")
.append(localMapStats.getLockedEntryCount())
.append(", ")
.append("Dirty entry count: ")
.append(localMapStats.getDirtyEntryCount())
.append(", ")
.append("Total get latency: ")
.append(localMapStats.getMaxGetLatency())
.append(", ")
.append("Total put latency: ")
.append(localMapStats.getTotalPutLatency())
.append(", ")
.append("Total remove latency: ")
.append(localMapStats.getTotalRemoveLatency())
.append(", ")
.append("Heap cost: ")
.append(localMapStats.getHeapCost());
if (localMapStats.getNearCacheStats() != null) {
builder.append(", Misses: ")
.append(localMapStats.getNearCacheStats().getMisses());
}
}
示例7: bindTo
import com.hazelcast.monitor.LocalMapStats; //导入依赖的package包/类
@Override
public void bindTo(MeterRegistry registry) {
LocalMapStats s = cache.getLocalMapStats();
Gauge.builder(name + ".requests", cache, cache -> cache.getLocalMapStats().getHits())
.tags(tags).tags("result", "hit")
.description("The number of times cache lookup methods have returned a cached value")
.register(registry);
Gauge.builder(name + ".requests", cache,
cache -> {
LocalMapStats stats = cache.getLocalMapStats();
return stats.getGetOperationCount() - stats.getHits();
})
.tags(tags).tags("result", "miss")
.description("The number of times cache lookup methods have not returned a value")
.register(registry);
Gauge.builder(name + ".entries", cache, cache -> cache.getLocalMapStats().getBackupEntryCount())
.tags(tags).tags("ownership", "backup")
.description("The number of backup entries held by this member")
.register(registry);
Gauge.builder(name + ".entries", cache, cache -> cache.getLocalMapStats().getOwnedEntryCount())
.tags(tags).tags("ownership", "owned")
.description("The number of owned entries held by this member")
.register(registry);
Gauge.builder(name + ".entry.memory", cache, cache -> cache.getLocalMapStats().getBackupEntryMemoryCost())
.tags(tags).tags("ownership", "backup")
.description("Memory cost of backup entries held by this member")
.baseUnit("bytes")
.register(registry);
Gauge.builder(name + ".entry.memory", cache, cache -> cache.getLocalMapStats().getOwnedEntryMemoryCost())
.tags(tags).tags("ownership", "owned")
.description("Memory cost of owned entries held by this member")
.baseUnit("bytes")
.register(registry);
timings(registry);
nearCacheMetrics(registry);
}
示例8: getLocalMapStats
import com.hazelcast.monitor.LocalMapStats; //导入依赖的package包/类
@Override
public LocalMapStats getLocalMapStats() {
return m.getLocalMapStats();
}
示例9: getLocalMapStats
import com.hazelcast.monitor.LocalMapStats; //导入依赖的package包/类
@Override
public LocalMapStats getLocalMapStats() {
return map.getLocalMapStats();
}
示例10: getLocalMapStats
import com.hazelcast.monitor.LocalMapStats; //导入依赖的package包/类
@Override
public LocalMapStats getLocalMapStats() {
return null;
}
示例11: size
import com.hazelcast.monitor.LocalMapStats; //导入依赖的package包/类
public int size() {
LocalMapStats stats = map.getLocalMapStats();
return (int) (stats.getOwnedEntryCount() + stats.getBackupEntryCount());
}
示例12: getCacheSize
import com.hazelcast.monitor.LocalMapStats; //导入依赖的package包/类
public int getCacheSize() {
LocalMapStats stats = map.getLocalMapStats();
return (int) (stats.getOwnedEntryMemoryCost() + stats.getBackupEntryMemoryCost());
}
示例13: getLocalMapStats
import com.hazelcast.monitor.LocalMapStats; //导入依赖的package包/类
public LocalMapStats getLocalMapStats() {
return dynamicProxy.getLocalMapStats();
}
示例14: getOwnedAndBackupCount
import com.hazelcast.monitor.LocalMapStats; //导入依赖的package包/类
private long getOwnedAndBackupCount(IMap imap) {
LocalMapStats localMapStats = imap.getLocalMapStats();
return localMapStats.getOwnedEntryCount() + localMapStats.getBackupEntryCount();
}
示例15: getLocalMapStats
import com.hazelcast.monitor.LocalMapStats; //导入依赖的package包/类
public LocalMapStats getLocalMapStats() {
throw new UnsupportedOperationException();
}