feat: implement performance instrumentation v2#1285
feat: implement performance instrumentation v2#1285aviralgarg05 wants to merge 1 commit intoeigent-ai:mainfrom
Conversation
Wendong-Fan
left a comment
There was a problem hiding this comment.
thanks @aviralgarg05 , could you share a sample PerfTimer output so we can analyze the current performance bottlenecks?
bytecii
left a comment
There was a problem hiding this comment.
Actually we can use the langfuse as exampled in
Here is a sample of the Sample Log Output: Log Structure:
In a full run, you would see entries for:
This structure allows us to pinpoint exactly which phase of the agent lifecycle or backend operation is consuming the most time. |
thanks @aviralgarg05 , could you provide one real result from real task execution instead of this AI-generated sample? |
Related Issue
Closes #911
Description
This PR implements comprehensive performance instrumentation across the Eigent backend and Electron startup process. It introduces a centralized
PerfTimerutility to capture execution durations and log them with context, enabling better bottleneck identification and observability.Key Changes:
backend/app/utils/perf_timer.pyproviding thePerfTimercontext manager and@perf_measuredecorator using standard Python logging.chat_service.py: Instrumented session start, workforce construction, and task decomposition.workforce.py: Instrumented the high-level task decomposition and workforce start logic.single_agent_worker.py: Instrumented overall task processing and specific agent steps.listen_chat_agent.py: Instrumented both synchronous and asynchronous agent steps and tool executions.backend/main.py: Added module load timing.electron/main/init.ts: Instrumented the backend spawn process and health check duration.backend/tests/unit/utils/test_perf_timer.pywith 19 test cases covering sync/async usage and exception handling.What is the purpose of this pull request?
Contribution Guidelines Acknowledgement