-
Notifications
You must be signed in to change notification settings - Fork 26
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
cluster-ui: update statements page #178
Conversation
Also, a note that I don't think this PR builds yet. To do so, I need to merge the protobuf updates I have in #59132, but I'd still appreciate a look. @dhartunian added you as a reviewer, let me know if I should tag someone else. |
@asubiotto I believe we are planning to remove the 'TXN type' column because we now have the transactions page (but we would still add txn type as a filter and include it on the statement detail page) @awoods187 can you confirm? |
@Annebirzin that matches my understanding. @asubiotto this is exciting! |
@asubiotto I published a beta version of the CRDB client from this PR: cockroachdb/cockroach#59132 which you can use to get this to pass build. If any of the endpoints could return a missing value, you can guard against that using patterns like:
With the I'll look through code in more detail as well. |
@asubiotto use |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Regarding testing, I think making sure that the Storybook pages for StatementsPage and StatementDetails page components render properly is a good place to start. You can adjust the fixtures in packages/cluster-ui/src/statementsPage/statementsPage.fixture.ts for example to make sure the pages have the input data they need for the new fields.
Added the fields to the storybook fixture and change the protobuf version to the beta you pushed (thanks). I also had a question about legend formatters. I haven't passed any into the bars I created, is that fine? |
I think what we'll do is once your CRDB change is merged, we'll publish a new proto version that's non-beta, then we can merge this, and you can bump the |
Sounds good. I fixed the build issue which was caused by my deleting the rows affected title which is still used by the transactions page (for now). Added the .scss back in. Related to this, is there a way to get a tool to yell at you if you're referencing a css class that doesn't exist? |
@@ -24,7 +24,7 @@ | |||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do I need to change anything here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope, these are overrides for specific column widths in case you need them.
Looks like there are some test issues which I believe cockroachdb/cockroach#59132 fixes. I'll wait for that to merge. Also, I see that I'm getting some lint errors and would like to run eslint --fix on save. Have you by any chance set that up in Goland? I tried using an automatic configuration which didn't work due to not being able to find an eslint package. I then tried to link it to both |
I don't think such a feature exists. The bar chart code in particular is a bit ugly so it's easier to make mistakes in there. Maybe @nathanstilwell has thoughts. |
@asubiotto I have this setup for eslint in Goland and it works for this project. You should only have to run |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I pushed a small update with CSS edits that hopefully help, and I ran yarn lint:fix
in a second commit.
@@ -24,7 +24,7 @@ | |||
} | |||
} | |||
|
|||
.statements-table__col-count, .statements-table__col-retries, .statements-table__col-rows { | |||
.statements-table__col-count, .statements-table__col-rows, .statements-table__col-rows-read, .statements-table__col-bytes-read , .statements-table__col-max-mem-usage, .statements-tabe__col-network-bytes, .statements-table__col-retries { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there's a tabe
-> table
spelling error here. I will push a small commit to your branch that cleans this up. It's quite annoying to deal with and we should only need to use a single selector here.
@@ -24,7 +24,7 @@ | |||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope, these are overrides for specific column widths in case you need them.
Thanks for the edits. Re eslint, I did try that but for some reason it doesn't work (regardless of wheter I'm using |
This commit adds columns for execution stats that we want to display for 21.1. Namely, this adds rows/bytes read, max memory, and network bytes sent. The rows affected column has been removed. The commit also reorders all column-related code to follow the graphical order.
Make bar chart wrapper apply a simple set of uniform styles instead of mandating a long list of carefully selected selectors. Adjust existing width overrides of certain columns to not refer to the "name"+`--bar-chart` selector and instead target the bar charts inside of the specific table cells. This reduces the need for named bar chart selectors inside each column.
New version that points to v0.0.5 protobuf changes and fixes CI errors. I think this should be good to go! PTAL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
Once you merge this, an automated build will create and publish the next version of the cluster-ui
package. You can then bump the version in CRDB to get the latest version of the statements page. Latest version will be pushed as a git commit with a version number to the repo, or can be seen in npm: https://www.npmjs.com/package/@cockroachlabs/cluster-ui
Thanks for your guidance! |
This commit adds columns for execution stats that we want to display for 21.1.
Namely, this adds rows/bytes read, max memory, and network bytes sent. The
rows affected column has been removed.
The commit also reorders all column-related code to follow the graphical order.
Here is what that looks like with some example queries run against tpch:
Closes cockroachdb/cockroach#59294
Please let me know which tests to update and how. I have run into some issues with "accessing property mean of undefined" which is most likely due to unset proto fields. Is that something I need to handle in the protojs package in cockroach? If not, I'd appreciate if someone could point me to how to write tests for this and other cases.
I'm explicitly not adding code to handle cases when the stats haven't been collected. I leave this for the future if we decide to keep the sampling cluster setting. I focused on just getting the stats out there using preexisting components.
Checklist
cc @awoods187 @cockroachdb/sql-execution