use of com.netflix.titus.api.appscale.model.CustomizedMetricSpecification in project titus-control-plane by Netflix.
the class AutoScalingPolicyTests method buildTargetTrackingPolicy.
public static AutoScalingPolicy buildTargetTrackingPolicy(String jobId) {
CustomizedMetricSpecification customizedMetricSpec = CustomizedMetricSpecification.newBuilder().withNamespace("foobar").withNamespace("NFLX/EPIC").withStatistic(Statistic.Sum).withUnit("Seconds").build();
TargetTrackingPolicy targetTrackingPolicy = TargetTrackingPolicy.newBuilder().withDisableScaleIn(false).withScaleInCooldownSec(10).withScaleOutCooldownSec(5).withCustomizedMetricSpecification(customizedMetricSpec).build();
PolicyConfiguration policyConfiguration = PolicyConfiguration.newBuilder().withTargetTrackingPolicy(targetTrackingPolicy).withPolicyType(PolicyType.TargetTrackingScaling).build();
AutoScalingPolicy autoScalingPolicy = AutoScalingPolicy.newBuilder().withPolicyConfiguration(policyConfiguration).withStatus(PolicyStatus.Pending).withStatusMessage("ICE-ed by AWS").withJobId(jobId).build();
return autoScalingPolicy;
}
Aggregations