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

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

本文整理了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

  1. public Map<SocketAddress, Map<String, String>> getStats(String cmd) {
  2. if(config.isRendInstance()) {
  3. List<InetSocketAddress> udsproxyInetSocketAddress = new ArrayList<InetSocketAddress>(memcachedNodesInZone.size());
  4. for(InetSocketAddress address : memcachedNodesInZone) {
  5. udsproxyInetSocketAddress.add(new InetSocketAddress(address.getHostName(), config.getUdsproxyMemcachedPort()));
  6. }
  7. MemcachedClient mc = null;
  8. try {
  9. mc = new MemcachedClient(connectionFactory, udsproxyInetSocketAddress);
  10. return mc.getStats(cmd);
  11. } catch(Exception ex) {
  12. } finally {
  13. if(mc != null) mc.shutdown();
  14. }
  15. return Collections.<SocketAddress, Map<String, String>>emptyMap();
  16. } else {
  17. return evcacheMemcachedClient.getStats(cmd);
  18. }
  19. }

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

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

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

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

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

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

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

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

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

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

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

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

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

  1. public Map<String, String> getStats() {
  2. final Map<String, String> retVal = memcache.getStats().get(host);
  3. if (retVal != null) {
  4. return retVal;
  5. } else {
  6. return Collections.emptyMap();
  7. }
  8. }

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

  1. public void shutdown() {
  2. if (log.isDebugEnabled()) {
  3. log.debug("Memcached Stats: " + memcache.getStats());
  4. }
  5. memcache.shutdown();
  6. }

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

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

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

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

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

  1. @JRubyMethod
  2. public IRubyObject stats(ThreadContext context) {
  3. Ruby ruby = context.getRuntime();
  4. RubyHash results = RubyHash.newHash(ruby);
  5. for(Map.Entry<SocketAddress, Map<String, String>> entry : client.getStats().entrySet()) {
  6. RubyHash serverHash = RubyHash.newHash(ruby);
  7. for(Map.Entry<String, String> server : entry.getValue().entrySet()) {
  8. serverHash.op_aset(context, ruby.newString(server.getKey()), ruby.newString(server.getValue()));
  9. }
  10. results.op_aset(context, ruby.newString(entry.getKey().toString()), serverHash);
  11. }
  12. return results;
  13. }

相关文章