> ## Documentation Index
> Fetch the complete documentation index at: https://praison.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Profiler Compat • AI Agents Framework

> ProfilerCompat: Compatibility wrapper for old classmethod-based Profiler usage.

# ProfilerCompat

> Defined in the [**profiler**](../modules/profiler) module.

<Badge color="purple">AI Agents Framework</Badge>

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

<CardGroup cols={2}>
  <Card title="enable()" icon="function" href="../functions/ProfilerCompat-enable">
    Enable profiling.
  </Card>

  <Card title="disable()" icon="function" href="../functions/ProfilerCompat-disable">
    Disable profiling.
  </Card>

  <Card title="is_enabled()" icon="function" href="../functions/ProfilerCompat-is_enabled">
    Check if profiling is enabled.
  </Card>

  <Card title="clear()" icon="function" href="../functions/ProfilerCompat-clear">
    Clear all profiling data.
  </Card>

  <Card title="record_timing()" icon="function" href="../functions/ProfilerCompat-record_timing">
    Record a timing measurement.
  </Card>

  <Card title="record_import()" icon="function" href="../functions/ProfilerCompat-record_import">
    Record an import timing.
  </Card>

  <Card title="record_flow()" icon="function" href="../functions/ProfilerCompat-record_flow">
    Record a flow step.
  </Card>

  <Card title="block()" icon="function" href="../functions/ProfilerCompat-block">
    Context manager for profiling a block of code.
  </Card>

  <Card title="get_timings()" icon="function" href="../functions/ProfilerCompat-get_timings">
    Get timing records.
  </Card>

  <Card title="get_imports()" icon="function" href="../functions/ProfilerCompat-get_imports">
    Get import records.
  </Card>

  <Card title="get_flow()" icon="function" href="../functions/ProfilerCompat-get_flow">
    Get flow records.
  </Card>

  <Card title="get_files_accessed()" icon="function" href="../functions/ProfilerCompat-get_files_accessed">
    Get files accessed.
  </Card>

  <Card title="get_summary()" icon="function" href="../functions/ProfilerCompat-get_summary">
    Get profiling summary.
  </Card>

  <Card title="report()" icon="function" href="../functions/ProfilerCompat-report">
    Generate and output profiling report.
  </Card>

  <Card title="record_api_call()" icon="function" href="../functions/ProfilerCompat-record_api_call">
    Record an API/HTTP call timing.
  </Card>

  <Card title="streaming()" icon="function" href="../functions/ProfilerCompat-streaming">
    Context manager for profiling streaming operations.
  </Card>

  <Card title="streaming_async()" icon="function" href="../functions/ProfilerCompat-streaming_async">
    Async context manager for profiling streaming operations.
  </Card>

  <Card title="api_call()" icon="function" href="../functions/ProfilerCompat-api_call">
    Context manager for profiling API calls.
  </Card>

  <Card title="get_api_calls()" icon="function" href="../functions/ProfilerCompat-get_api_calls">
    Get API call records.
  </Card>

  <Card title="get_streaming_records()" icon="function" href="../functions/ProfilerCompat-get_streaming_records">
    Get streaming records.
  </Card>

  <Card title="get_memory_records()" icon="function" href="../functions/ProfilerCompat-get_memory_records">
    Get memory records.
  </Card>

  <Card title="get_statistics()" icon="function" href="../functions/ProfilerCompat-get_statistics">
    Get timing statistics.
  </Card>

  <Card title="get_flamegraph_data()" icon="function" href="../functions/ProfilerCompat-get_flamegraph_data">
    Get flamegraph-compatible data.
  </Card>

  <Card title="get_line_profile_data()" icon="function" href="../functions/ProfilerCompat-get_line_profile_data">
    Get line-level profiling data.
  </Card>

  <Card title="set_line_profile_data()" icon="function" href="../functions/ProfilerCompat-set_line_profile_data">
    Store line-level profiling output.
  </Card>

  <Card title="record_streaming()" icon="function" href="../functions/ProfilerCompat-record_streaming">
    Record a streaming operation.
  </Card>

  <Card title="record_memory()" icon="function" href="../functions/ProfilerCompat-record_memory">
    Record memory usage.
  </Card>

  <Card title="cprofile()" icon="function" href="../functions/ProfilerCompat-cprofile">
    Context manager for cProfile.
  </Card>

  <Card title="record_cprofile()" icon="function" href="../functions/ProfilerCompat-record_cprofile">
    Store detailed cProfile output on the active profiler.
  </Card>

  <Card title="memory()" icon="function" href="../functions/ProfilerCompat-memory">
    Context manager for memory profiling.
  </Card>

  <Card title="memory_snapshot()" icon="function" href="../functions/ProfilerCompat-memory_snapshot">
    Return current memory snapshot.
  </Card>

  <Card title="export_json()" icon="function" href="../functions/ProfilerCompat-export_json">
    Instance method.
  </Card>

  <Card title="export_html()" icon="function" href="../functions/ProfilerCompat-export_html">
    Instance method.
  </Card>

  <Card title="export_to_file()" icon="function" href="../functions/ProfilerCompat-export_to_file">
    Instance method.
  </Card>

  <Card title="export_flamegraph()" icon="function" href="../functions/ProfilerCompat-export_flamegraph">
    Instance method.
  </Card>
</CardGroup>

## Source

<Card title="View on GitHub" icon="github" href="https://github.com/MervinPraison/PraisonAI/blob/main/src/praisonai/praisonai/profiler.py#L775">
  `praisonai/profiler.py` at line 775
</Card>

***

## Related Documentation

<CardGroup cols={2}>
  <Card title="Agent Profiles" icon="id-card" href="/docs/docs/features/agent-profiles" />

  <Card title="Profiling" icon="chart-line" href="/docs/docs/features/profiling" />
</CardGroup>
