File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -492,11 +492,14 @@ pub fn stock_level(
492492) -> Result < StockLevelResult , String > {
493493 let _timer = LogStopwatch :: new ( "stock_level" ) ;
494494
495+ let _timer_district = LogStopwatch :: new ( "stock_level_district" ) ;
495496 let district = find_district ( ctx, w_id, d_id) ?;
497+ _timer_district. end ( ) ;
496498 let start_o_id = district. d_next_o_id . saturating_sub ( 20 ) ;
497499 let end_o_id = district. d_next_o_id ;
498500
499501 let mut item_ids = BTreeSet :: new ( ) ;
502+ let _timer_filter = LogStopwatch :: new ( "stock_level_filter" ) ;
500503 for line in ctx
501504 . db
502505 . order_line ( )
@@ -505,14 +508,17 @@ pub fn stock_level(
505508 {
506509 item_ids. insert ( line. ol_i_id ) ;
507510 }
511+ _timer_filter. end ( ) ;
508512
509513 let mut low_stock_count = 0u32 ;
514+ let _timer_count= LogStopwatch :: new ( "stock_level_count" ) ;
510515 for item_id in item_ids {
511516 let stock = find_stock ( ctx, w_id, item_id) ?;
512517 if stock. s_quantity < threshold {
513518 low_stock_count += 1 ;
514519 }
515520 }
521+ _timer_count. end ( ) ;
516522
517523 Ok ( StockLevelResult {
518524 warehouse_id : w_id,
You can’t perform that action at this time.
0 commit comments