SamBarker commented on code in PR #863: URL: https://github.com/apache/flink-kubernetes-operator/pull/863#discussion_r1719115879
########## flink-kubernetes-operator/src/main/java/org/apache/flink/kubernetes/operator/metrics/KubernetesClientMetrics.java: ########## @@ -118,32 +139,91 @@ public KubernetesClientMetrics( createMeterViewForMetricsGroup( responseMetricGroup.addGroup(HTTP_RESPONSE_5XX))); } + this.requestStartTimes = new ConcurrentHashMap<>(); } @Override - public Response intercept(Chain chain) throws IOException { - Request request = chain.request(); - updateRequestMetrics(request); - Response response = null; - final long startTime = System.nanoTime(); - try { - response = chain.proceed(request); - return response; - } finally { - updateResponseMetrics(response, startTime); + public AsyncBody.Consumer<List<ByteBuffer>> consumer( Review Comment: I've pushed up https://github.com/apache/flink-kubernetes-operator/pull/863/commits/c4c9edaeaa66830a24523e5a996a8c98abc0511a which (ab)uses request headers to tack a start time onto a request and read it back when the request completes. I've also added a test which triggers websockets to ensure they are counted. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@flink.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org