@@ -647,57 +647,17 @@ impl<I: InstantWrapper, NowFn: Fn() -> I + Clone + Send + Sync> AwaitedActionDbI
647647 metrics. execution_stage_transitions . add ( 1 , & base_attrs) ;
648648
649649 // Update active count for old stage
650- let old_stage_attrs = match old_stage {
651- ActionStage :: Unknown => vec ! [ opentelemetry:: KeyValue :: new(
652- nativelink_util:: metrics:: EXECUTION_STAGE ,
653- ExecutionStage :: Unknown ,
654- ) ] ,
655- ActionStage :: CacheCheck => vec ! [ opentelemetry:: KeyValue :: new(
656- nativelink_util:: metrics:: EXECUTION_STAGE ,
657- ExecutionStage :: CacheCheck ,
658- ) ] ,
659- ActionStage :: Queued => vec ! [ opentelemetry:: KeyValue :: new(
660- nativelink_util:: metrics:: EXECUTION_STAGE ,
661- ExecutionStage :: Queued ,
662- ) ] ,
663- ActionStage :: Executing => vec ! [ opentelemetry:: KeyValue :: new(
664- nativelink_util:: metrics:: EXECUTION_STAGE ,
665- ExecutionStage :: Executing ,
666- ) ] ,
667- ActionStage :: Completed ( _) | ActionStage :: CompletedFromCache ( _) => {
668- vec ! [ opentelemetry:: KeyValue :: new(
669- nativelink_util:: metrics:: EXECUTION_STAGE ,
670- ExecutionStage :: Completed ,
671- ) ]
672- }
673- } ;
650+ let old_stage_attrs = vec ! [ opentelemetry:: KeyValue :: new(
651+ nativelink_util:: metrics:: EXECUTION_STAGE ,
652+ ExecutionStage :: from( old_stage. clone( ) ) ,
653+ ) ] ;
674654 metrics. execution_active_count . add ( -1 , & old_stage_attrs) ;
675655
676656 // Update active count for new stage
677- let new_stage_attrs = match new_stage {
678- ActionStage :: Unknown => vec ! [ opentelemetry:: KeyValue :: new(
679- nativelink_util:: metrics:: EXECUTION_STAGE ,
680- ExecutionStage :: Unknown ,
681- ) ] ,
682- ActionStage :: CacheCheck => vec ! [ opentelemetry:: KeyValue :: new(
683- nativelink_util:: metrics:: EXECUTION_STAGE ,
684- ExecutionStage :: CacheCheck ,
685- ) ] ,
686- ActionStage :: Queued => vec ! [ opentelemetry:: KeyValue :: new(
687- nativelink_util:: metrics:: EXECUTION_STAGE ,
688- ExecutionStage :: Queued ,
689- ) ] ,
690- ActionStage :: Executing => vec ! [ opentelemetry:: KeyValue :: new(
691- nativelink_util:: metrics:: EXECUTION_STAGE ,
692- ExecutionStage :: Executing ,
693- ) ] ,
694- ActionStage :: Completed ( _) | ActionStage :: CompletedFromCache ( _) => {
695- vec ! [ opentelemetry:: KeyValue :: new(
696- nativelink_util:: metrics:: EXECUTION_STAGE ,
697- ExecutionStage :: Completed ,
698- ) ]
699- }
700- } ;
657+ let new_stage_attrs = vec ! [ opentelemetry:: KeyValue :: new(
658+ nativelink_util:: metrics:: EXECUTION_STAGE ,
659+ ExecutionStage :: from( new_stage. clone( ) ) ,
660+ ) ] ;
701661 metrics. execution_active_count . add ( 1 , & new_stage_attrs) ;
702662
703663 // Record completion metrics
0 commit comments