Example usage for io.netty.buffer PoolSubpageMetric maxNumElements

List of usage examples for io.netty.buffer PoolSubpageMetric maxNumElements

Introduction

In this page you can find the example usage for io.netty.buffer PoolSubpageMetric maxNumElements.

Prototype

int maxNumElements();

Source Link

Document

Return the number of maximal elements that can be allocated out of the sub-page.

Usage

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

License:Apache License

private static PoolSubpageStats newPoolSubpageStats(PoolSubpageMetric m) {
    PoolSubpageStats stats = new PoolSubpageStats();
    stats.maxNumElements = m.maxNumElements();
    stats.numAvailable = m.numAvailable();
    stats.elementSize = m.elementSize();
    stats.pageSize = m.pageSize();/* w w  w  .jav a2  s  .  c  o m*/
    return stats;
}

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

License:Apache License

private void initSubpageMetrics(final String prefix, final String subpageName,
        final Iterator<PoolSubpageMetric> subpagesIterator) {
    int counter = 0;
    while (subpagesIterator.hasNext()) {
        final PoolSubpageMetric poolSubpageMetric = subpagesIterator.next();

        final String subpagePrefix = format("%s.%s", subpageName, counter);

        metrics.put(format("%s.%s.elementSize", prefix, subpagePrefix),
                (Gauge<Integer>) () -> poolSubpageMetric.elementSize());
        metrics.put(format("%s.%s.maxNumElements", prefix, subpagePrefix),
                (Gauge<Integer>) () -> poolSubpageMetric.maxNumElements());
        metrics.put(format("%s.%s.numAvailable", prefix, subpagePrefix),
                (Gauge<Integer>) () -> poolSubpageMetric.numAvailable());
        metrics.put(format("%s.%s.pageSize", prefix, subpagePrefix),
                (Gauge<Integer>) () -> poolSubpageMetric.pageSize());

        counter++;//from  w  w  w .  ja  v a2 s  . co  m
    }
}