@@ -72,12 +72,11 @@ def _profiling_command(self):
72
72
self .collector .setup ()
73
73
self ._first_execution = False
74
74
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 :
76
76
if self .profiler_disabler .should_stop_profiling (profile = self .collector .profile ):
77
77
return False
78
- if sample_result .should_reset :
79
- self .collector .reset ()
80
- return True
78
+ self .collector .reset ()
79
+ return True
81
80
return sample_result .success
82
81
except :
83
82
logger .info ("An unexpected issue caused the profiling command to terminate." , exc_info = True )
@@ -86,20 +85,18 @@ def _profiling_command(self):
86
85
@with_timer ("runProfiler" )
87
86
def _run_profiler (self ):
88
87
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 )
90
89
91
- refreshed_config = False
92
90
if not self .is_profiling_in_progress :
93
91
self ._refresh_configuration ()
94
- refreshed_config = True
95
92
96
93
# after the refresh we may be working on a profile
97
94
if self .is_profiling_in_progress :
98
95
if self .collector .flush (reset = False ):
99
96
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 )
101
98
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 )
103
100
104
101
@with_timer ("sampleAndAggregate" )
105
102
def _sample_and_aggregate (self ):
@@ -141,7 +138,6 @@ def pause(self, block=False):
141
138
142
139
143
140
class RunProfilerStatus :
144
- def __init__ (self , success , should_check_overall , should_reset ):
141
+ def __init__ (self , success , is_end_of_cycle ):
145
142
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