Example usage for io.netty.buffer PoolChunkListMetric minUsage

List of usage examples for io.netty.buffer PoolChunkListMetric minUsage

Introduction

In this page you can find the example usage for io.netty.buffer PoolChunkListMetric minUsage.

Prototype

int minUsage();

Source Link

Document

Return the minimum usage of the chunk list before which chunks are promoted to the previous list.

Usage

From source file:com.yahoo.pulsar.broker.stats.AllocatorStatsGenerator.java

License:Apache License

private static PoolChunkListStats newPoolChunkListStats(PoolChunkListMetric m) {
    PoolChunkListStats stats = new PoolChunkListStats();
    stats.minUsage = m.minUsage();
    stats.maxUsage = m.maxUsage();/*from   ww w  .  ja va  2  s .  c om*/
    stats.chunks = Lists.newArrayList();
    m.forEach(chunk -> stats.chunks.add(newPoolChunkStats(chunk)));
    return stats;
}

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

License:Apache License

private void initPoolChunkListMetrics(final String prefix, final Iterator<PoolChunkListMetric> chunksIterator) {
    int counter = 0;
    while (chunksIterator.hasNext()) {
        final PoolChunkListMetric poolChunkMetrics = chunksIterator.next();

        final String poolChunkPrefix = format("poolChunkList.%s", counter);

        metrics.put(format("%s.%s.maxUsage", prefix, poolChunkPrefix),
                (Gauge<Integer>) () -> poolChunkMetrics.maxUsage());
        metrics.put(format("%s.%s.minUsage", prefix, poolChunkPrefix),
                (Gauge<Integer>) () -> poolChunkMetrics.minUsage());

        counter++;/*from ww w.  j  a  va 2s.co m*/
    }
}