Example usage for io.netty.buffer ByteBufAllocatorMetric usedHeapMemory

List of usage examples for io.netty.buffer ByteBufAllocatorMetric usedHeapMemory

Introduction

In this page you can find the example usage for io.netty.buffer ByteBufAllocatorMetric usedHeapMemory.

Prototype

long usedHeapMemory();

Source Link

Document

Returns the number of bytes of heap memory used by a ByteBufAllocator or -1 if unknown.

Usage

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

License:Apache License

private void initMetrics() {
    final ByteBufAllocatorMetric metric = unpooledByteBufAllocator.metric();

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