diff --git a/pkg/cli/zip_table_registry.go b/pkg/cli/zip_table_registry.go index 04268fea149b..d1f55dd5c64f 100644 --- a/pkg/cli/zip_table_registry.go +++ b/pkg/cli/zip_table_registry.go @@ -378,18 +378,25 @@ var zipInternalTablesPerCluster = DebugZipTableRegistry{ "crdb_internal.system_jobs": { // `payload` column may contain customer info, such as URI params // containing access keys, encryption salts, etc. - nonSensitiveCols: NonSensitiveColumns{ + customQueryUnredacted: `SELECT *, + to_hex(payload) AS hex_payload, + to_hex(progress) AS hex_progress + FROM crdb_internal.system_jobs`, + customQueryRedacted: `SELECT "id", "status", "created", + 'redacted' AS "payload", "progress", "created_by_type", "created_by_id", "claim_session_id", "claim_instance_id", "num_runs", - "last_run", - }, + "last_run", + '' AS "hex_payload", + to_hex(progress) AS "hex_progress" + FROM crdb_internal.system_jobs`, }, "crdb_internal.kv_node_liveness": { nonSensitiveCols: NonSensitiveColumns{ diff --git a/pkg/ui/workspaces/cluster-ui/src/databaseDetailsPage/databaseDetailsPage.stories.tsx b/pkg/ui/workspaces/cluster-ui/src/databaseDetailsPage/databaseDetailsPage.stories.tsx index 8e91151cce0f..87f18a8ba5f2 100644 --- a/pkg/ui/workspaces/cluster-ui/src/databaseDetailsPage/databaseDetailsPage.stories.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/databaseDetailsPage/databaseDetailsPage.stories.tsx @@ -49,7 +49,6 @@ const withLoadingIndicator: DatabaseDetailsPageProps = { onSortingGrantsChange: () => {}, refreshDatabaseDetails: () => {}, refreshTableDetails: () => {}, - refreshTableStats: () => {}, search: null, filters: defaultFilters, nodeRegions: {}, @@ -82,7 +81,6 @@ const withoutData: DatabaseDetailsPageProps = { onSortingGrantsChange: () => {}, refreshDatabaseDetails: () => {}, refreshTableDetails: () => {}, - refreshTableStats: () => {}, search: null, filters: defaultFilters, nodeRegions: {}, @@ -103,11 +101,11 @@ function createTable(): DatabaseDetailsPageDataTable { ); return { + loading: false, + loaded: true, + lastError: null, name: randomName(), details: { - loading: false, - loaded: true, - lastError: null, columnCount: _.random(5, 42), indexCount: _.random(1, 6), userCount: roles.length, @@ -118,15 +116,8 @@ function createTable(): DatabaseDetailsPageDataTable { livePercentage: _.random(0, 100), liveBytes: _.random(0, 10000), totalBytes: _.random(0, 10000), - }, - stats: { - loading: false, - loaded: true, - lastError: null, - replicationSizeInBytes: _.random(1000.0) * 1024 ** _.random(1, 2), - rangeCount: _.random(50, 500), - nodesByRegionString: - "gcp-europe-west1(n8), gcp-us-east1(n1), gcp-us-west1(n6)", + replicationSizeInBytes: _.random(0, 10000), + rangeCount: _.random(0, 10000), }, }; } @@ -150,7 +141,6 @@ const withData: DatabaseDetailsPageProps = { onSortingGrantsChange: () => {}, refreshDatabaseDetails: () => {}, refreshTableDetails: () => {}, - refreshTableStats: () => {}, search: null, filters: defaultFilters, nodeRegions: {}, diff --git a/pkg/ui/workspaces/cluster-ui/src/databaseTablePage/databaseTablePage.stories.tsx b/pkg/ui/workspaces/cluster-ui/src/databaseTablePage/databaseTablePage.stories.tsx index 2b52828a5a24..8cf8bc842927 100644 --- a/pkg/ui/workspaces/cluster-ui/src/databaseTablePage/databaseTablePage.stories.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/databaseTablePage/databaseTablePage.stories.tsx @@ -39,11 +39,6 @@ const withLoadingIndicator: DatabaseTablePageProps = { livePercentage: 2.7, liveBytes: 12345, totalBytes: 456789, - }, - stats: { - loading: true, - loaded: false, - lastError: undefined, sizeInBytes: 0, rangeCount: 0, }, @@ -63,7 +58,6 @@ const withLoadingIndicator: DatabaseTablePageProps = { params: {}, }, refreshTableDetails: () => {}, - refreshTableStats: () => {}, refreshIndexStats: () => {}, resetIndexUsageStats: () => {}, refreshSettings: () => {}, @@ -105,17 +99,10 @@ const withData: DatabaseTablePageProps = { livePercentage: 2.7, liveBytes: 12345, totalBytes: 456789, - }, - showNodeRegionsSection: true, - stats: { - loading: false, - loaded: true, - lastError: null, sizeInBytes: 44040192, rangeCount: 4200, - nodesByRegionString: - "gcp-europe-west1(n8), gcp-us-east1(n1), gcp-us-west1(n6)", }, + showNodeRegionsSection: true, indexStats: { loading: false, loaded: true, @@ -167,7 +154,6 @@ const withData: DatabaseTablePageProps = { params: {}, }, refreshTableDetails: () => {}, - refreshTableStats: () => {}, refreshIndexStats: () => {}, resetIndexUsageStats: () => {}, refreshSettings: () => {}, diff --git a/pkg/ui/workspaces/cluster-ui/src/databasesPage/databasesPage.stories.tsx b/pkg/ui/workspaces/cluster-ui/src/databasesPage/databasesPage.stories.tsx index 8fbf0c96d107..5d361a462c1a 100644 --- a/pkg/ui/workspaces/cluster-ui/src/databasesPage/databasesPage.stories.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/databasesPage/databasesPage.stories.tsx @@ -37,7 +37,6 @@ const withLoadingIndicator: DatabasesPageProps = { refreshDatabases: () => {}, refreshSettings: () => {}, refreshDatabaseDetails: () => {}, - refreshTableStats: () => {}, location: history.location, history, match: { @@ -65,7 +64,6 @@ const withoutData: DatabasesPageProps = { refreshDatabases: () => {}, refreshSettings: () => {}, refreshDatabaseDetails: () => {}, - refreshTableStats: () => {}, location: history.location, history, match: { @@ -111,7 +109,6 @@ const withData: DatabasesPageProps = { refreshDatabases: () => {}, refreshSettings: () => {}, refreshDatabaseDetails: () => {}, - refreshTableStats: () => {}, location: history.location, history, match: { diff --git a/pkg/ui/workspaces/cluster-ui/src/transactionDetails/transactionDetails.stories.tsx b/pkg/ui/workspaces/cluster-ui/src/transactionDetails/transactionDetails.stories.tsx index 89372da9bfc1..e45b1c69fcc0 100644 --- a/pkg/ui/workspaces/cluster-ui/src/transactionDetails/transactionDetails.stories.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/transactionDetails/transactionDetails.stories.tsx @@ -13,17 +13,19 @@ import { storiesOf } from "@storybook/react"; import { MemoryRouter } from "react-router-dom"; import { noop } from "lodash"; import { - transactionDetailsData, - routeProps, - nodeRegions, error, + nodeRegions, + routeProps, timeScale, transaction, + transactionDetailsData, transactionFingerprintId, } from "./transactionDetails.fixture"; import { TransactionDetails } from "."; import moment from "moment-timezone"; +import { cockroach } from "@cockroachlabs/crdb-protobuf-client"; +import StatsSortOptions = cockroach.server.serverpb.StatsSortOptions; storiesOf("Transactions Details", module) .addDecorator(storyFn => {storyFn()}) @@ -48,6 +50,9 @@ storiesOf("Transactions Details", module) refreshNodes={noop} lastUpdated={moment("0001-01-01T00:00:00Z")} refreshTransactionInsights={noop} + limit={100} + reqSortSetting={StatsSortOptions.SERVICE_LAT} + isDataValid={true} /> )) .add("with loading indicator", () => ( @@ -68,6 +73,9 @@ storiesOf("Transactions Details", module) refreshNodes={noop} lastUpdated={moment("0001-01-01T00:00:00Z")} refreshTransactionInsights={noop} + limit={100} + reqSortSetting={StatsSortOptions.SERVICE_LAT} + isDataValid={true} /> )) .add("with error alert", () => ( @@ -89,6 +97,9 @@ storiesOf("Transactions Details", module) refreshNodes={noop} lastUpdated={moment("0001-01-01T00:00:00Z")} refreshTransactionInsights={noop} + limit={100} + reqSortSetting={StatsSortOptions.SERVICE_LAT} + isDataValid={true} /> )) .add("No data for this time frame; no cached transaction text", () => { @@ -110,6 +121,9 @@ storiesOf("Transactions Details", module) refreshNodes={noop} lastUpdated={moment("0001-01-01T00:00:00Z")} refreshTransactionInsights={noop} + limit={100} + reqSortSetting={StatsSortOptions.SERVICE_LAT} + isDataValid={true} /> ); }); diff --git a/pkg/ui/workspaces/cluster-ui/src/transactionsPage/transactionsPage.stories.tsx b/pkg/ui/workspaces/cluster-ui/src/transactionsPage/transactionsPage.stories.tsx index fece79e6c210..3e5b9dd423c2 100644 --- a/pkg/ui/workspaces/cluster-ui/src/transactionsPage/transactionsPage.stories.tsx +++ b/pkg/ui/workspaces/cluster-ui/src/transactionsPage/transactionsPage.stories.tsx @@ -11,20 +11,22 @@ import React from "react"; import { storiesOf } from "@storybook/react"; import { MemoryRouter } from "react-router-dom"; -import { cloneDeep, noop, extend } from "lodash"; +import { cloneDeep, extend, noop } from "lodash"; import { + columns, data, + filters, + lastUpdated, nodeRegions, - columns, routeProps, - timeScale, sortSetting, - filters, - lastUpdated, + timeScale, } from "./transactions.fixture"; import { TransactionsPage } from "."; import { RequestError } from "../util"; +import { cockroach } from "@cockroachlabs/crdb-protobuf-client"; +import StatsSortOptions = cockroach.server.serverpb.StatsSortOptions; const getEmptyData = () => extend({}, data, { transactions: [], statements: [] }); @@ -53,6 +55,12 @@ storiesOf("Transactions Page", module) search={""} sortSetting={sortSetting} lastUpdated={lastUpdated} + limit={100} + reqSortSetting={StatsSortOptions.SERVICE_LAT} + isReqInFlight={false} + onChangeLimit={noop} + onChangeReqSort={noop} + onApplySearchCriteria={noop} /> )) .add("without data", () => { @@ -75,6 +83,12 @@ storiesOf("Transactions Page", module) search={""} sortSetting={sortSetting} lastUpdated={lastUpdated} + limit={100} + reqSortSetting={StatsSortOptions.SERVICE_LAT} + isReqInFlight={false} + onChangeLimit={noop} + onChangeReqSort={noop} + onApplySearchCriteria={noop} /> ); }) @@ -105,6 +119,12 @@ storiesOf("Transactions Page", module) search={""} sortSetting={sortSetting} lastUpdated={lastUpdated} + limit={100} + reqSortSetting={StatsSortOptions.SERVICE_LAT} + isReqInFlight={false} + onChangeLimit={noop} + onChangeReqSort={noop} + onApplySearchCriteria={noop} /> ); }) @@ -128,6 +148,12 @@ storiesOf("Transactions Page", module) search={""} sortSetting={sortSetting} lastUpdated={lastUpdated} + limit={100} + reqSortSetting={StatsSortOptions.SERVICE_LAT} + isReqInFlight={false} + onChangeLimit={noop} + onChangeReqSort={noop} + onApplySearchCriteria={noop} /> ); }) @@ -158,6 +184,12 @@ storiesOf("Transactions Page", module) search={""} sortSetting={sortSetting} lastUpdated={lastUpdated} + limit={100} + reqSortSetting={StatsSortOptions.SERVICE_LAT} + isReqInFlight={false} + onChangeLimit={noop} + onChangeReqSort={noop} + onApplySearchCriteria={noop} /> ); });