diff --git a/codeguru_profiler_agent/sampling_utils.py b/codeguru_profiler_agent/sampling_utils.py index 2fd4f6a..7f47cbc 100644 --- a/codeguru_profiler_agent/sampling_utils.py +++ b/codeguru_profiler_agent/sampling_utils.py @@ -11,6 +11,7 @@ TIME_SLEEP_FRAME = Frame(name="") LXML_SCHEMA_FRAME = Frame(name="lxml.etree:XMLSchema:__init__") +QUEUE_BLOCKING_GET_FRAME = Frame(name="") def get_stacks(threads_to_sample, excluded_threads, max_depth): @@ -78,6 +79,8 @@ def _maybe_append_synthetic_frame(result, frame, line_no): line = linecache.getline(frame.f_code.co_filename, line_no).strip() if "sleep(" in line: result.append(TIME_SLEEP_FRAME) + elif ".get(block=True" in line: + result.append(QUEUE_BLOCKING_GET_FRAME) elif "etree.XMLSchema(" in line: result.append(LXML_SCHEMA_FRAME)