Android Performance Analyzer includes agentic capabilities that let your agent interact directly with the trace view and query the data it contains.
Agent tools
The tool support in Android Performance Analyzer gives agents the following capabilities:
- Read the trace view. The agent can see exactly what you see in the trace view pane: visible time range, selected slices, pinned tracks, visible tracks, bookmarks, and highlights.
- Query the trace. The agent has full access to all of the data collected in the trace and the ability to run whatever queries are needed.
- Update the trace view. The agent can pan and zoom the trace view, pin or unpin tracks, select slices and time ranges, and place bookmarks according to your instructions.
Open the agent panel
To open the agent panel, do one of the following:
- Click the
Agent
button from the sidebar. - Select View > Tool Windows > Agent from the menu bar.
- Click the
Ask AI button from your trace view.
The agent panel works the same as the agent panel in Android Studio.
Bring your own agent
In addition to Google Antigravity, Android Performance Analyzer also supports Bring Your Own Agent (BYOA). Select an agent from the Agents menu, or select Configure Agents to see the Agent Marketplace.
When you've selected an agent, follow the instructions to authenticate and connect your account.
Agentic performance analysis
The agentic integrations give you powerful, flexible tools to interact with your traces using natural language. Here are some examples to demonstrate a few of the ways your agent can streamline your analysis.
Find and pin threads
Prompt: Pin the app's main thread.
The agent queries the trace, locates the thread designated as the main thread, and pins it directly in the trace view.
Apply highlights and bookmarks
Prompt: Highlight the time range of the bindApplication slice, then put
bookmarks at the start and end of that slice.
The agent queries the trace to find the requested slice, highlights and selects its time range, and places bookmarks as requested.
Find long-rendering frames
Prompt: Find the frame with the longest render time.
The agent queries the trace to identify the frame with the longest render time.
It then produces a breakdown of the time spent on the frame, and it centers and
selects the corresponding Choreographer#doFrame slice for easier inspection.