@Test
    public void test_autoscaling_considers_growth_rate() {
        var fixture = DynamicProvisioningTester.fixture().awsProdSetup(true).build();
        fixture.setScalingDuration(Duration.ofHours(6));

        fixture.tester().clock().advance(Duration.ofDays(2));
        Duration timeAdded = fixture.loader().addLoadMeasurements(100, t -> t == 0 ? 200.0 : 100.0, t -> 0.0);
        fixture.tester.clock().advance(timeAdded.negated());
        fixture.loader().addCpuMeasurements(0.25, 200);
        fixture.tester().assertResources("Scale up since we assume we need 2x cpu for growth when no scaling time data",
                                         5, 1, 2.7,  11.9, 50.5,
                                         fixture.autoscale());

        fixture.setScalingDuration(Duration.ofHours(8));
        fixture.tester().clock().advance(Duration.ofDays(2));
        timeAdded = fixture.loader().addLoadMeasurements(100, t -> 100.0 + (t < 50 ? t : 100 - t), t -> 0.0);
        fixture.tester.clock().advance(timeAdded.negated());
        fixture.loader().addCpuMeasurements(0.15, 200);
        fixture.tester().assertResources("Scale down since observed growth is slower than scaling time",
                                         5, 1, 1.3,   11.9, 50.5,
                                         fixture.autoscale());

        fixture.setScalingDuration(Duration.ofHours(8));
        fixture.tester().clock().advance(Duration.ofDays(2));
        timeAdded = fixture.loader().addLoadMeasurements(100,
                                                         t -> 100.0 + (t < 50 ? t * t * t : 125000 - (t - 49) * (t - 49) * (t - 49)),
                                                         t -> 0.0);
        fixture.tester.clock().advance(timeAdded.negated());
        fixture.loader().addCpuMeasurements(0.25, 200);
        fixture.tester().assertResources("Scale up since observed growth is faster than scaling time",
                                         5, 1, 2.6,  11.9, 50.5,
                                         fixture.autoscale());
    }
Same as above but mostly write traffic, which favors smaller groups
node-repository/src/test/java/com/yahoo/vespa/hosted/provision/autoscale/AutoscalingTest.java