Skip to content

Commit

Permalink
Merge pull request #114819 from maryliag/backport23.1-114743
Browse files Browse the repository at this point in the history
release-23.1: server, ui: show internal stats with custer setting enabled
  • Loading branch information
maryliag authored Nov 22, 2023
2 parents 9110425 + 9b04700 commit c73be39
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 7 deletions.
5 changes: 5 additions & 0 deletions pkg/server/combined_statement_stats.go
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,11 @@ func activityTablesHaveFullData(
return false, nil
}

// Top Activity table doesn't store internal data.
if SQLStatsShowInternal.Get(&settings.SV) {
return false, nil
}

if (limit > 0 && !isLimitOnActivityTable(limit)) || !isSortOptionOnActivityTable(order) {
return false, nil
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/ui/workspaces/cluster-ui/src/sqlActivity/util.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ describe("filteredStatementsData", () => {
filterAndCheckStmts(stmtsRaw, {}, "giraffe", expectedIDs);
});

it("should show non-internal statements when no app filters are applied", () => {
it("should show internal statements when no app filters are applied", () => {
const stmtsRaw = [
{ id: 1, app: "hello" },
{ id: 2, app: "$ internal hello" },
Expand All @@ -85,7 +85,7 @@ describe("filteredStatementsData", () => {
);

const filters: Filters = {};
const expected = [1, 4, 5];
const expected = [1, 2, 3, 4, 5];
filterAndCheckStmts(stmtsRaw, filters, null, expected);
});

Expand Down
2 changes: 1 addition & 1 deletion pkg/ui/workspaces/cluster-ui/src/sqlActivity/util.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ export function filteredStatementsData(
INTERNAL_APP_NAME_PREFIX,
);
return (
(!appNames?.length && !isInternal) ||
!appNames?.length ||
(includeInternalApps && isInternal) ||
appNames?.includes(
statement.applicationName ? statement.applicationName : unset,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ describe("getStatementsByFingerprintId", () => {
const txData = data.transactions as Transaction[];

describe("Filter transactions", () => {
it("show non internal if no filters applied", () => {
it("show internal if no filters applied", () => {
const filter: Filters = {
app: "",
timeNumber: "0",
Expand All @@ -61,7 +61,7 @@ describe("Filter transactions", () => {
nodeRegions,
false,
).transactions.length,
4,
11,
);
});

Expand Down
3 changes: 1 addition & 2 deletions pkg/ui/workspaces/cluster-ui/src/transactionsPage/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -193,8 +193,7 @@ export const filterTransactions = (
apps.includes(app)
);
} else {
// We don't want to show internal transactions by default.
return !isInternal;
return true;
}
})
.filter(
Expand Down

0 comments on commit c73be39

Please sign in to comment.