List of usage examples for io.netty.buffer PoolSubpageMetric pageSize
int pageSize();
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(); 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++;/* ww w . j ava2s.c o m*/ } }