Skip to content

Commit

Permalink
Merge pull request apache#1764 from metamx/enableLogging
Browse files Browse the repository at this point in the history
Enable logging for memcached in factory
  • Loading branch information
fjy committed Sep 23, 2015
2 parents 5dd5fc7 + 4308aa9 commit a5718ee
Showing 1 changed file with 5 additions and 0 deletions.
Expand Up @@ -46,6 +46,7 @@
import net.spy.memcached.MemcachedClientIF;
import net.spy.memcached.internal.BulkFuture;
import net.spy.memcached.metrics.MetricCollector;
import net.spy.memcached.metrics.MetricType;
import net.spy.memcached.ops.LinkedOperationQueueFactory;
import net.spy.memcached.ops.OperationQueueFactory;
import org.apache.commons.codec.digest.DigestUtils;
Expand Down Expand Up @@ -133,6 +134,9 @@ private Map<String, Long> getCurrentValues()
for (Map.Entry<String, AtomicLong> entry : counters.entrySet()) {
builder.put(entry.getKey(), entry.getValue().get());
}
for (Map.Entry<String, AtomicLong> entry : meters.entrySet()) {
builder.put(entry.getKey(), entry.getValue().get());
}
return builder.build();
}
};
Expand Down Expand Up @@ -344,6 +348,7 @@ public void updateHistogram(String name, int amount)
.setReadBufferSize(config.getReadBufferSize())
.setOpQueueFactory(opQueueFactory)
.setMetricCollector(metricCollector)
.setEnableMetrics(MetricType.DEBUG) // Not as scary as it sounds
.build();

final List<InetSocketAddress> hosts = AddrUtil.getAddresses(config.getHosts());
Expand Down

0 comments on commit a5718ee

Please sign in to comment.