@@ -25,6 +25,7 @@ def __init__(
25
25
self .id = id
26
26
self .parent_ids = parent_ids or []
27
27
self .hsv = hsv
28
+ self .has_subfuncs = False
28
29
29
30
def parent_classes (self ):
30
31
return self .parent_classes
@@ -128,6 +129,21 @@ def cumtime_per_call(self):
128
129
def indent (self ):
129
130
return 16 * self .depth
130
131
132
+ def serialize (self ):
133
+ return {
134
+ "has_subfuncs" : self .has_subfuncs ,
135
+ "id" : self .id ,
136
+ "parent_ids" : self .parent_ids ,
137
+ "is_project_func" : self .is_project_func (),
138
+ "indent" : self .indent (),
139
+ "func_std_string" : self .func_std_string (),
140
+ "cumtime" : self .cumtime (),
141
+ "cumtime_per_call" : self .cumtime_per_call (),
142
+ "tottime" : self .tottime (),
143
+ "tottime_per_call" : self .tottime_per_call (),
144
+ "count" : self .count (),
145
+ }
146
+
131
147
132
148
class ProfilingPanel (Panel ):
133
149
"""
@@ -145,7 +161,6 @@ def process_request(self, request):
145
161
146
162
def add_node (self , func_list , func , max_depth , cum_time ):
147
163
func_list .append (func )
148
- func .has_subfuncs = False
149
164
if func .depth < max_depth :
150
165
for subfunc in func .subfuncs ():
151
166
# Always include the user's code
@@ -179,4 +194,4 @@ def generate_stats(self, request, response):
179
194
dt_settings .get_config ()["PROFILER_MAX_DEPTH" ],
180
195
cum_time_threshold ,
181
196
)
182
- self .record_stats ({"func_list" : func_list })
197
+ self .record_stats ({"func_list" : [ func . serialize () for func in func_list ] })
0 commit comments