Skip to content

Commit f6c3bb0

Browse files
author
Colman Yau
committed
Flush profile before sampling to avoid profile with skewed data
#15
1 parent ad718c5 commit f6c3bb0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

codeguru_profiler_agent/profiler_runner.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,10 @@ def _run_profiler(self):
8686

8787
# after the refresh we may be working on a profile
8888
if self.is_profiling_in_progress:
89-
sample = self.sampler.sample()
90-
self.collector.add(sample)
9189
if self.collector.flush():
9290
self.is_profiling_in_progress = False
91+
sample = self.sampler.sample()
92+
self.collector.add(sample)
9393
return True
9494

9595
def is_running(self):

0 commit comments

Comments
 (0)