@@ -157,7 +157,11 @@ def _execute_one_interval(
157157 cur_index += 1
158158 except KafkaError :
159159 logger .warning (KafkaError )
160- time .sleep (1.0 / msg_per_sec )
160+
161+ if msg_per_sec > 0 :
162+ time .sleep (1.0 / msg_per_sec )
163+ else :
164+ time .sleep (1.0 )
161165
162166 logger .warning (f"Finish interval with { msg_per_sec } msg/s" )
163167 return cur_index
@@ -254,7 +258,7 @@ def execute(self):
254258class MaximumThroughputTest (LongTermTest ):
255259 """Keeps a consistent rate that is too high to be handled."""
256260
257- def __init__ (self , length_in_min : float | int , msg_per_sec : int = 10000 ):
261+ def __init__ (self , length_in_min : float | int , msg_per_sec : int = 500 ):
258262 super ().__init__ (full_length_in_min = length_in_min , msg_per_sec = msg_per_sec )
259263
260264
@@ -263,24 +267,24 @@ def main(test_type_nr):
263267 match test_type_nr :
264268 case 1 :
265269 ramp_up_test = RampUpTest (
266- msg_per_sec_in_intervals = [1 , 10 , 50 , 100 , 150 , 200 ],
267- interval_length_in_sec = [30 , 30 , 30 , 30 , 30 , 30 ],
270+ msg_per_sec_in_intervals = [10 , 50 , 100 , 150 ],
271+ interval_length_in_sec = [120 , 120 , 120 , 120 ],
268272 )
269273 ramp_up_test .execute ()
270274
271275 case 2 :
272276 burst_test = BurstTest (
273- normal_rate_msg_per_sec = 20 ,
274- burst_rate_msg_per_sec = 10000 ,
275- normal_rate_interval_length = 10 ,
277+ normal_rate_msg_per_sec = 50 ,
278+ burst_rate_msg_per_sec = 1000 ,
279+ normal_rate_interval_length = 120 ,
276280 burst_rate_interval_length = 2 ,
277281 number_of_intervals = 3 ,
278282 )
279283 burst_test .execute ()
280284
281285 case 3 :
282286 maximum_throughput_test = MaximumThroughputTest (
283- length_in_min = 1 ,
287+ length_in_min = 5 ,
284288 )
285289 maximum_throughput_test .execute ()
286290
@@ -302,4 +306,4 @@ def main(test_type_nr):
302306 3 - Maximum throughput test
303307 4 - Long-term test
304308 """
305- main (1 )
309+ main (3 )
0 commit comments