How olaf-zero/perf-profiler works
Perf-profiler is a small Python profiling library. Users wrap code in Profiler.measure, which records successful execution durations; they then print summary statistics or generate a plot. The source shows timing, in-memory records, warmup filtering, statistics, plotting, and custom exceptions. There is no persistent store or broader service workflow. Relationships below are limited to calls visible in the sampled core and package exports.
Main entry points: core.py Profiler API · __init__.py Public exports · exceptions.py Profiler exceptions
Components 11
Measurement
- Profiler API
src/profiler/core.py - Timed recording
src/profiler/core.py - In-memory records
src/profiler/core.py
Analysis and output
- Session and warmup filtering
src/profiler/core.py - Summary statistics
src/profiler/core.py - Terminal report
src/profiler/core.py - Plot generation
src/profiler/core.py - Plot styling
src/profiler/core.py - Profiler exceptions
src/profiler/exceptions.py
Other components
- Library user
- Public exports
src/profiler/__init__.py
Connections 15
- Library user → Profiler API: uses
README.md - Profiler API → Timed recording: provides
src/profiler/core.py - Timed recording → In-memory records: appends durations
src/profiler/core.py - Profiler API → Session and warmup filtering: filters sessions
src/profiler/core.py - Session and warmup filtering → In-memory records: reads records
src/profiler/core.py - Profiler API → Summary statistics: calculates
src/profiler/core.py - Profiler API → Terminal report: prints
src/profiler/core.py - Terminal report → Session and warmup filtering: gets valid records
src/profiler/core.py - Terminal report → Summary statistics: gets metrics
src/profiler/core.py - Profiler API → Plot generation: generates
src/profiler/core.py - Plot generation → Session and warmup filtering: selects records
src/profiler/core.py - Plot generation → Plot styling: applies style
src/profiler/core.py - Profiler API → Profiler exceptions: raises
src/profiler/core.py - Public exports → Profiler API: exports
src/profiler/__init__.py - Public exports → Profiler exceptions: exports
src/profiler/__init__.py