Search in sources :

Example 1 with CustomizedMetricSpecification

use of com.netflix.titus.grpc.protogen.CustomizedMetricSpecification in project titus-control-plane by Netflix.

the class AutoScalingTestUtils method generateTargetPolicy.

public static ScalingPolicy generateTargetPolicy() {
    CustomizedMetricSpecification customizedMetricSpec = CustomizedMetricSpecification.newBuilder().addDimensions(MetricDimension.newBuilder().setName("testName").setValue("testValue").build()).setMetricName("testMetric").setNamespace("NFLX/EPIC").setStatistic(AlarmConfiguration.Statistic.Sum).setMetricName("peanuts").build();
    TargetTrackingPolicyDescriptor targetTrackingPolicyDescriptor = TargetTrackingPolicyDescriptor.newBuilder().setTargetValue(DoubleValue.newBuilder().setValue(ThreadLocalRandom.current().nextDouble()).build()).setScaleInCooldownSec(Int32Value.newBuilder().setValue(ThreadLocalRandom.current().nextInt()).build()).setScaleOutCooldownSec(Int32Value.newBuilder().setValue(ThreadLocalRandom.current().nextInt()).build()).setDisableScaleIn(BoolValue.newBuilder().setValue(false).build()).setCustomizedMetricSpecification(customizedMetricSpec).build();
    return ScalingPolicy.newBuilder().setTargetPolicyDescriptor(targetTrackingPolicyDescriptor).build();
}
Also used : CustomizedMetricSpecification(com.netflix.titus.grpc.protogen.CustomizedMetricSpecification) TargetTrackingPolicyDescriptor(com.netflix.titus.grpc.protogen.TargetTrackingPolicyDescriptor)

Aggregations

CustomizedMetricSpecification (com.netflix.titus.grpc.protogen.CustomizedMetricSpecification)1 TargetTrackingPolicyDescriptor (com.netflix.titus.grpc.protogen.TargetTrackingPolicyDescriptor)1