Profiler Compat • AI Agents Framework
ProfilerCompat: Compatibility wrapper for old classmethod-based Profiler usage.
ProfilerCompat
Defined in the profiler module.
AI Agents Framework
Compatibility wrapper for old classmethod-based Profiler usage.
Delegates all calls to the current profiler instance via get_profiler(). This maintains backward compatibility while enabling per-agent isolation.
Methods
Enable profiling.
disable()Disable profiling.
is_enabled()Check if profiling is enabled.
clear()Clear all profiling data.
record_timing()Record a timing measurement.
record_import()Record an import timing.
record_flow()Record a flow step.
block()Context manager for profiling a block of code.
get_timings()Get timing records.
get_imports()Get import records.
get_flow()Get flow records.
get_files_accessed()Get files accessed.
get_summary()Get profiling summary.
report()Generate and output profiling report.
record_api_call()Record an API/HTTP call timing.
streaming()Context manager for profiling streaming operations.
streaming_async()Async context manager for profiling streaming operations.
api_call()Context manager for profiling API calls.
get_api_calls()Get API call records.
get_streaming_records()Get streaming records.
get_memory_records()Get memory records.
get_statistics()Get timing statistics.
get_flamegraph_data()Get flamegraph-compatible data.
get_line_profile_data()Get line-level profiling data.
set_line_profile_data()Store line-level profiling output.
record_streaming()Record a streaming operation.
record_memory()Record memory usage.
cprofile()Context manager for cProfile.
record_cprofile()Store detailed cProfile output on the active profiler.
memory()Context manager for memory profiling.
memory_snapshot()Return current memory snapshot.
export_json()Instance method.
export_html()Instance method.
export_to_file()Instance method.
export_flamegraph()Instance method.
Source
View on GitHubpraisonai/profiler.py at line 775