From 3276e6a841f3e47f4e30c1ce67360213595e7326 Mon Sep 17 00:00:00 2001 From: karim-z Date: Thu, 29 Feb 2024 13:36:49 -0800 Subject: [PATCH] Remove static from http2metricschannelhandler to allow for override (#1750) * Remove static from http2metricschannelhandler to allow for override * Update incrementErrorCounter function --------- Co-authored-by: $(git --no-pager log --format=format:'%an' -n 1) <$(git --no-pager log --format=format:'%ae' -n 1)> --- .../common/metrics/Http2MetricsChannelHandlers.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/zuul-core/src/main/java/com/netflix/netty/common/metrics/Http2MetricsChannelHandlers.java b/zuul-core/src/main/java/com/netflix/netty/common/metrics/Http2MetricsChannelHandlers.java index 33e6eff9e3..03ce167093 100644 --- a/zuul-core/src/main/java/com/netflix/netty/common/metrics/Http2MetricsChannelHandlers.java +++ b/zuul-core/src/main/java/com/netflix/netty/common/metrics/Http2MetricsChannelHandlers.java @@ -45,8 +45,7 @@ public Outbound outbound() { return outbound; } - protected static void incrementErrorCounter( - Registry registry, String counterName, String metricId, Http2Exception h2e) { + protected void incrementErrorCounter(Registry registry, String counterName, String metricId, Http2Exception h2e) { String h2Error = h2e.error() != null ? h2e.error().name() : "NA"; String exceptionName = h2e.getClass().getSimpleName(); @@ -54,7 +53,7 @@ protected static void incrementErrorCounter( .increment(); } - protected static void incrementCounter(Registry registry, String counterName, String metricId, Http2Frame frame) { + protected void incrementCounter(Registry registry, String counterName, String metricId, Http2Frame frame) { long errorCode; if (frame instanceof Http2ResetFrame) { errorCode = ((Http2ResetFrame) frame).errorCode(); @@ -69,7 +68,7 @@ protected static void incrementCounter(Registry registry, String counterName, St } @ChannelHandler.Sharable - private static class Inbound extends ChannelInboundHandlerAdapter { + private class Inbound extends ChannelInboundHandlerAdapter { private final Registry registry; private final String metricId; private final String frameCounterName; @@ -117,7 +116,7 @@ public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws E } @ChannelHandler.Sharable - private static class Outbound extends ChannelOutboundHandlerAdapter { + private class Outbound extends ChannelOutboundHandlerAdapter { private final Registry registry; private final String metricId; private final String frameCounterName;