Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
100629: cli: add hex payload/progress to system_jobs r=dt a=dt

Release note: none.
Epic: none.

102197: test: fix stories files r=maryliag a=maryliag

Some stories files were missing parameters or
having others no longer existing ones.
This was causing some errors on tests.
This commit fixes the stories files.

Epic: None

Release note: None

Co-authored-by: David Taylor <[email protected]>
Co-authored-by: maryliag <[email protected]>
  • Loading branch information
3 people committed Apr 25, 2023
3 parents 5114a6b + c6487e2 + c4e6e90 commit b89085a
Show file tree
Hide file tree
Showing 6 changed files with 70 additions and 44 deletions.
13 changes: 10 additions & 3 deletions pkg/cli/zip_table_registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",
'<redacted>' AS "hex_payload",
to_hex(progress) AS "hex_progress"
FROM crdb_internal.system_jobs`,
},
"crdb_internal.kv_node_liveness": {
nonSensitiveCols: NonSensitiveColumns{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ const withLoadingIndicator: DatabaseDetailsPageProps = {
onSortingGrantsChange: () => {},
refreshDatabaseDetails: () => {},
refreshTableDetails: () => {},
refreshTableStats: () => {},
search: null,
filters: defaultFilters,
nodeRegions: {},
Expand Down Expand Up @@ -82,7 +81,6 @@ const withoutData: DatabaseDetailsPageProps = {
onSortingGrantsChange: () => {},
refreshDatabaseDetails: () => {},
refreshTableDetails: () => {},
refreshTableStats: () => {},
search: null,
filters: defaultFilters,
nodeRegions: {},
Expand All @@ -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,
Expand All @@ -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),
},
};
}
Expand All @@ -150,7 +141,6 @@ const withData: DatabaseDetailsPageProps = {
onSortingGrantsChange: () => {},
refreshDatabaseDetails: () => {},
refreshTableDetails: () => {},
refreshTableStats: () => {},
search: null,
filters: defaultFilters,
nodeRegions: {},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
Expand All @@ -63,7 +58,6 @@ const withLoadingIndicator: DatabaseTablePageProps = {
params: {},
},
refreshTableDetails: () => {},
refreshTableStats: () => {},
refreshIndexStats: () => {},
resetIndexUsageStats: () => {},
refreshSettings: () => {},
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -167,7 +154,6 @@ const withData: DatabaseTablePageProps = {
params: {},
},
refreshTableDetails: () => {},
refreshTableStats: () => {},
refreshIndexStats: () => {},
resetIndexUsageStats: () => {},
refreshSettings: () => {},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ const withLoadingIndicator: DatabasesPageProps = {
refreshDatabases: () => {},
refreshSettings: () => {},
refreshDatabaseDetails: () => {},
refreshTableStats: () => {},
location: history.location,
history,
match: {
Expand Down Expand Up @@ -65,7 +64,6 @@ const withoutData: DatabasesPageProps = {
refreshDatabases: () => {},
refreshSettings: () => {},
refreshDatabaseDetails: () => {},
refreshTableStats: () => {},
location: history.location,
history,
match: {
Expand Down Expand Up @@ -111,7 +109,6 @@ const withData: DatabasesPageProps = {
refreshDatabases: () => {},
refreshSettings: () => {},
refreshDatabaseDetails: () => {},
refreshTableStats: () => {},
location: history.location,
history,
match: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 => <MemoryRouter>{storyFn()}</MemoryRouter>)
Expand All @@ -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", () => (
Expand All @@ -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", () => (
Expand All @@ -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", () => {
Expand All @@ -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}
/>
);
});
Original file line number Diff line number Diff line change
Expand Up @@ -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: [] });
Expand Down Expand Up @@ -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", () => {
Expand All @@ -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}
/>
);
})
Expand Down Expand Up @@ -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}
/>
);
})
Expand All @@ -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}
/>
);
})
Expand Down Expand Up @@ -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}
/>
);
});

0 comments on commit b89085a

Please sign in to comment.