On this page
pstats.StatsProfile
Prev: pstats.Stats | Up: pstats
Rel: pstats.FunctionProfile, pstats.SortKey, pstats.Stats
Ref: docs.python.org — pstats.StatsProfile
Tags: #public #python3 #stdlib #pstats
Import
import pstats
from pstats import StatsProfile
Signature & Overview
pstats.StatsProfile(total_tt: float, func_profiles: dict[str, pstats.FunctionProfile]) -> None
Class for keeping track of an item in inventory.
Usage
import cProfile, pstats
with cProfile.Profile() as pr:
_ = sum(range(100))
sp = pstats.Stats(pr).get_stats_profile()
assert sp.total_tt >= 0.0 and isinstance(sp.func_profiles, dict)
Gotchas
- Programmatic alternative to parsing
print_stats()text.
REPL Inspect
from pstats import StatsProfile
help(StatsProfile)
Linked from
Related notes
- tuts/python3/stdlib_module/pstats/FunctionProfile Linked here; links to this page; shared tags: #pstats, #stdlib
- tuts/python3/stdlib_module/pstats/SortKey Linked here; links to this page; shared tags: #pstats, #stdlib
- tuts/python3/stdlib_module/pstats/Stats Linked here; links to this page; shared tags: #pstats, #stdlib
- tuts/python3/stdlib_module/pstats Linked here; links to this page; shared tags: #stdlib
- tuts/c/stdlib shared tags: #stdlib
- tuts/c/stdlib/assert shared tags: #stdlib
- tuts/c/stdlib/assert/assert shared tags: #stdlib
- tuts/c/stdlib/assert/static_assert shared tags: #stdlib
- tuts/c/stdlib/ctype shared tags: #stdlib
- tuts/c/stdlib/ctype/isalpha shared tags: #stdlib