From 9043eb7b0a0bb7c174d8b8948846418fc3588a64 Mon Sep 17 00:00:00 2001 From: Kyle Wong Date: Mon, 24 Jun 2024 20:58:03 +0000 Subject: [PATCH 1/2] ui: fix database index usage page error For serverless customers, the database index usage page was broken and wouldn't load. This was occuring due to the expectation of region data in the `AggregationStatistics.stats` field which wasn't properly being set. Now, region data is correctly being set in `AggregationStatistics.stats` Fixes: #126037 Release note: None --- pkg/ui/workspaces/cluster-ui/src/api/statementsApi.ts | 2 ++ pkg/ui/workspaces/cluster-ui/src/api/testUtils.tsx | 2 ++ 2 files changed, 4 insertions(+) diff --git a/pkg/ui/workspaces/cluster-ui/src/api/statementsApi.ts b/pkg/ui/workspaces/cluster-ui/src/api/statementsApi.ts index 05f9c99ff401..f6c0b5ef1f38 100644 --- a/pkg/ui/workspaces/cluster-ui/src/api/statementsApi.ts +++ b/pkg/ui/workspaces/cluster-ui/src/api/statementsApi.ts @@ -175,6 +175,7 @@ type Statistics = { rowsWritten: NumericStat; runLat: NumericStat; svcLat: NumericStat; + regions: string[]; }; type ExecStats = { @@ -259,6 +260,7 @@ export function convertStatementRawFormatToAggregatedStatistics( run_lat: s.statistics.statistics.runLat, service_lat: s.statistics.statistics.svcLat, sql_type: s.metadata.stmtType, + regions: s.statistics.statistics.regions, }, }; } diff --git a/pkg/ui/workspaces/cluster-ui/src/api/testUtils.tsx b/pkg/ui/workspaces/cluster-ui/src/api/testUtils.tsx index 791e5b1184bd..abb89c0127fc 100644 --- a/pkg/ui/workspaces/cluster-ui/src/api/testUtils.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/api/testUtils.tsx @@ -121,6 +121,8 @@ const baseStmt: Partial = { plan_gists: ["AgFUBAAgAAAABgI="], indexes: ["123@456"], index_recommendations: [], + regions: ["gcp-us-east1", "gcp-us-west1"], + nodes: [Long.fromNumber(1)], }, }; From 4553b42833efffa689b1f301663122b95ff7526d Mon Sep 17 00:00:00 2001 From: Kyle Wong Date: Wed, 26 Jun 2024 10:06:33 -0400 Subject: [PATCH 2/2] ui: bump package.json version bumps package.json version to 23.1.15 --- pkg/ui/workspaces/cluster-ui/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/ui/workspaces/cluster-ui/package.json b/pkg/ui/workspaces/cluster-ui/package.json index 4aa2c2176602..51a913f937a7 100644 --- a/pkg/ui/workspaces/cluster-ui/package.json +++ b/pkg/ui/workspaces/cluster-ui/package.json @@ -1,6 +1,6 @@ { "name": "@cockroachlabs/cluster-ui", - "version": "23.1.14", + "version": "23.1.15", "description": "Cluster UI is a library of large features shared between CockroachDB and CockroachCloud", "repository": { "type": "git",