net.spy.memcached.MemcachedClient.getStats()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(4.7k)|赞(0)|评价(0)|浏览(167)

本文整理了Java中net.spy.memcached.MemcachedClient.getStats()方法的一些代码示例,展示了MemcachedClient.getStats()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。MemcachedClient.getStats()方法的具体详情如下:
包路径:net.spy.memcached.MemcachedClient
类名称:MemcachedClient
方法名:getStats

MemcachedClient.getStats介绍

[英]Get all of the stats from all of the connections.
[中]从所有连接获取所有统计信息。

代码示例

代码示例来源:origin: Netflix/EVCache

public Map<SocketAddress, Map<String, String>> getStats(String cmd) {
  if(config.isRendInstance()) {
    List<InetSocketAddress> udsproxyInetSocketAddress = new ArrayList<InetSocketAddress>(memcachedNodesInZone.size());
    for(InetSocketAddress address : memcachedNodesInZone) {
      udsproxyInetSocketAddress.add(new InetSocketAddress(address.getHostName(), config.getUdsproxyMemcachedPort()));
    }
    
    MemcachedClient mc = null;
    try {
      mc = new MemcachedClient(connectionFactory, udsproxyInetSocketAddress);
      return mc.getStats(cmd);
    } catch(Exception ex) {
      
    } finally {
      if(mc != null) mc.shutdown();
    }
    return Collections.<SocketAddress, Map<String, String>>emptyMap();
  } else {
    return evcacheMemcachedClient.getStats(cmd);
  }
}

代码示例来源:origin: net.spy/spymemcached

/**
 * Get all of the stats from all of the connections.
 *
 * @return a Map of a Map of stats replies by SocketAddress
 * @throws IllegalStateException in the rare circumstance where queue is too
 *           full to accept any more requests
 */
@Override
public Map<SocketAddress, Map<String, String>> getStats() {
 return getStats(null);
}

代码示例来源:origin: com.google.code.maven-play-plugin.spy/spymemcached

/**
 * Get all of the stats from all of the connections.
 *
 * @return a Map of a Map of stats replies by SocketAddress
 * @throws IllegalStateException in the rare circumstance where queue
 *         is too full to accept any more requests
 */
public Map<SocketAddress, Map<String, String>> getStats() {
  return getStats(null);
}

代码示例来源:origin: com.google.code.simple-spring-memcached/spymemcached

/**
 * Get all of the stats from all of the connections.
 *
 * @return a Map of a Map of stats replies by SocketAddress
 * @throws IllegalStateException in the rare circumstance where queue is too
 *           full to accept any more requests
 */
public Map<SocketAddress, Map<String, String>> getStats() {
 return getStats(null);
}

代码示例来源:origin: naver/arcus-java-client

/**
 * Get all of the stats from all of the connections.
 *
 * @return a Map of a Map of stats replies by SocketAddress
 * @throws IllegalStateException in the rare circumstance where queue
 *                               is too full to accept any more requests
 */
public Map<SocketAddress, Map<String, String>> getStats() {
 return getStats(null);
}

代码示例来源:origin: com.amazonaws/elasticache-java-cluster-client

/**
 * Get all of the stats from all of the connections.
 *
 * @return a Map of a Map of stats replies by SocketAddress
 * @throws IllegalStateException in the rare circumstance where queue is too
 *           full to accept any more requests
 */
@Override
public Map<SocketAddress, Map<String, String>> getStats() {
 return getStats(null);
}

代码示例来源:origin: com.google.code.maven-play-plugin.spy/memcached

/**
 * Get all of the stats from all of the connections.
 * @throws IllegalStateException in the rare circumstance where queue
 *         is too full to accept any more requests
 */
public Map<SocketAddress, Map<String, String>> getStats() {
  return getStats(null);
}

代码示例来源:origin: indeedeng/lsmtree

public Map<String, String> getStats() {
  final Map<String, String> retVal = memcache.getStats().get(host);
  if (retVal != null) {
    return retVal;
  } else {
    return Collections.emptyMap();
  }
}

代码示例来源:origin: indeedeng/lsmtree

public void shutdown() {
  if (log.isDebugEnabled()) {
    log.debug("Memcached Stats: " + memcache.getStats());
  }
  memcache.shutdown();
}

代码示例来源:origin: io.snappydata/gemfire-junit

public void testStats() throws Exception {
 MemcachedClient client = bootstrapClient();
 Map stats = client.getStats();
 logger.info("stats:"+stats+" val:"+stats.values().toArray()[0]);
 assertEquals(1, stats.size());
 assertTrue(((Map)stats.values().toArray()[0]).isEmpty());
 assertTrue(client.add("keystats", 1, "stats").get());
}

代码示例来源:origin: OneBusAway/onebusaway-application-modules

public void logStatus() {
 _log.info(getCache().stats().toString() + "; disabled=" + _disabled
   + "; useMemcached=" + useMemcached
   + "; Local Size=" + _cache.size()
   + "; Memcached Size=" + (memcache==null?"[null]":memcache.getStats("sizes")));
}

代码示例来源:origin: aurorafeint/jruby-memcached

@JRubyMethod
public IRubyObject stats(ThreadContext context) {
  Ruby ruby = context.getRuntime();
  RubyHash results = RubyHash.newHash(ruby);
  for(Map.Entry<SocketAddress, Map<String, String>> entry : client.getStats().entrySet()) {
    RubyHash serverHash = RubyHash.newHash(ruby);
    for(Map.Entry<String, String> server : entry.getValue().entrySet()) {
      serverHash.op_aset(context, ruby.newString(server.getKey()), ruby.newString(server.getValue()));
    }
    results.op_aset(context, ruby.newString(entry.getKey().toString()), serverHash);
  }
  return results;
}

相关文章