ts_shape.events.profiling.result
Result types of the mapping-free profilers.
:class:ProfileResult holds every table of one profiler run plus a summary
of plain numbers (JSON-able); :class:UnitProfilesResult holds the results
of several profilers run on the same signals (see
:func:ts_shape.events.profiling.units.profile_units).
Classes
| Name | Description |
|---|---|
ProfileResult | Every table of one profiler run and a summary of plain numbers. |
UnitProfilesResult | The results of several profilers on one machine. |
ProfileResult
ProfileResult(
tables: dict[str, pd.DataFrame],
summary: dict[str, Any] = dict(),
kind: str = "profile",
) -> None
Every table of one profiler run and a summary of plain numbers.
Attributes
| Name | Type | Description |
|---|---|---|
tables | dict[str, DataFrame] | Name -> table (one CSV each when saved). |
summary | dict[str, Any] | Plain numbers (counts, seconds, ratios), JSON-able; every profiler includes evaluable and reason. |
kind | str | The profiler ("cycles", "stops", "changeovers" ...). |
Functions
| Name | Description |
|---|---|
save | Write summary.json and one CSV per table into directory. |
load | Read a result written by :meth:save (for dashboards). |
save
save(directory: str | Path) -> list[Path]
Write summary.json and one CSV per table into directory.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
directory | str | Path | Target folder; created when missing. | required |
Returns
| Type | Description |
|---|---|
list[Path] | The written files. |
load
load(directory: str | Path) -> Self
Read a result written by :meth:save (for dashboards).
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
directory | str | Path | Folder written by :meth:save. | required |
Returns
| Type | Description |
|---|---|
Self | The result with its summary and tables. |
UnitProfilesResult
UnitProfilesResult(
results: dict[str, ProfileResult], summary: dict[str, Any] = dict()
) -> None
The results of several profilers on one machine.
Attributes
| Name | Type | Description |
|---|---|---|
results | dict str, [ProfileResult ] | Profiler name ("cycles", "stops" ...) -> result. |
summary | dict[str, Any] | Per profiler: evaluable, reason and its headline numbers (JSON-able). |
Functions
| Name | Description |
|---|---|
save | Write summary.json and one subfolder per profiler. |
load | Read a result written by :meth:save. |
save
save(directory: str | Path) -> list[Path]
Write summary.json and one subfolder per profiler.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
directory | str | Path | Target folder; created when missing. | required |
Returns
| Type | Description |
|---|---|
list[Path] | The written files. |
load
load(directory: str | Path) -> UnitProfilesResult
Read a result written by :meth:save.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
directory | str | Path | Folder written by :meth:save. | required |
Returns
| Type | Description |
|---|---|
UnitProfilesResult | The results of every saved profiler. |