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

# Agent 结合储存的性能分析

> 展示如何分析使用储存的 Agent 的运行时和内存使用情况的示例。

## 代码

```python theme={null}
"""运行 `pip install openai agno` 来安装依赖。"""

from agno.agent import Agent
from agno.eval.performance import PerformanceEval
from agno.models.openai import OpenAIChat


def simple_response():
    agent = Agent(
        model=OpenAIChat(id="gpt-4o-mini"),
        system_message="Be concise, reply with one sentence.",
        add_history_to_messages=True,
    )
    response_1 = agent.run("What is the capital of France?")
    print(response_1.content)
    response_2 = agent.run("How many people live there?")
    print(response_2.content)
    return response_2.content


simple_response_perf = PerformanceEval(
    func=simple_response, num_iterations=1, warmup_runs=0
)

if __name__ == "__main__":
    simple_response_perf.run(print_results=True, print_summary=True)
```
