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); } }
/** * 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); }
/** * 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); }
/** * 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); }
/** * 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); }
/** * 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); }
/** * 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); }
public Map<String, String> getStats() { final Map<String, String> retVal = memcache.getStats().get(host); if (retVal != null) { return retVal; } else { return Collections.emptyMap(); } }
public void shutdown() { if (log.isDebugEnabled()) { log.debug("Memcached Stats: " + memcache.getStats()); } memcache.shutdown(); }
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()); }
public void logStatus() { _log.info(getCache().stats().toString() + "; disabled=" + _disabled + "; useMemcached=" + useMemcached + "; Local Size=" + _cache.size() + "; Memcached Size=" + (memcache==null?"[null]":memcache.getStats("sizes"))); }
@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; }