public OptionalDouble queryRate(Duration window, Instant now) {
        Instant oldest = now.minus(window);
        return snapshots.stream()
                        .filter(snapshot -> ! snapshot.at().isBefore(oldest))
                        .mapToDouble(snapshot -> snapshot.queryRate())
                        .average();
    }
Returns the average query rate in the given window, or empty if there are no measurements in it
node-repository/src/main/java/com/yahoo/vespa/hosted/provision/autoscale/ClusterTimeseries.java