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();
}
Aggregations