Example usage for io.netty.buffer PoolChunkListMetric maxUsage

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

Introduction

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

Prototype

int maxUsage();

Source Link

Document

Return the maximum usage of the chunk list after which chunks are promoted to the next 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();/* w ww .  j  a  v  a 2  s  .co m*/
    stats.maxUsage = m.maxUsage();
    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++;/*  w  w  w .ja v a 2  s  .  c  o m*/
    }
}