@@ -83,8 +83,22 @@ func TestConcurrencyAutoScaler(t *testing.T) {
83
83
{
84
84
"just enough pollers" ,
85
85
[]* shared.AutoConfigHint {
86
- {common .PtrOf (true ), common .PtrOf (int64 (15 ))}, // <- tick, in cool down
87
- {common .PtrOf (true ), common .PtrOf (int64 (15 ))}, // <- tick, no update
86
+ {common .PtrOf (true ), common .PtrOf (int64 (16 ))}, // <- tick, in cool down
87
+ {common .PtrOf (true ), common .PtrOf (int64 (16 ))}, // <- tick, no update
88
+ },
89
+ []eventLog {
90
+ {autoScalerEventStart , false , 100 , "00:00:00" },
91
+ {autoScalerEventEnable , true , 100 , "00:00:00" },
92
+ {autoScalerEventPollerSkipUpdateCooldown , true , 100 , "00:00:01" },
93
+ {autoScalerEventPollerSkipUpdateNoChange , true , 100 , "00:00:02" },
94
+ {autoScalerEventStop , true , 100 , "00:00:02" },
95
+ },
96
+ },
97
+ {
98
+ "poller slightly idle but no change" ,
99
+ []* shared.AutoConfigHint {
100
+ {common .PtrOf (true ), common .PtrOf (int64 (100 ))}, // <- tick, in cool down
101
+ {common .PtrOf (true ), common .PtrOf (int64 (100 ))}, // <- tick, no update
88
102
},
89
103
[]eventLog {
90
104
{autoScalerEventStart , false , 100 , "00:00:00" },
@@ -125,22 +139,22 @@ func TestConcurrencyAutoScaler(t *testing.T) {
125
139
{
126
140
"idl pollers waiting for tasks" ,
127
141
[]* shared.AutoConfigHint {
128
- {common .PtrOf (true ), common .PtrOf (int64 (100 ))}, // <- tick, in cool down
129
- {common .PtrOf (true ), common .PtrOf (int64 (100 ))}, // <- tick, scale up
142
+ {common .PtrOf (true ), common .PtrOf (int64 (1000 ))}, // <- tick, in cool down
143
+ {common .PtrOf (true ), common .PtrOf (int64 (1000 ))}, // <- tick, scale up
130
144
},
131
145
[]eventLog {
132
146
{autoScalerEventStart , false , 100 , "00:00:00" },
133
147
{autoScalerEventEnable , true , 100 , "00:00:00" },
134
148
{autoScalerEventPollerSkipUpdateCooldown , true , 100 , "00:00:01" },
135
- {autoScalerEventPollerUpdate , true , 60 , "00:00:02" },
136
- {autoScalerEventStop , true , 60 , "00:00:02" },
149
+ {autoScalerEventPollerUpdate , true , 80 , "00:00:02" },
150
+ {autoScalerEventStop , true , 80 , "00:00:02" },
137
151
},
138
152
},
139
153
{
140
154
"idl pollers, scale down to minimum" ,
141
155
[]* shared.AutoConfigHint {
142
- {common .PtrOf (true ), common .PtrOf (int64 (10000 ))}, // <- tick, in cool down
143
- {common .PtrOf (true ), common .PtrOf (int64 (10000 ))}, // <- tick, scale up
156
+ {common .PtrOf (true ), common .PtrOf (int64 (60000 ))}, // <- tick, in cool down
157
+ {common .PtrOf (true ), common .PtrOf (int64 (60000 ))}, // <- tick, scale up
144
158
},
145
159
[]eventLog {
146
160
{autoScalerEventStart , false , 100 , "00:00:00" },
@@ -166,15 +180,15 @@ func TestConcurrencyAutoScaler(t *testing.T) {
166
180
{
167
181
"idl pollers but disabled scaling at a later time" ,
168
182
[]* shared.AutoConfigHint {
169
- {common .PtrOf (true ), common .PtrOf (int64 (100 ))}, // <- tick, in cool down
170
- {common .PtrOf (true ), common .PtrOf (int64 (100 ))}, // <- tick, scale up
171
- {common .PtrOf (false ), common .PtrOf (int64 (100 ))}, // <- disable
183
+ {common .PtrOf (true ), common .PtrOf (int64 (1000 ))}, // <- tick, in cool down
184
+ {common .PtrOf (true ), common .PtrOf (int64 (1000 ))}, // <- tick, scale up
185
+ {common .PtrOf (false ), common .PtrOf (int64 (1000 ))}, // <- disable
172
186
},
173
187
[]eventLog {
174
188
{autoScalerEventStart , false , 100 , "00:00:00" },
175
189
{autoScalerEventEnable , true , 100 , "00:00:00" },
176
190
{autoScalerEventPollerSkipUpdateCooldown , true , 100 , "00:00:01" },
177
- {autoScalerEventPollerUpdate , true , 60 , "00:00:02" },
191
+ {autoScalerEventPollerUpdate , true , 80 , "00:00:02" },
178
192
{autoScalerEventDisable , false , 100 , "00:00:02" },
179
193
{autoScalerEventPollerSkipUpdateNotEnabled , false , 100 , "00:00:03" },
180
194
{autoScalerEventStop , false , 100 , "00:00:03" },
@@ -183,17 +197,17 @@ func TestConcurrencyAutoScaler(t *testing.T) {
183
197
{
184
198
"idl pollers and enabled at a later time" ,
185
199
[]* shared.AutoConfigHint {
186
- {common .PtrOf (false ), common .PtrOf (int64 (100 ))}, // <- tick, in cool down
187
- {common .PtrOf (false ), common .PtrOf (int64 (100 ))}, // <- tick, not enabled
188
- {common .PtrOf (true ), common .PtrOf (int64 (100 ))}, // <- tick, enable scale up
200
+ {common .PtrOf (false ), common .PtrOf (int64 (1000 ))}, // <- tick, in cool down
201
+ {common .PtrOf (false ), common .PtrOf (int64 (1000 ))}, // <- tick, not enabled
202
+ {common .PtrOf (true ), common .PtrOf (int64 (1000 ))}, // <- tick, enable scale up
189
203
},
190
204
[]eventLog {
191
205
{autoScalerEventStart , false , 100 , "00:00:00" },
192
206
{autoScalerEventPollerSkipUpdateNotEnabled , false , 100 , "00:00:01" },
193
207
{autoScalerEventPollerSkipUpdateNotEnabled , false , 100 , "00:00:02" },
194
208
{autoScalerEventEnable , true , 100 , "00:00:02" },
195
- {autoScalerEventPollerUpdate , true , 60 , "00:00:03" },
196
- {autoScalerEventStop , true , 60 , "00:00:03" },
209
+ {autoScalerEventPollerUpdate , true , 80 , "00:00:03" },
210
+ {autoScalerEventStop , true , 80 , "00:00:03" },
197
211
},
198
212
},
199
213
} {
0 commit comments