File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change 10
10
TRUNCATED_FRAME = Frame (name = "<Truncated>" )
11
11
12
12
TIME_SLEEP_FRAME = Frame (name = "<Sleep>" )
13
+ LXML_SCHEMA_FRAME = Frame (name = "lxml.etree:XMLSchema:__init__" )
13
14
14
15
15
16
def get_stacks (threads_to_sample , excluded_threads , max_depth ):
@@ -69,14 +70,16 @@ def _extract_stack(stack, max_depth):
69
70
)
70
71
if len (stack ) < max_depth :
71
72
last_frame , last_frame_line_no = stack [- 1 ]
72
- _maybe_append_time_sleep (result , last_frame , last_frame_line_no )
73
+ _maybe_append_synthetic_frame (result , last_frame , last_frame_line_no )
73
74
return result
74
75
75
76
76
- def _maybe_append_time_sleep (result , frame , line_no ):
77
+ def _maybe_append_synthetic_frame (result , frame , line_no ):
77
78
line = linecache .getline (frame .f_code .co_filename , line_no ).strip ()
78
79
if "sleep(" in line :
79
80
result .append (TIME_SLEEP_FRAME )
81
+ elif "etree.XMLSchema(" in line :
82
+ result .append (LXML_SCHEMA_FRAME )
80
83
81
84
82
85
def _extract_frames (end_frame , max_depth ):
You can’t perform that action at this time.
0 commit comments