-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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: add data distribution debug page (aka replica matrix) #24855
Conversation
c076148
to
da3cc35
Compare
pkg/ui/src/util/api.ts
Outdated
@@ -309,3 +312,9 @@ export function getCommandQueue(req: CommandQueueRequestMessage, timeout?: momen | |||
export function getSettings(_req: SettingsRequestMessage, timeout?: moment.Duration): Promise<SettingsResponseMessage> { | |||
return timeoutFetch(serverpb.SettingsResponse, `${API_PREFIX}/settings`, null, timeout); | |||
} | |||
|
|||
// getReplicaMatrix returns data distribution information | |||
// TODO(vilterp): rename to DataDistribution? |
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.
note to self: do this (here and on backend) before merging. "data distribution" is a more external-friendly name, so we should prob use that.
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.
@couchand I think the other TODOs here will shake out as this page is refined & refactored (which I think it will be, since a lot of data could be layered into it). Would prefer to get it in sooner, so we can start getting feedback.
Reviewed 6 of 11 files at r1. pkg/ui/src/views/cluster/containers/dataDistribution/index.tsx, line 57 at r1 (raw file):
Seems like a good idea to do this, rather than adding a second way to do mostly the same thing... For one thing, that already correctly excludes decommissioned nodes. pkg/ui/src/views/cluster/containers/dataDistribution/index.tsx, line 74 at r1 (raw file):
please move this to a method to provide prop equality pkg/ui/src/views/cluster/containers/dataDistribution/index.tsx, line 83 at r1 (raw file):
need pkg/ui/src/views/cluster/containers/dataDistribution/index.tsx, line 87 at r1 (raw file):
please don't abuse tables for layout pkg/ui/src/views/cluster/containers/dataDistribution/index.tsx, line 94 at r1 (raw file):
perhaps a word or two here, or use the info tooltip pattern? pkg/ui/src/views/cluster/containers/dataDistribution/index.tsx, line 101 at r1 (raw file):
please style rather than abusing pkg/ui/src/views/cluster/containers/dataDistribution/index.tsx, line 108 at r1 (raw file):
please not nested, multi-line ternaries pkg/ui/src/views/cluster/containers/dataDistribution/index.tsx, line 110 at r1 (raw file):
when would this case come up? pkg/ui/src/views/cluster/containers/dataDistribution/index.tsx, line 114 at r1 (raw file):
is the "DB" adding value here? pkg/ui/src/views/cluster/containers/dataDistribution/index.tsx, line 133 at r1 (raw file):
I don't think that's the lifecycle method you're looking for. pkg/ui/src/views/cluster/containers/dataDistribution/index.tsx, line 142 at r1 (raw file):
i would prefer not pkg/ui/src/views/cluster/containers/dataDistribution/index.tsx, line 145 at r1 (raw file):
I think this header should just be in the section below pkg/ui/src/views/cluster/containers/dataDistribution/index.tsx, line 157 at r1 (raw file):
do the pkg/ui/src/views/cluster/containers/dataDistribution/matrix.tsx, line 27 at r1 (raw file):
Kind of disappointed with TS that making these properties optional compiles... as far as I can tell not passing them in it would explode. pkg/ui/src/views/cluster/containers/dataDistribution/matrix.tsx, line 30 at r1 (raw file):
I'd recommend removing most/all of the generalization here. It's making things overly complicated, there seem to be some latent bugs, and there's not a compelling reason to generalize since the pkg/ui/src/views/cluster/containers/dataDistribution/tree.ts, line 15 at r1 (raw file):
This file seems closely coupled with pkg/ui/src/views/cluster/containers/dataDistribution/tree.ts, line 45 at r1 (raw file):
I'm not sure this example is very clear. It would seem to indicate that e needs to be a leaf node, so it is pushed down to the same level as c and d, but I don't understand why the same transformation wouldn't be made to a and b? I think it's just that the notation here is ambiguous, the expected result makes enough sense. I'd suggest drawing the tree out rather than trying to make this compact syntax work, I'm not sure there's a great way to make it unambiguous. pkg/ui/src/views/cluster/containers/dataDistribution/zoneConfigList.tsx, line 18 at r1 (raw file):
Isn't this inside another component already doing this? pkg/ui/src/views/cluster/containers/dataDistribution/zoneConfigList.tsx, line 55 at r1 (raw file):
pass in as a prop, since the parent already has it Comments from Reviewable |
da3cc35
to
bc6aadd
Compare
Responded to most comments, besides de-generifying the TreeMatrix widget. I agree that there is some wonky code (esp the label functions) that could probably be simplified this way; will hopefully get to it later this week. Review status: 3 of 10 files reviewed at latest revision, 20 unresolved discussions. pkg/ui/src/views/cluster/containers/dataDistribution/index.tsx, line 74 at r1 (raw file): Previously, couchand (Andrew Couch) wrote…
Done. pkg/ui/src/views/cluster/containers/dataDistribution/index.tsx, line 83 at r1 (raw file): Previously, couchand (Andrew Couch) wrote…
Done. pkg/ui/src/views/cluster/containers/dataDistribution/index.tsx, line 87 at r1 (raw file): Previously, couchand (Andrew Couch) wrote…
Done. pkg/ui/src/views/cluster/containers/dataDistribution/index.tsx, line 94 at r1 (raw file): Previously, couchand (Andrew Couch) wrote…
Done. pkg/ui/src/views/cluster/containers/dataDistribution/index.tsx, line 101 at r1 (raw file): Previously, couchand (Andrew Couch) wrote…
Done. pkg/ui/src/views/cluster/containers/dataDistribution/index.tsx, line 114 at r1 (raw file): Previously, couchand (Andrew Couch) wrote…
Not sure. I'm afraid users might not know what they're looking at without something saying "this is a database" or "this is your schema" or "this is a table". There's probably a better way. pkg/ui/src/views/cluster/containers/dataDistribution/index.tsx, line 133 at r1 (raw file): Previously, couchand (Andrew Couch) wrote…
Done. Guessing pkg/ui/src/views/cluster/containers/dataDistribution/index.tsx, line 142 at r1 (raw file): Previously, couchand (Andrew Couch) wrote…
Done. pkg/ui/src/views/cluster/containers/dataDistribution/index.tsx, line 145 at r1 (raw file): Previously, couchand (Andrew Couch) wrote…
Hm, tried this but the vertical padding comes from the pkg/ui/src/views/cluster/containers/dataDistribution/index.tsx, line 157 at r1 (raw file): Previously, couchand (Andrew Couch) wrote…
Nope! Good catch. pkg/ui/src/views/cluster/containers/dataDistribution/matrix.tsx, line 27 at r1 (raw file): Previously, couchand (Andrew Couch) wrote…
Hmm yeah… Made non-optional pkg/ui/src/views/cluster/containers/dataDistribution/tree.ts, line 45 at r1 (raw file): Previously, couchand (Andrew Couch) wrote…
a and b can't be pushed down because they have children. The notation isn't ambiguous ( pkg/ui/src/views/cluster/containers/dataDistribution/zoneConfigList.tsx, line 55 at r1 (raw file): Previously, couchand (Andrew Couch) wrote…
Moved this back into the Comments from Reviewable |
45fbff2
to
134bb8f
Compare
bbbdf9e
to
17a724e
Compare
Largely de-generified the Matrix component. Both rows and columns still use a generic TreeNode structure, though. PTAL. Review status: 0 of 15 files reviewed at latest revision, 20 unresolved discussions, all commit checks successful. pkg/ui/src/views/cluster/containers/dataDistribution/index.tsx, line 57 at r1 (raw file): Previously, couchand (Andrew Couch) wrote…
Uses the locality tree selector now. pkg/ui/src/views/cluster/containers/dataDistribution/index.tsx, line 108 at r1 (raw file): Previously, couchand (Andrew Couch) wrote…
Done. pkg/ui/src/views/cluster/containers/dataDistribution/index.tsx, line 110 at r1 (raw file): Previously, couchand (Andrew Couch) wrote…
Done. pkg/ui/src/views/cluster/containers/dataDistribution/matrix.tsx, line 30 at r1 (raw file): Previously, couchand (Andrew Couch) wrote…
Done. (at least most of the way) Comments from Reviewable |
Review status: all files reviewed at latest revision, 2 unresolved discussions, all commit checks successful. pkg/ui/src/index.tsx, line 145 at r3 (raw file):
this URL slug seems kind of stilted but it looks like it's consistent with other routes so it's fine. pkg/ui/src/redux/apiReducers.ts, line 246 at r3 (raw file):
Just wanted to check if this is the right refresh interval? pkg/ui/src/views/cluster/containers/dataDistribution/index.tsx, line 114 at r1 (raw file): Previously, vilterp (Pete Vilter) wrote…
random idea: the databases icon... is that crazy? @josueeee will kill me pkg/ui/src/views/cluster/containers/dataDistribution/index.tsx, line 39 at r3 (raw file):
this is kind of expensive for a render method, maybe use a selector? pkg/ui/src/views/cluster/containers/dataDistribution/replicaMatrix.styl, line 21 at r3 (raw file):
pkg/ui/src/views/cluster/containers/dataDistribution/replicaMatrix.styl, line 27 at r3 (raw file):
maybe pkg/ui/src/views/cluster/containers/dataDistribution/replicaMatrix.tsx, line 40 at r3 (raw file):
maybe want to add the other two default databases (though they're empty by default so maybe it's fine?). maybe sort them to the end? pkg/ui/src/views/cluster/containers/dataDistribution/replicaMatrix.tsx, line 69 at r3 (raw file):
what's the difference between pkg/ui/src/views/cluster/containers/dataDistribution/replicaMatrix.tsx, line 143 at r3 (raw file):
that's a pretty heavy key pkg/ui/src/views/cluster/containers/dataDistribution/replicaMatrix.tsx, line 156 at r3 (raw file):
what's the pkg/ui/src/views/cluster/containers/dataDistribution/tree.ts, line 17 at r3 (raw file):
I believe the terminology here is a bit off: depth is the number of edges between a node and the root node, and height is the maximum number of edges between a node and a descendant leaf node. So this field is actually storing pkg/ui/src/views/cluster/containers/dataDistribution/tree.ts, line 93 at r3 (raw file):
I think coming up with a real name for this would be a good exercise and would clarify the intention. pkg/ui/src/views/cluster/containers/dataDistribution/tree.ts, line 95 at r3 (raw file):
it's not entirely satisfying that we do this whether or not we actually need the rows... pkg/ui/src/views/cluster/containers/dataDistribution/tree.ts, line 99 at r3 (raw file):
I don't think this can be correct for both the cases it's used below... shouldn't one of them be +1? the leaf case I think? pkg/ui/src/views/cluster/containers/dataDistribution/tree.ts, line 144 at r3 (raw file):
just map > max if all you need is the value. also, what is this wonky access? oh, i guess it's to get the root node's depth... hmmm also, shouldn't they all be the same anyway because of the placeholders? pkg/ui/src/views/cluster/containers/dataDistribution/tree.ts, line 145 at r3 (raw file):
It's not clear to me why this is Also, I don't think this is transposing anything? pkg/ui/src/views/cluster/containers/dataDistribution/tree.ts, line 150 at r3 (raw file):
maybe this is too clever, but
pkg/ui/src/views/cluster/containers/dataDistribution/tree.ts, line 170 at r3 (raw file):
splitting the body of the function around the nested closure makes seeing the whole thing harder pkg/ui/src/views/cluster/containers/dataDistribution/tree.ts, line 174 at r3 (raw file):
suggest naming this pkg/ui/src/views/cluster/containers/dataDistribution/tree.ts, line 183 at r3 (raw file):
maybe use pkg/ui/src/views/cluster/containers/dataDistribution/tree.ts, line 246 at r3 (raw file):
I'd call this pkg/ui/src/views/cluster/containers/dataDistribution/tree.ts, line 249 at r3 (raw file):
I think giving this function a real name would be valuable, and I'd prefer if the body of the main function weren't split around it. pkg/ui/src/views/cluster/containers/dataDistribution/tree.ts, line 259 at r3 (raw file):
pkg/ui/src/views/cluster/containers/dataDistribution/tree.ts, line 260 at r3 (raw file):
it took me quite a while to figure out the logic here. The pkg/ui/src/views/cluster/containers/dataDistribution/tree.ts, line 291 at r3 (raw file):
maybe this error should provide more context? do you ever catch it? pkg/ui/src/views/cluster/containers/dataDistribution/tree.ts, line 366 at r3 (raw file):
Doesn't seem like two nested loops deserve a function, but... Sure, I guess. pkg/ui/src/views/cluster/containers/dataDistribution/tree.ts, line 395 at r3 (raw file):
s/C_b/C_1/ here and below pkg/ui/src/views/cluster/containers/dataDistribution/tree.spec.ts, line 123 at r3 (raw file):
what are the depth numbers used for? if they're not broken then the todo's not needed here; if they aren't used the property isn't needed. Comments from Reviewable |
17a724e
to
9d2e610
Compare
Review status: complete! 0 of 0 LGTMs obtained pkg/ui/src/index.tsx, line 145 at r3 (raw file): Previously, couchand (Andrew Couch) wrote…
pkg/ui/src/redux/apiReducers.ts, line 246 at r3 (raw file): Previously, couchand (Andrew Couch) wrote…
Was just copying a bunch of others that are 1m. It seems reasonable to me. pkg/ui/src/views/cluster/containers/dataDistribution/index.tsx, line 114 at r1 (raw file): Previously, couchand (Andrew Couch) wrote…
I actually had the same thought… Having icons in the schema object tree is actually par for the course in DB admin tools screenshots, and a decent solution, although it does clutter things… pkg/ui/src/views/cluster/containers/dataDistribution/replicaMatrix.tsx, line 69 at r3 (raw file): Previously, couchand (Andrew Couch) wrote…
Done. pkg/ui/src/views/cluster/containers/dataDistribution/tree.ts, line 17 at r3 (raw file): Previously, couchand (Andrew Couch) wrote…
Done. (replaced pkg/ui/src/views/cluster/containers/dataDistribution/tree.ts, line 99 at r3 (raw file): Previously, couchand (Andrew Couch) wrote…
Done (removed depth) pkg/ui/src/views/cluster/containers/dataDistribution/tree.spec.ts, line 123 at r3 (raw file): Previously, couchand (Andrew Couch) wrote…
Done. Comments from Reviewable |
9d2e610
to
43768b9
Compare
Reviewed 2 of 12 files at r4, 11 of 11 files at r5. pkg/ui/src/index.tsx, line 145 at r3 (raw file): Previously, vilterp (Pete Vilter) wrote…
i like sausage case but i also like consistency... I guess it's only pkg/ui/src/util/docs.ts, line 15 at r5 (raw file):
I tried to make these just the names of the pages (I guess Comments from Reviewable |
d616252
to
085b242
Compare
Addressed everything except comments on Review status: complete! 0 of 0 LGTMs obtained pkg/ui/src/index.tsx, line 145 at r3 (raw file): Previously, couchand (Andrew Couch) wrote…
Done. pkg/ui/src/util/docs.ts, line 15 at r5 (raw file): Previously, couchand (Andrew Couch) wrote…
Done. pkg/ui/src/views/cluster/containers/dataDistribution/index.tsx, line 39 at r3 (raw file): Previously, couchand (Andrew Couch) wrote…
Done. pkg/ui/src/views/cluster/containers/dataDistribution/replicaMatrix.styl, line 21 at r3 (raw file): Previously, couchand (Andrew Couch) wrote…
Done. (Went with pkg/ui/src/views/cluster/containers/dataDistribution/replicaMatrix.styl, line 27 at r3 (raw file): Previously, couchand (Andrew Couch) wrote…
Done. pkg/ui/src/views/cluster/containers/dataDistribution/replicaMatrix.tsx, line 40 at r3 (raw file): Previously, couchand (Andrew Couch) wrote…
pkg/ui/src/views/cluster/containers/dataDistribution/replicaMatrix.tsx, line 143 at r3 (raw file): Previously, couchand (Andrew Couch) wrote…
Done ( pkg/ui/src/views/cluster/containers/dataDistribution/replicaMatrix.tsx, line 156 at r3 (raw file): Previously, couchand (Andrew Couch) wrote…
Factored out into a constant. Sadly you can't add margins to elements, so I'm adding it to the padding. pkg/ui/src/views/cluster/containers/dataDistribution/tree.ts, line 246 at r3 (raw file): Previously, couchand (Andrew Couch) wrote…
Done. pkg/ui/src/views/cluster/containers/dataDistribution/tree.ts, line 249 at r3 (raw file): Previously, couchand (Andrew Couch) wrote…
Me trying to come up with a meaningful name: https://twitter.com/sallar/status/997459417242140672 pkg/ui/src/views/cluster/containers/dataDistribution/tree.ts, line 259 at r3 (raw file): Previously, couchand (Andrew Couch) wrote…
Done. pkg/ui/src/views/cluster/containers/dataDistribution/tree.ts, line 260 at r3 (raw file): Previously, couchand (Andrew Couch) wrote…
Yes. Broke out another variable to hopefully make things more clear. pkg/ui/src/views/cluster/containers/dataDistribution/tree.ts, line 291 at r3 (raw file): Previously, couchand (Andrew Couch) wrote…
Nope, never catch it :/ Relying on tests for its callers ( Not sure what context to add that wouldn't be in a stack trace. pkg/ui/src/views/cluster/containers/dataDistribution/tree.ts, line 395 at r3 (raw file): Previously, couchand (Andrew Couch) wrote…
Done. Comments from Reviewable |
75932d6
to
64f735b
Compare
Decomposed the Review status: complete! 0 of 0 LGTMs obtained pkg/ui/src/views/cluster/containers/dataDistribution/tree.ts, line 93 at r3 (raw file): Previously, couchand (Andrew Couch) wrote…
Me trying to come up with a name: https://twitter.com/sallar/status/997459417242140672 I don't know how important this is. If I had written it iteratively, there would be a pkg/ui/src/views/cluster/containers/dataDistribution/tree.ts, line 95 at r3 (raw file): Previously, couchand (Andrew Couch) wrote…
Done. pkg/ui/src/views/cluster/containers/dataDistribution/tree.ts, line 145 at r3 (raw file): Previously, couchand (Andrew Couch) wrote…
Done. True, it was horizontally concatenating, not transposing. Factored out a function with that name. pkg/ui/src/views/cluster/containers/dataDistribution/tree.ts, line 150 at r3 (raw file): Previously, couchand (Andrew Couch) wrote…
Huh, idk. Does seem a little too clever; might just stick with the good ol' nested loops. pkg/ui/src/views/cluster/containers/dataDistribution/tree.ts, line 170 at r3 (raw file): Previously, couchand (Andrew Couch) wrote…
If I make it a top-level function instead of a closure, I have to pass parameters… Can do this if it's important to you, but it doesn't seem important to me. pkg/ui/src/views/cluster/containers/dataDistribution/tree.ts, line 174 at r3 (raw file): Previously, couchand (Andrew Couch) wrote…
Done. (removed this function) pkg/ui/src/views/cluster/containers/dataDistribution/tree.ts, line 183 at r3 (raw file): Previously, couchand (Andrew Couch) wrote…
Done. (removed this function) Comments from Reviewable |
64f735b
to
da0f30b
Compare
Reviewed 5 of 16 files at r6, 8 of 11 files at r7, 3 of 3 files at r8. pkg/ui/src/views/cluster/containers/dataDistribution/replicaMatrix.tsx, line 40 at r3 (raw file): Previously, vilterp (Pete Vilter) wrote…
pkg/ui/src/views/cluster/containers/dataDistribution/tree.ts, line 170 at r3 (raw file): Previously, vilterp (Pete Vilter) wrote…
I just mean move the pkg/ui/src/views/cluster/containers/dataDistribution/tree.ts, line 291 at r3 (raw file): Previously, vilterp (Pete Vilter) wrote…
A lot of the time we don't get a stack trace, we just get the message. pkg/ui/src/views/cluster/containers/dataDistribution/tree.ts, line 195 at r8 (raw file):
I still want this to use pkg/ui/src/views/cluster/containers/dataDistribution/tree.ts, line 205 at r8 (raw file):
s/inptus/inputs/ Comments from Reviewable |
Release note: None
with collapsible tree matrix widget Release note (admin ui change): Add "data distribution" debug page, showing how table data is distributed across nodes, as well as the zone configs which are affecting that distribution.
da0f30b
to
721de4c
Compare
Thank Jesus, it's finally going in! Original commit that I've been squashing into dated 12/4/17 😂 bors r+ Review status: complete! 0 of 0 LGTMs obtained (and 1 stale) pkg/ui/src/views/cluster/containers/dataDistribution/replicaMatrix.tsx, line 40 at r3 (raw file): Previously, couchand (Andrew Couch) wrote…
Done. pkg/ui/src/views/cluster/containers/dataDistribution/tree.ts, line 170 at r3 (raw file): Previously, couchand (Andrew Couch) wrote…
Done. Nice, didn't know you could do that! pkg/ui/src/views/cluster/containers/dataDistribution/tree.ts, line 195 at r8 (raw file): Previously, couchand (Andrew Couch) wrote…
Tried, but there was a type error I didn't feel like figuring out… pkg/ui/src/views/cluster/containers/dataDistribution/tree.ts, line 205 at r8 (raw file): Previously, couchand (Andrew Couch) wrote…
Done. Comments from Reviewable |
24855: ui: add data distribution debug page (aka replica matrix) r=vilterp a=vilterp ![image](https://user-images.githubusercontent.com/7341/41315292-0f7d284a-6e5d-11e8-81cb-cacd978cc519.png) Split off from #20500, which had some CR comments from four months ago. Many have been addressed, but need to comb through again. Note: if one of its API calls returns an error, it will display the spinner forever. Sadly, the cluster viz has the same problem (as well as many other pages, probably). Kind of want to address this with some changes to `Loader` as part of #24011, but maybe should just address it here. Co-authored-by: Pete Vilter <[email protected]>
Build succeeded |
Split off from #20500, which had some CR comments from four months ago. Many have been addressed, but need to comb through again.
Note: if one of its API calls returns an error, it will display the spinner forever. Sadly, the cluster viz has the same problem (as well as many other pages, probably). Kind of want to address this with some changes to
Loader
as part of #24011, but maybe should just address it here.