Skip to main content

ProfileSession

A profiling session: start one or more captures, run work, then export the results. Keep the session alive past any async work a capture covered; synchronize before reading or saving so late worker spans are included.

__init__

__init____init__(self) -> None

init(self) -> None

ProfileSession()

An empty session.

chrome_trace_json

chrome_trace_jsonchrome_trace_json(self) -> str

chrome_trace_json(self) -> str

chrome_trace_json()

Snapshot the current results as a Chrome-tracing JSON string.

perfetto_trace

perfetto_traceperfetto_trace(self) -> bytes

perfetto_trace(self) -> bytes

perfetto_trace()

Snapshot the current results as Perfetto protobuf bytes.

save

savesave(self, dir: str) -> None

save(self, dir: str) -> None

save(dir)

Write the standard set into dir (created if missing): chrome_trace.json, report.json, memory_stats.json, summary.txt.

save_chrome_trace

save_chrome_tracesave_chrome_trace(self, path: str) -> None

save_chrome_trace(self, path: str) -> None

save_chrome_trace(path)

Write the Chrome-tracing timeline JSON to path (open it in chrome://tracing or Perfetto).

save_memory_stats

save_memory_statssave_memory_stats(self, path: str) -> None

save_memory_stats(self, path: str) -> None

save_memory_stats(path)

Write the memory-stats JSON to path.

save_report_json

save_report_jsonsave_report_json(self, path: str) -> None

save_report_json(self, path: str) -> None

save_report_json(path)

Write the full report JSON to path.

start_capture

start_capturestart_capture(self, tag: str = 'default') -> clika_runtime._core.profiler.CaptureScope

start_capture(self, tag: str = 'default') -> clika_runtime._core.profiler.CaptureScope

start_capture(tag='default')

Begin a capture region named tag; returns the CaptureScope that ends it.

summary_text

summary_textsummary_text(self) -> str

summary_text(self) -> str

summary_text()

Snapshot the current results as a per-op text summary.