bundle.perf_report.extractor

Submodules

Classes

CProfileData

All records extracted from one .prof file.

CProfileExtractor

Extract profiling data from .prof files produced by cProfile.

CProfileRecord

A single function entry from a .prof file.

ProfileData

All zone records extracted from one Tracy CSV file.

ProfileExtractor

Extract profiling data from Tracy CSV files produced by tracy-csvexport.

ProfileRecord

A single zone entry from a Tracy CSV export (tracy-csvexport).

Package Contents

class bundle.perf_report.extractor.CProfileData[source]

All records extracted from one .prof file.

prof_path: pathlib.Path
records: list[CProfileRecord] = []
property name: str
property total_calls: int
class bundle.perf_report.extractor.CProfileExtractor[source]

Extract profiling data from .prof files produced by cProfile.

static extract(prof_path: pathlib.Path) CProfileData[source]

Parse a single .prof file and return structured data.

static extract_all(directory: pathlib.Path) list[CProfileData][source]

Recursively find and extract all .prof files in a directory.

class bundle.perf_report.extractor.CProfileRecord[source]

A single function entry from a .prof file.

file: str
line_number: int
function: str
call_count: int
total_time: float
cumulative_time: float
class bundle.perf_report.extractor.ProfileData[source]

All zone records extracted from one Tracy CSV file.

csv_path: pathlib.Path
records: list[ProfileRecord] = []
property name: str
property total_calls: int
class bundle.perf_report.extractor.ProfileExtractor[source]

Extract profiling data from Tracy CSV files produced by tracy-csvexport.

static extract(csv_path: pathlib.Path) ProfileData[source]

Parse a single Tracy CSV file and return structured data.

static extract_from_tracy(tracy_path: pathlib.Path) ProfileData[source]

Run tracy-csvexport on a .tracy file, save a sibling .csv, and return ProfileData.

Requires tracy-csvexport to be on PATH (built via: bundle tracy build csvexport). The CSV is saved alongside the .tracy file so it can be reused without re-exporting.

static extract_all(path: pathlib.Path) list[ProfileData][source]

Extract from a .tracy file, a single CSV file, or all CSV files in a directory.

class bundle.perf_report.extractor.ProfileRecord[source]

A single zone entry from a Tracy CSV export (tracy-csvexport).

name: str
src_file: str
src_line: int
total_ns: int
total_perc: float
counts: int
mean_ns: int
min_ns: int
max_ns: int
std_ns: float