From da0eb30f028bfad2e95b93af3d4dc02be815c195 Mon Sep 17 00:00:00 2001 From: Anuved Verma Date: Wed, 3 Jul 2024 14:14:46 -0700 Subject: [PATCH] add stats handler --- .../main/java/com/lyft/data/proxyserver/ProxyServer.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/proxyserver/src/main/java/com/lyft/data/proxyserver/ProxyServer.java b/proxyserver/src/main/java/com/lyft/data/proxyserver/ProxyServer.java index b3ac5a42..33775f55 100644 --- a/proxyserver/src/main/java/com/lyft/data/proxyserver/ProxyServer.java +++ b/proxyserver/src/main/java/com/lyft/data/proxyserver/ProxyServer.java @@ -20,6 +20,7 @@ import org.eclipse.jetty.server.Server; import org.eclipse.jetty.server.ServerConnector; import org.eclipse.jetty.server.SslConnectionFactory; +import org.eclipse.jetty.server.handler.StatisticsHandler; import org.eclipse.jetty.servlet.ServletContextHandler; import org.eclipse.jetty.servlet.ServletHolder; import org.eclipse.jetty.util.ssl.SslContextFactory; @@ -97,7 +98,10 @@ private void setupContext(ProxyServerConfiguration config) { // Setup proxy handler to handle CONNECT methods ConnectHandler proxyConnectHandler = new ConnectHandler(); - this.server.setHandler(proxyConnectHandler); + StatisticsHandler proxyStatsHandler = new StatisticsHandler(); + + proxyStatsHandler.setHandler(proxyConnectHandler); + this.server.setHandler(proxyStatsHandler); if (proxyHandler != null) { proxy.setProxyHandler(proxyHandler);