feat: add RU V2 fields to slow query and statement for clinic cloud#1890
Merged
Conversation
Issue: pingcap-inc/clinic-ui#651 Surface the RU V2 metrics that clinic backend (PR #1415) added to slow query and statement responses. Visibility is gated by a new ISlowQueryConfig.showRuV2 / IStatementConfig.showRuV2 flag enabled only in tidb-dashboard-for-clinic-cloud, so standalone TiDB dashboard and clinic-op are unaffected. Slow query - New "ru_v2" / "ru_v2_detail" optional columns in the column selector (selectability still gated by available_fields per tier). - Premium: the ru_v2 value is added to the existing Basic info tab. - Starter / Essential: a dedicated "RU V2" tab is inserted between Transaction and Warnings, with three sections: - RU V2: single numeric value - RU V2 Detail: full text, wrap-friendly via <Pre> - RU V2 Metrics: name/value table (no description column) over the RequestUnitV2Metrics struct (22 sub-fields). Per-tier routing is driven by available_fields schema, not data. Statement - New avg_ru_v2 / sum_ru_v2 columns and avg_ru_v2 / sum_ru_v2 / max_ru_v2 / sum_ru rows in the Basic info detail tab. Types - src/client/clinic-extensions.d.ts adds the new fields via module augmentation on @lib/client. This keeps the generated models.ts untouched, so a future `make generate_swagger_spec` run will not overwrite our additions. Dashboard Go models are intentionally unchanged.
shhdgit
approved these changes
May 22, 2026
Contributor
[LGTM Timeline notifier]Timeline:
|
Contributor
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: shhdgit The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What's Changed
Surface the RU V2 metrics that clinic backend (clinic#1415) added to slow query and statement responses. Visibility is gated by a new `ISlowQueryConfig.showRuV2` / `IStatementConfig.showRuV2` flag, enabled only in `tidb-dashboard-for-clinic-cloud`. Standalone TiDB dashboard (`for-op`) and clinic on-prem (`for-clinic-op`) are unaffected.
For pingcap-inc/clinic-ui#651.
Slow query
Per-tier routing is driven by the `available_fields` schema rather than the data value, so the Basic-tab row and the dedicated tab never appear together for the same row.
Statement
Types
Test Plan