@@ -72,12 +72,11 @@ def _profiling_command(self):
7272 self .collector .setup ()
7373 self ._first_execution = False
7474 sample_result = self ._run_profiler ()
75- if sample_result .success and sample_result .should_check_overall :
75+ if sample_result .success and sample_result .is_end_of_cycle :
7676 if self .profiler_disabler .should_stop_profiling (profile = self .collector .profile ):
7777 return False
78- if sample_result .should_reset :
79- self .collector .reset ()
80- return True
78+ self .collector .reset ()
79+ return True
8180 return sample_result .success
8281 except :
8382 logger .info ("An unexpected issue caused the profiling command to terminate." , exc_info = True )
@@ -86,20 +85,18 @@ def _profiling_command(self):
8685 @with_timer ("runProfiler" )
8786 def _run_profiler (self ):
8887 if self .profiler_disabler .should_stop_sampling (self .collector .profile ):
89- return RunProfilerStatus (success = False , should_check_overall = False , should_reset = False )
88+ return RunProfilerStatus (success = False , is_end_of_cycle = False )
9089
91- refreshed_config = False
9290 if not self .is_profiling_in_progress :
9391 self ._refresh_configuration ()
94- refreshed_config = True
9592
9693 # after the refresh we may be working on a profile
9794 if self .is_profiling_in_progress :
9895 if self .collector .flush (reset = False ):
9996 self .is_profiling_in_progress = False
100- return RunProfilerStatus (success = True , should_check_overall = True , should_reset = True )
97+ return RunProfilerStatus (success = True , is_end_of_cycle = True )
10198 self ._sample_and_aggregate ()
102- return RunProfilerStatus (success = True , should_check_overall = refreshed_config , should_reset = False )
99+ return RunProfilerStatus (success = True , is_end_of_cycle = False )
103100
104101 @with_timer ("sampleAndAggregate" )
105102 def _sample_and_aggregate (self ):
@@ -141,7 +138,6 @@ def pause(self, block=False):
141138
142139
143140class RunProfilerStatus :
144- def __init__ (self , success , should_check_overall , should_reset ):
141+ def __init__ (self , success , is_end_of_cycle ):
145142 self .success = success
146- self .should_check_overall = should_check_overall
147- self .should_reset = should_reset
143+ self .is_end_of_cycle = is_end_of_cycle
0 commit comments