Search in sources :

Example 1 with ClusterShardCounter

use of com.ctrip.xpipe.redis.core.meta.ClusterShardCounter in project x-pipe by ctripcorp.

the class MetaUpdate method getStats.

@RequestMapping(value = "/stats", method = RequestMethod.GET)
public Map<String, Integer> getStats() {
    XpipeMeta xpipeMeta = metaCache.getXpipeMeta();
    ClusterShardCounter counter = new ClusterShardCounter();
    xpipeMeta.accept(counter);
    HashMap<String, Integer> counts = new HashMap<>();
    counts.put("clusterCount", counter.getClusterCount());
    counts.put("shardCount", counter.getShardCount());
    return counts;
}
Also used : XpipeMeta(com.ctrip.xpipe.redis.core.entity.XpipeMeta) ClusterShardCounter(com.ctrip.xpipe.redis.core.meta.ClusterShardCounter)

Aggregations

XpipeMeta (com.ctrip.xpipe.redis.core.entity.XpipeMeta)1 ClusterShardCounter (com.ctrip.xpipe.redis.core.meta.ClusterShardCounter)1