@@ -130,15 +130,18 @@ def _metric_cumulative_shift(iteration: int) -> tuple[float, float]:
130130 return discount , price
131131
132132
133- def _get_monitor_params_mapping (run_date : datetime , iteration : int = 0 ) -> dict :
133+ def _get_monitor_params_mapping (run_date : datetime , iteration : int = 0 , weekday_morning_count : int = 0 ) -> dict :
134134 # Volume: linear growth with jitter, spike at specific iteration for anomaly
135- if iteration == 37 :
135+ if iteration == 60 :
136136 new_sales = 100
137137 else :
138- new_sales = random .randint (8 , 12 ) # noqa: S311
138+ new_sales = random .randint (5 , 15 ) # noqa: S311
139139
140- # Freshness: update every other iteration, late update for anomaly
141- is_update_suppliers_iter = (iteration % 2 == 0 and iteration != 38 ) or iteration == 39
140+ # Freshness: weekday morning updates with 1-day outage after schedule goes active
141+ is_weekday = run_date .weekday () < 5
142+ is_morning = run_date .hour < 12
143+ is_outage = weekday_morning_count == 21
144+ is_update_suppliers_iter = is_weekday and is_morning and not is_outage
142145
143146 # Metrics: compute deltas for discount and price shifts
144147 curr_discount , curr_price = _metric_cumulative_shift (iteration )
@@ -151,11 +154,11 @@ def _get_monitor_params_mapping(run_date: datetime, iteration: int = 0) -> dict:
151154 "ITERATION_NUMBER" : iteration ,
152155 "RUN_DATE" : run_date ,
153156 "NEW_SALES" : new_sales ,
154- "IS_ADD_CUSTOMER_COL_ITER" : iteration == 29 ,
155- "IS_DELETE_CUSTOMER_COL_ITER" : iteration == 36 ,
156- "IS_UPDATE_PRODUCT_ITER" : not 14 < iteration < 18 ,
157- "IS_CREATE_RETURNS_TABLE_ITER" : iteration == 32 ,
158- "IS_DELETE_CUSTOMER_ITER" : iteration in (18 , 22 , 34 ),
157+ "IS_ADD_CUSTOMER_COL_ITER" : iteration == 47 ,
158+ "IS_DELETE_CUSTOMER_COL_ITER" : iteration == 58 ,
159+ "IS_UPDATE_PRODUCT_ITER" : not 24 < iteration < 28 ,
160+ "IS_CREATE_RETURNS_TABLE_ITER" : iteration == 52 ,
161+ "IS_DELETE_CUSTOMER_ITER" : iteration in (29 , 36 , 55 ),
159162 "IS_UPDATE_SUPPLIERS_ITER" : is_update_suppliers_iter ,
160163 "DISCOUNT_DELTA" : discount_delta ,
161164 "PRICE_DELTA" : price_delta ,
@@ -234,8 +237,8 @@ def run_quick_start_increment(iteration):
234237 setup_cat_tests (iteration )
235238
236239
237- def run_monitor_increment (run_date , iteration ):
238- params_mapping = _get_monitor_params_mapping (run_date , iteration )
240+ def run_monitor_increment (run_date , iteration , weekday_morning_count = 0 ):
241+ params_mapping = _get_monitor_params_mapping (run_date , iteration , weekday_morning_count )
239242 _prepare_connection_to_target_database (params_mapping )
240243
241244 target_db_name = params_mapping ["PROJECT_DB" ]
0 commit comments