Profiler
provide.testkit.quality.profiling.profiler
¶
Performance profiling implementation using memray and cProfile.
Classes¶
PerformanceProfiler
¶
Performance profiler using memray, cProfile, and tracemalloc.
Provides high-level interface for performance analysis with automatic artifact management and integration with the quality framework.
Initialize performance profiler.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
config
|
dict[str, Any] | None
|
Profiler configuration options |
None
|
Source code in provide/testkit/quality/profiling/profiler.py
Functions¶
generate_report
¶
Generate profiling report.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
result
|
QualityResult
|
Profiling result |
required |
format
|
str
|
Report format |
'terminal'
|
Returns:
| Type | Description |
|---|---|
str
|
Formatted report |
Source code in provide/testkit/quality/profiling/profiler.py
profile_function
¶
Profile a function's performance.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
func
|
Callable[..., Any]
|
Function to profile |
required |
*args
|
Any
|
Function arguments |
()
|
**kwargs
|
Any
|
Function keyword arguments |
{}
|
Returns:
| Type | Description |
|---|---|
QualityResult
|
QualityResult with profiling data |
Source code in provide/testkit/quality/profiling/profiler.py
report
¶
Generate report from QualityResult (implements QualityTool protocol).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
result
|
QualityResult
|
Profiling result |
required |
format
|
str
|
Report format |
'terminal'
|
Returns:
| Type | Description |
|---|---|
str
|
Formatted report |