From 6c353b760184a0b9d58b16fff4987c8c362b62ce Mon Sep 17 00:00:00 2001 From: Colman Date: Thu, 8 Apr 2021 17:58:43 +0100 Subject: [PATCH] Log sampling interval and active millis when cpu limit breached --- codeguru_profiler_agent/profiler_disabler.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/codeguru_profiler_agent/profiler_disabler.py b/codeguru_profiler_agent/profiler_disabler.py index 906ec7c..36c535d 100644 --- a/codeguru_profiler_agent/profiler_disabler.py +++ b/codeguru_profiler_agent/profiler_disabler.py @@ -58,6 +58,7 @@ def is_overall_cpu_usage_limit_reached(self, profile=None): if used_time_percentage >= cpu_limit_percentage: logger.debug(self.timer.metrics) + logger.debug("Profile active seconds since start: {:.2f} s".format(profile.get_active_millis_since_start()/1000)) logger.info( "Profiler overall cpu usage limit reached: {:.2f} % (limit: {:.2f} %), will stop CodeGuru Profiler." .format(used_time_percentage, cpu_limit_percentage)) @@ -78,6 +79,7 @@ def is_sampling_cpu_usage_limit_reached(self, profile=None): if used_time_percentage >= cpu_limit_percentage: logger.debug(self.timer.metrics) + logger.debug("Sampling interval seconds: {:.2f} s".format(sampling_interval_seconds)) logger.info( "Profiler sampling cpu usage limit reached: {:.2f} % (limit: {:.2f} %), will stop CodeGuru Profiler." .format(used_time_percentage, cpu_limit_percentage))