Search in sources :

Example 1 with CustomizedMetricSpecification

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;
}
Also used : TargetTrackingPolicy(com.netflix.titus.api.appscale.model.TargetTrackingPolicy) AutoScalingPolicy(com.netflix.titus.api.appscale.model.AutoScalingPolicy) CustomizedMetricSpecification(com.netflix.titus.api.appscale.model.CustomizedMetricSpecification) StepScalingPolicyConfiguration(com.netflix.titus.api.appscale.model.StepScalingPolicyConfiguration) PolicyConfiguration(com.netflix.titus.api.appscale.model.PolicyConfiguration)

Aggregations

AutoScalingPolicy (com.netflix.titus.api.appscale.model.AutoScalingPolicy)1 CustomizedMetricSpecification (com.netflix.titus.api.appscale.model.CustomizedMetricSpecification)1 PolicyConfiguration (com.netflix.titus.api.appscale.model.PolicyConfiguration)1 StepScalingPolicyConfiguration (com.netflix.titus.api.appscale.model.StepScalingPolicyConfiguration)1 TargetTrackingPolicy (com.netflix.titus.api.appscale.model.TargetTrackingPolicy)1