MCPcopy Create free account
hub / github.com/nodejs/node / process_trace

Function process_trace

deps/v8/tools/generate-runtime-call-stats.py:138–157  ·  view source on GitHub ↗
(trace_file)

Source from the content-addressed store, hash-verified

136
137
138def process_trace(trace_file):
139 text_string = pathlib.Path(trace_file).read_text()
140 result = json.loads(text_string)
141
142 output = {}
143 result = result["traceEvents"]
144 for o in result:
145 o = o["args"]
146 if "runtime-call-stats" in o:
147 r = o["runtime-call-stats"]
148 for name in r:
149 count = r[name][0]
150 duration = r[name][1]
151 if name in output:
152 output[name]["count"] += count
153 output[name]["duration"] += duration
154 else:
155 output[name] = {"count": count, "duration": duration}
156
157 return output
158
159
160def run_benchmark(story,

Callers 1

collect_bucketsFunction · 0.70

Calls 1

PathMethod · 0.45

Tested by

no test coverage detected