Example usage for io.netty.buffer ByteBufAllocatorMetric usedDirectMemory

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

Introduction

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

Prototype

long usedDirectMemory();

Source Link

Document

Returns the number of bytes of direct 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());
}