@@ -91,6 +91,66 @@ describe('target tracking', () => {
91
91
} ) ;
92
92
} ) ;
93
93
94
+ test ( 'test setup target tracking on predefined metric for SAGEMAKER_VARIANT_CONCURRENT_REQUESTS_PER_MODEL_HIGH_RESOLUTION' , ( ) => {
95
+ // GIVEN
96
+ const stack = new cdk . Stack ( ) ;
97
+ const target = createScalableTarget ( stack ) ;
98
+
99
+ // WHEN
100
+ target . scaleToTrackMetric ( 'Tracking' , {
101
+ predefinedMetric : appscaling . PredefinedMetric . SAGEMAKER_VARIANT_CONCURRENT_REQUESTS_PER_MODEL_HIGH_RESOLUTION ,
102
+ targetValue : 0.5 ,
103
+ } ) ;
104
+
105
+ // THEN
106
+ Template . fromStack ( stack ) . hasResourceProperties ( 'AWS::ApplicationAutoScaling::ScalingPolicy' , {
107
+ TargetTrackingScalingPolicyConfiguration : {
108
+ PredefinedMetricSpecification : { PredefinedMetricType : 'SageMakerVariantConcurrentRequestsPerModelHighResolution' } ,
109
+ TargetValue : 0.5 ,
110
+ } ,
111
+ } ) ;
112
+ } ) ;
113
+
114
+ test ( 'test setup target tracking on predefined metric for SAGEMAKER_INFERENCE_COMPONENT_CONCURRENT_REQUESTS_PER_COPY_HIGH_RESOLUTION' , ( ) => {
115
+ // GIVEN
116
+ const stack = new cdk . Stack ( ) ;
117
+ const target = createScalableTarget ( stack ) ;
118
+
119
+ // WHEN
120
+ target . scaleToTrackMetric ( 'Tracking' , {
121
+ predefinedMetric : appscaling . PredefinedMetric . SAGEMAKER_INFERENCE_COMPONENT_CONCURRENT_REQUESTS_PER_COPY_HIGH_RESOLUTION ,
122
+ targetValue : 0.5 ,
123
+ } ) ;
124
+
125
+ // THEN
126
+ Template . fromStack ( stack ) . hasResourceProperties ( 'AWS::ApplicationAutoScaling::ScalingPolicy' , {
127
+ TargetTrackingScalingPolicyConfiguration : {
128
+ PredefinedMetricSpecification : { PredefinedMetricType : 'SageMakerInferenceComponentConcurrentRequestsPerCopyHighResolution' } ,
129
+ TargetValue : 0.5 ,
130
+ } ,
131
+ } ) ;
132
+ } ) ;
133
+
134
+ test ( 'test setup target tracking on predefined metric for WORKSPACES_AVERAGE_USER_SESSIONS_CAPACITY_UTILIZATION' , ( ) => {
135
+ // GIVEN
136
+ const stack = new cdk . Stack ( ) ;
137
+ const target = createScalableTarget ( stack ) ;
138
+
139
+ // WHEN
140
+ target . scaleToTrackMetric ( 'Tracking' , {
141
+ predefinedMetric : appscaling . PredefinedMetric . WORKSPACES_AVERAGE_USER_SESSIONS_CAPACITY_UTILIZATION ,
142
+ targetValue : 0.5 ,
143
+ } ) ;
144
+
145
+ // THEN
146
+ Template . fromStack ( stack ) . hasResourceProperties ( 'AWS::ApplicationAutoScaling::ScalingPolicy' , {
147
+ TargetTrackingScalingPolicyConfiguration : {
148
+ PredefinedMetricSpecification : { PredefinedMetricType : 'WorkSpacesAverageUserSessionsCapacityUtilization' } ,
149
+ TargetValue : 0.5 ,
150
+ } ,
151
+ } ) ;
152
+ } ) ;
153
+
94
154
test ( 'test setup target tracking on custom metric' , ( ) => {
95
155
// GIVEN
96
156
const stack = new cdk . Stack ( ) ;
0 commit comments