bundle.perf_report.extractor ============================ .. py:module:: bundle.perf_report.extractor Submodules ---------- .. toctree:: :maxdepth: 1 /autoapi/bundle/perf_report/extractor/cprofile/index /autoapi/bundle/perf_report/extractor/tracy/index Classes ------- .. autoapisummary:: bundle.perf_report.extractor.CProfileData bundle.perf_report.extractor.CProfileExtractor bundle.perf_report.extractor.CProfileRecord bundle.perf_report.extractor.ProfileData bundle.perf_report.extractor.ProfileExtractor bundle.perf_report.extractor.ProfileRecord Package Contents ---------------- .. py:class:: CProfileData All records extracted from one .prof file. .. py:attribute:: prof_path :type: pathlib.Path .. py:attribute:: records :type: list[CProfileRecord] :value: [] .. py:property:: name :type: str .. py:property:: total_calls :type: int .. py:class:: CProfileExtractor Extract profiling data from .prof files produced by cProfile. .. py:method:: extract(prof_path: pathlib.Path) -> CProfileData :staticmethod: Parse a single .prof file and return structured data. .. py:method:: extract_all(directory: pathlib.Path) -> list[CProfileData] :staticmethod: Recursively find and extract all .prof files in a directory. .. py:class:: CProfileRecord A single function entry from a .prof file. .. py:attribute:: file :type: str .. py:attribute:: line_number :type: int .. py:attribute:: function :type: str .. py:attribute:: call_count :type: int .. py:attribute:: total_time :type: float .. py:attribute:: cumulative_time :type: float .. py:class:: ProfileData All zone records extracted from one Tracy CSV file. .. py:attribute:: csv_path :type: pathlib.Path .. py:attribute:: records :type: list[ProfileRecord] :value: [] .. py:property:: name :type: str .. py:property:: total_calls :type: int .. py:class:: ProfileExtractor Extract profiling data from Tracy CSV files produced by tracy-csvexport. .. py:method:: extract(csv_path: pathlib.Path) -> ProfileData :staticmethod: Parse a single Tracy CSV file and return structured data. .. py:method:: extract_from_tracy(tracy_path: pathlib.Path) -> ProfileData :staticmethod: 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. .. py:method:: extract_all(path: pathlib.Path) -> list[ProfileData] :staticmethod: Extract from a .tracy file, a single CSV file, or all CSV files in a directory. .. py:class:: ProfileRecord A single zone entry from a Tracy CSV export (tracy-csvexport). .. py:attribute:: name :type: str .. py:attribute:: src_file :type: str .. py:attribute:: src_line :type: int .. py:attribute:: total_ns :type: int .. py:attribute:: total_perc :type: float .. py:attribute:: counts :type: int .. py:attribute:: mean_ns :type: int .. py:attribute:: min_ns :type: int .. py:attribute:: max_ns :type: int .. py:attribute:: std_ns :type: float