@Override
    public void onClosed(Connection connection) {
        if (isHttpServerConnection(connection)) {
            connectionsMetrics.remove(connection).ifPresent(metrics ->
                    metricAggregator.set(MetricDefinitions.REQUESTS_PER_CONNECTION, metrics.requests.get(), metrics.metricContext));
        }
    }
Aggregates connection specific metrics such as {@link MetricDefinitions#REQUESTS_PER_CONNECTION}.

@author bjorncs
container-core/src/main/java/com/yahoo/jdisc/http/server/jetty/ConnectionMetricAggregator.java