Skip to content

ui: show regions in SQL Activity for tenants#92357

Merged
craig[bot] merged 1 commit intocockroachdb:masterfrom
matthewtodd:regions
Dec 14, 2022
Merged

ui: show regions in SQL Activity for tenants#92357
craig[bot] merged 1 commit intocockroachdb:masterfrom
matthewtodd:regions

Conversation

@matthewtodd
Copy link
Copy Markdown

@matthewtodd matthewtodd commented Nov 22, 2022

Fixes #89949.

Statements

Regions Column Regions Filter Regions Field in Details
Screen Shot 2022-12-14 at 10 40 03 AM Screen Shot 2022-12-14 at 10 40 22 AM Screen Shot 2022-12-14 at 10 40 43 AM

Transactions

Regions Column Regions Filter Regions Column in Details
Screen Shot 2022-12-14 at 10 41 10 AM Screen Shot 2022-12-14 at 10 41 21 AM Screen Shot 2022-12-14 at 10 41 56 AM

Release note (ui change): The console statement and transaction pages for tenant clusters gained region columns and filters for multiregion tenants.

@cockroach-teamcity
Copy link
Copy Markdown
Member

This change is Reviewable

@matthewtodd
Copy link
Copy Markdown
Author

Bazel Extended CI failures are unrelated, being fixed in #93616.

@matthewtodd matthewtodd marked this pull request as ready for review December 14, 2022 18:21
@matthewtodd matthewtodd requested a review from a team December 14, 2022 18:22
Copy link
Copy Markdown
Contributor

@j82w j82w left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 10 of 10 files at r1, all commit messages.
Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @matthewtodd)


pkg/ui/workspaces/cluster-ui/src/statementDetails/statementDetailsConnected.ts line 65 at r1 (raw file):

    statementsError: lastError,
    timeScale: selectTimeScale(state),
    // TODO(todd): Remove this unused property!

Is there a reason this can't be done in this PR?


pkg/ui/workspaces/cluster-ui/src/statementsTable/statementsTable.tsx line 307 at r1 (raw file):

      className: cx("statements-table__col-regions"),
      cell: (stmt: AggregateStatistics) => {
        return longListWithTooltip(stmt.regions.sort().join(", "), 50);

Would it be better to add a field to the stmt object and doing the transformation when getting the data to avoid the duplicate code? It would also avoid needing to compute the string twice.

Copy link
Copy Markdown
Author

@matthewtodd matthewtodd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @j82w)


pkg/ui/workspaces/cluster-ui/src/statementDetails/statementDetailsConnected.ts line 65 at r1 (raw file):

Previously, j82w wrote…

Is there a reason this can't be done in this PR?

When I was here I was pretty sure it was completely unused, but I wanted to look further, and it's unrelated enough to this PR that I wanted to split it out.


pkg/ui/workspaces/cluster-ui/src/statementsTable/statementsTable.tsx line 307 at r1 (raw file):

Previously, j82w wrote…

Would it be better to add a field to the stmt object and doing the transformation when getting the data to avoid the duplicate code? It would also avoid needing to compute the string twice.

Yeah, I tried that first but ran into complications trying to make the rest of the moving parts cooperate.

Copy link
Copy Markdown

@gtr gtr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 10 of 10 files at r1.
Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @j82w and @matthewtodd)


pkg/ui/workspaces/cluster-ui/src/transactionsPage/utils.ts line 261 at r1 (raw file):

  nodeRegions: { [p: string]: string },
): string[] => {
  const regions: { [region: string]: Set<number> } = {};

If the function returns only the keys of regions (a list of strings), then would it make more sense to make regions a set instead of a map?

Copy link
Copy Markdown
Author

@matthewtodd matthewtodd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @j82w)


pkg/ui/workspaces/cluster-ui/src/statementDetails/statementDetailsConnected.ts line 65 at r1 (raw file):

Previously, matthewtodd (Matthew Todd) wrote…

When I was here I was pretty sure it was completely unused, but I wanted to look further, and it's unrelated enough to this PR that I wanted to split it out.

WIP branch here, will send as a PR once this one lands.

Copy link
Copy Markdown
Author

@matthewtodd matthewtodd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @gtr and @j82w)


pkg/ui/workspaces/cluster-ui/src/transactionsPage/utils.ts line 261 at r1 (raw file):

Previously, gtr (Gerardo Torres Castro) wrote…

If the function returns only the keys of regions (a list of strings), then would it make more sense to make regions a set instead of a map?

Yes, that makes sense. I copied this from some nearby code without thinking too much. Let me tidy it up real quick...

Part of #89949.

Release note (ui change): The console statement and transaction pages
for tenant clusters gained region columns and filters for multiregion
tenants.
Copy link
Copy Markdown
Contributor

@j82w j82w left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @gtr)

Copy link
Copy Markdown
Author

@matthewtodd matthewtodd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @gtr and @j82w)


pkg/ui/workspaces/cluster-ui/src/transactionsPage/utils.ts line 261 at r1 (raw file):

Previously, matthewtodd (Matthew Todd) wrote…

Yes, that makes sense. I copied this from some nearby code without thinking too much. Let me tidy it up real quick...

Tidied!

Copy link
Copy Markdown

@gtr gtr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

Reviewed 1 of 1 files at r2, all commit messages.
Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @matthewtodd)

@matthewtodd
Copy link
Copy Markdown
Author

Thanks, guys!

bors r+

@craig
Copy link
Copy Markdown
Contributor

craig bot commented Dec 14, 2022

Build succeeded:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Enable region filter on SQL Activity for Serverless

4 participants