当前位置: 首页>>代码示例>>Java>>正文


Java LocalMapStats类代码示例

本文整理汇总了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);
    }
}
 
开发者ID:rodm,项目名称:teamcity-gradle-build-cache-plugin,代码行数:9,代码来源:BuildCachePage.java

示例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; 
   }
 
开发者ID:dsukhoroslov,项目名称:bagri,代码行数:13,代码来源:SchemaStatsAggregator.java

示例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;
}
 
开发者ID:hazelcast,项目名称:hazelcast-simulator,代码行数:8,代码来源:BackupExpirationMapTest.java

示例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());
    }
}
 
开发者ID:mrluo735,项目名称:cas-5.1.0,代码行数:52,代码来源:HazelcastMonitor.java

示例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);
}
 
开发者ID:micrometer-metrics,项目名称:micrometer,代码行数:44,代码来源:HazelcastCacheMetrics.java

示例8: getLocalMapStats

import com.hazelcast.monitor.LocalMapStats; //导入依赖的package包/类
@Override
public LocalMapStats getLocalMapStats() {
    return m.getLocalMapStats();
}
 
开发者ID:ravikumaran2015,项目名称:ravikumaran201504,代码行数:5,代码来源:SMap.java

示例9: getLocalMapStats

import com.hazelcast.monitor.LocalMapStats; //导入依赖的package包/类
@Override
public LocalMapStats getLocalMapStats() {
    return map.getLocalMapStats();
}
 
开发者ID:hazelcast,项目名称:hazelcast-jet,代码行数:5,代码来源:MapDecorator.java

示例10: getLocalMapStats

import com.hazelcast.monitor.LocalMapStats; //导入依赖的package包/类
@Override
public LocalMapStats getLocalMapStats() {
    return null;
}
 
开发者ID:gurbuzali,项目名称:hazel-local-cache,代码行数:5,代码来源:LocalCacheProxy.java

示例11: size

import com.hazelcast.monitor.LocalMapStats; //导入依赖的package包/类
public int size() {
    LocalMapStats stats = map.getLocalMapStats();
    return (int) (stats.getOwnedEntryCount() + stats.getBackupEntryCount());
}
 
开发者ID:igniterealtime,项目名称:Openfire,代码行数:5,代码来源:ClusteredCache.java

示例12: getCacheSize

import com.hazelcast.monitor.LocalMapStats; //导入依赖的package包/类
public int getCacheSize() {
    LocalMapStats stats = map.getLocalMapStats();
    return (int) (stats.getOwnedEntryMemoryCost() + stats.getBackupEntryMemoryCost());
}
 
开发者ID:igniterealtime,项目名称:Openfire,代码行数:5,代码来源:ClusteredCache.java

示例13: getLocalMapStats

import com.hazelcast.monitor.LocalMapStats; //导入依赖的package包/类
public LocalMapStats getLocalMapStats() {
    return dynamicProxy.getLocalMapStats();
}
 
开发者ID:mdogan,项目名称:hazelcast-archive,代码行数:4,代码来源:MProxyImpl.java

示例14: getOwnedAndBackupCount

import com.hazelcast.monitor.LocalMapStats; //导入依赖的package包/类
private long getOwnedAndBackupCount(IMap imap) {
    LocalMapStats localMapStats = imap.getLocalMapStats();
    return localMapStats.getOwnedEntryCount() + localMapStats.getBackupEntryCount();
}
 
开发者ID:mdogan,项目名称:hazelcast-archive,代码行数:5,代码来源:ClusterBackupTest.java

示例15: getLocalMapStats

import com.hazelcast.monitor.LocalMapStats; //导入依赖的package包/类
public LocalMapStats getLocalMapStats() {
    throw new UnsupportedOperationException();
}
 
开发者ID:mdogan,项目名称:hazelcast-archive,代码行数:4,代码来源:MapClientProxy.java


注:本文中的com.hazelcast.monitor.LocalMapStats类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。