Skip to main content

ClikaRT::ProfileSession

class

Header: ClikaRT/profiler/profiler.h

A profiling session: start one or more captures, then export the results. Move-only. The session must outlive any in-flight async work it captured (workers that finish after a capture ends still record into it).

Nested types

NameDescription
CaptureScopeRAII capture handle. While alive, work on the constructing thread (and its live streams) is profiled into the parent session. End the capture by letting this go out of scope. Move-only; keep it alive for the region you want timed.

Member functions

ProfileSession()

ProfileSession()

An empty session.

Declared in ClikaRT/profiler/profiler.h, line 118

ProfileSession(ProfileSession)

ProfileSession(ProfileSession&&) noexcept

Move-only: transfers the session.

Declared in ClikaRT/profiler/profiler.h, line 120

operator=()

ProfileSession& operator=(ProfileSession&&) noexcept

Move-assign: transfers the session.

Declared in ClikaRT/profiler/profiler.h, line 122

~ProfileSession()

~ProfileSession()

Releases the session and its recorded data.

Declared in ClikaRT/profiler/profiler.h, line 124

start_capture()

CaptureScope start_capture(std::string_view tag = "default")

Begin a capture region. tag names it in the trace. Equivalent to keeping the returned handle alive for the region you want profiled.

Declared in ClikaRT/profiler/profiler.h, line 151

save()

void save(std::string_view dir) const

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

Declared in ClikaRT/profiler/profiler.h, line 156

save_chrome_trace()

void save_chrome_trace(std::string_view path) const

Write just the Chrome-tracing timeline JSON to path.

Declared in ClikaRT/profiler/profiler.h, line 159

save_report_json()

void save_report_json(std::string_view path) const

Write the full report JSON to path.

Declared in ClikaRT/profiler/profiler.h, line 162

save_memory_stats()

void save_memory_stats(std::string_view path) const

Write the memory-stats JSON to path.

Declared in ClikaRT/profiler/profiler.h, line 165

chrome_trace_json()

std::string chrome_trace_json() const

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

Declared in ClikaRT/profiler/profiler.h, line 168

summary_text()

std::string summary_text() const

Snapshot the current results as a human-readable per-op summary.

Declared in ClikaRT/profiler/profiler.h, line 170

summary()

ProfileSummary summary() const

Snapshot the current results as plain counters: the typed form of summary_text() (see ProfileSummary). Never fails; an empty session reads as zeros.

Declared in ClikaRT/profiler/profiler.h, line 174

perfetto_trace()

std::string perfetto_trace() const

Snapshot the current results as a Perfetto protobuf trace (raw bytes).

Declared in ClikaRT/profiler/profiler.h, line 176