Skip to content

feat(cli): add /perf performance monitoring dashboard#22485

Closed
1nonlyasta wants to merge 7 commits intogoogle-gemini:mainfrom
1nonlyasta:feat/perf-dashboard
Closed

feat(cli): add /perf performance monitoring dashboard#22485
1nonlyasta wants to merge 7 commits intogoogle-gemini:mainfrom
1nonlyasta:feat/perf-dashboard

Conversation

@1nonlyasta
Copy link
Copy Markdown

@1nonlyasta 1nonlyasta commented Mar 14, 2026

Summary

Add an in-CLI performance monitoring dashboard accessible via /perf command.

What's included:

  • /perf — overview dashboard (timing, memory, session stats)
  • /perf memory — detailed heap/RSS breakdown with utilization bars
  • /perf tools — per-tool execution table (calls, avg latency, success rate)
  • /perf api — per-model API latency and token usage
  • /perf export — JSON performance report

Files changed:

  • New: perfCommand.ts — slash command with 5 subcommands
  • New: PerfDisplay.tsx — Ink dashboard component with 4 view panels
  • Modified: types.ts — added PerfSnapshot, PERF_DASHBOARD MessageType
  • Modified: HistoryItemDisplay.tsx — wired PerfDisplay rendering
  • Modified: BuiltinCommandLoader.ts — registered /perf command

Context

This aligns with GSoC 2026 Project Idea #5: Performance Monitoring and Optimization Dashboard.

Relates to #21142
Relates to #22403

Implemented a standalone /perf command with dedicated subcommands:
- /perf overview: session stats and memory summary
- /perf memory: detailed heap/RSS utilization
- /perf tools: execution timing and frequency
- /perf api: model latency and token breakdown
- /perf export: session metrics export to JSON

Includes new Sink-based UI components and type definitions.
Relates to google-gemini#21142
Relates to google-gemini#22403
@1nonlyasta 1nonlyasta marked this pull request as ready for review March 15, 2026 10:20
@1nonlyasta 1nonlyasta requested a review from a team as a code owner March 15, 2026 10:20
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request introduces a new performance monitoring dashboard accessible through the /perf command in the CLI. This feature provides users with detailed insights into various aspects of the application's performance, including session duration, memory usage, tool execution times, and API latency. By offering a comprehensive view of these metrics, the dashboard aims to empower users to identify bottlenecks and optimize their CLI experience, aligning with the goal of improving overall application efficiency.

Highlights

  • New /perf Command: Introduced a new CLI command /perf with subcommands (overview, memory, tools, api, export) for comprehensive performance monitoring.
  • Interactive Performance Dashboard: Added PerfDisplay.tsx, an Ink-based React component, to visualize performance metrics in an interactive dashboard within the CLI.
  • Performance Data Structures: Defined new TypeScript types (PerfSnapshot, HistoryItemPerfDashboard, PERF_DASHBOARD MessageType) to structure and manage performance-related data.
  • UI Integration: Integrated the PerfDisplay component into HistoryItemDisplay.tsx to enable rendering of the performance dashboard within the CLI's history view.
  • Command Registration: Registered the new perfCommand within BuiltinCommandLoader.ts to make it available for use in the CLI.
Changelog
  • packages/cli/src/services/BuiltinCommandLoader.ts
    • Imported perfCommand.
    • Registered perfCommand in the list of built-in commands.
  • packages/cli/src/ui/commands/perfCommand.ts
    • Added a new file defining the perfCommand slash command.
    • Implemented collectPerfSnapshot function to gather session performance metrics.
    • Defined subcommands for overview, memory, tools, api, and export of performance data.
  • packages/cli/src/ui/components/HistoryItemDisplay.tsx
    • Imported PerfDisplay component.
    • Added conditional rendering for PerfDisplay when itemForDisplay.type is perf_dashboard.
  • packages/cli/src/ui/components/PerfDisplay.tsx
    • Added a new file defining the PerfDisplay React component.
    • Implemented StatRow, SubStatRow, Section, and ProgressBar reusable components.
    • Created OverviewPanel, MemorySummaryPanel, MemoryDetailPanel, ToolsPerfPanel, and ApiPerfPanel for different dashboard views.
    • Included helper functions for formatting and coloring performance metrics.
  • packages/cli/src/ui/types.ts
    • Defined the PerfSnapshot interface to structure collected performance data.
    • Defined HistoryItemPerfDashboard type for displaying performance dashboard items in history.
    • Added PERF_DASHBOARD to the MessageType enum.
    • Included HistoryItemPerfDashboard in the HistoryItemWithoutId union type.
Activity
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a valuable performance monitoring dashboard accessible via the /perf command. The implementation is well-structured, with new components for displaying performance metrics and a new command to gather and present the data.

My review includes two main points for improvement, both in packages/cli/src/ui/commands/perfCommand.ts:

  1. Refactoring duplicated logic in the command actions to improve maintainability.
  2. Optimizing data aggregation to be more efficient by reducing redundant loops.

These changes will make the new feature more robust and easier to maintain in the future. Overall, this is a great addition to the CLI.

@gemini-cli
Copy link
Copy Markdown
Contributor

gemini-cli bot commented Mar 29, 2026

Hi there! Thank you for your interest in contributing to Gemini CLI.

To ensure we maintain high code quality and focus on our prioritized roadmap, we have updated our contribution policy (see Discussion #17383).

We only guarantee review and consideration of pull requests for issues that are explicitly labeled as 'help wanted'. All other community pull requests are subject to closure after 14 days if they do not align with our current focus areas. For this reason, we strongly recommend that contributors only submit pull requests against issues explicitly labeled as 'help-wanted'.

This pull request is being closed as it has been open for 14 days without a 'help wanted' designation. We encourage you to find and contribute to existing 'help wanted' issues in our backlog! Thank you for your understanding and for being part of our community!

@cocosheng-g
Copy link
Copy Markdown
Contributor

@1nonlyasta, apologies for the bot closing this PR! We have reopened it. Please sync your branch to the latest main and we will have someone review it shortly.

@cocosheng-g
Copy link
Copy Markdown
Contributor

Closing this PR as we have re-evaluated the feature request (#22483). Because it touches core telemetry and API usage statistics, it requires internal maintainer alignment and is not currently open for community contribution. Thank you for your efforts and understanding!

@cocosheng-g cocosheng-g closed this Apr 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants