Example usage for io.netty.buffer PooledByteBufAllocatorMetric numThreadLocalCaches

List of usage examples for io.netty.buffer PooledByteBufAllocatorMetric numThreadLocalCaches

Introduction

In this page you can find the example usage for io.netty.buffer PooledByteBufAllocatorMetric numThreadLocalCaches.

Prototype

public int numThreadLocalCaches() 

Source Link

Document

Return the number of thread local caches used by this PooledByteBufAllocator .

Usage

From source file:ratpack.dropwizard.metrics.internal.PooledByteBufAllocatorMetricSet.java

License:Apache License

private void initMetrics() {
    final PooledByteBufAllocatorMetric metric = pooledByteBufAllocator.metric();

    metrics.put("numDirectArenas", (Gauge<Integer>) () -> metric.numDirectArenas());
    metrics.put("numHeapArenas", (Gauge<Integer>) () -> metric.numHeapArenas());
    metrics.put("numThreadLocalCaches", (Gauge<Integer>) () -> metric.numThreadLocalCaches());
    metrics.put("smallCacheSize", (Gauge<Integer>) () -> metric.smallCacheSize());
    metrics.put("tinyCacheSize", (Gauge<Integer>) () -> metric.tinyCacheSize());
    metrics.put("normalCacheSize", (Gauge<Integer>) () -> metric.normalCacheSize());
    metrics.put("chunkSize", (Gauge<Integer>) () -> metric.chunkSize());

    metrics.put("usedDirectMemory", (Gauge<Long>) () -> metric.usedDirectMemory());
    metrics.put("usedHeapMemory", (Gauge<Long>) () -> metric.usedHeapMemory());

    if (includeArenas) {
        final Iterator<PoolArenaMetric> directArenasIterator = metric.directArenas().iterator();
        initPoolArenaMetrics(directArenasIterator);

        final Iterator<PoolArenaMetric> heapArenasIterator = metric.heapArenas().iterator();
        initPoolArenaMetrics(heapArenasIterator);
    }//from   ww  w .ja  v a  2  s .  c  o  m
}