Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ui: show regions in SQL Activity for tenants #92357

Merged
merged 1 commit into from
Dec 14, 2022
Merged

ui: show regions in SQL Activity for tenants #92357

merged 1 commit into from
Dec 14, 2022

Conversation

matthewtodd
Copy link
Contributor

@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
Member

This change is Reviewable

@matthewtodd
Copy link
Contributor 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
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
Contributor 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
Contributor

@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
Contributor 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
Contributor 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
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
Contributor 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
Contributor

@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
Contributor Author

Thanks, guys!

bors r+

@craig
Copy link
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