Do not track latency for upgrade requests.
@@ -53,6 +53,7 @@ import org.cometd.server.transport.AsyncJSONTransport;
import org.cometd.server.transport.JSONTransport;
import org.cometd.websocket.server.JettyWebSocketTransport;
import org.cometd.websocket.server.WebSocketTransport;
+import org.eclipse.jetty.http.HttpHeader;
import org.eclipse.jetty.jmx.MBeanContainer;
import org.eclipse.jetty.server.AbstractConnectionFactory;
import org.eclipse.jetty.server.ConnectionFactory;
@@ -493,7 +494,9 @@ public class CometDLoadServer {
} finally {
long end = System.nanoTime();
if (currentEnabled.get()) {
+ if (!request.getHttpFields().contains(HttpHeader.UPGRADE)) {
updateLatencies(begin, end);
+ }
} else {
currentEnabled.set(true);
}
