Class NettyRequestMetrics


  • public class NettyRequestMetrics
    extends Object
    Utilities for collecting and publishing request-level metrics.
    • Method Detail

      • metricsAreEnabled

        public static boolean metricsAreEnabled​(MetricCollector metricCollector)
        Determine whether metrics are enabled, based on the provided metric collector.
      • publishHttp2StreamMetrics

        public static void publishHttp2StreamMetrics​(MetricCollector metricCollector,
                                                     io.netty.channel.Channel channel)
        Publish stream metrics for the provided stream channel to the provided collector. This should only be invoked after the stream has been initialized. If the stream is not initialized when this is invoked, an exception will be thrown.
      • measureTimeTaken

        public static void measureTimeTaken​(io.netty.util.concurrent.Future<?> future,
                                            Consumer<Duration> onDone)
        Measure the time taken for a Future to complete. Does NOT differentiate between success/failure.