public Duration addQueryRateMeasurements(int measurements, IntFunction<Double> queryRate) {
        Instant initialTime = fixture.tester().clock().instant();
        for (int i = 0; i < measurements; i++) {
            fixture.tester().nodeMetricsDb().addClusterMetrics(fixture.applicationId(),
                                                     Map.of(fixture.clusterId(), new ClusterMetricSnapshot(fixture.tester().clock().instant(),
                                                                                                   queryRate.apply(i),
                                                                                                   0.0)));
            fixture.tester().clock().advance(samplingInterval);
        }
        return Duration.between(initialTime, fixture.tester().clock().instant());
    }
Adds measurements with the given resource value and ideal values for the other resources,
scaled to take one node redundancy into account.
(I.e we adjust to measure a bit lower load than "naively" wanted to offset for the autoscaler
wanting to see the ideal load with one node missing.)
node-repository/src/test/java/com/yahoo/vespa/hosted/provision/autoscale/Loader.java