Skip to content
This repository was archived by the owner on Jan 23, 2025. It is now read-only.

cluster-ui: add button to reset SQL stats on statement page and txn page#271

Merged
Azhng merged 1 commit intocockroachdb:masterfrom
Azhng:ui-reset-sql-stats
Apr 8, 2021
Merged

cluster-ui: add button to reset SQL stats on statement page and txn page#271
Azhng merged 1 commit intocockroachdb:masterfrom
Azhng:ui-reset-sql-stats

Conversation

@Azhng
Copy link
Copy Markdown
Contributor

@Azhng Azhng commented Apr 6, 2021

cluster-ui: add button to reset SQL stats on statement page and txn page

Addresses cockroachdb/cockroach#33315

Before:

Stmt page
old-stmt

Txn Page
old-txn

After:

Stmt Page:
new-stmt

Txn Page:
new-txn

Tooltip
new-tool-tip

@Azhng Azhng requested review from dhartunian and maryliag April 6, 2021 19:13
@Azhng Azhng marked this pull request as ready for review April 6, 2021 21:24
@Azhng Azhng requested review from a team and removed request for dhartunian, j-low, laurenbarker, maryliag and nathanstilwell April 6, 2021 22:25
return `Last cleared ${moment.utc(lastReset).format(DATE_FORMAT)}`;
};

const renderResetSQLStats = (resetSQLStats: () => void) => {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

for both render reset stats and tooltip there is no need to pass parameters (since they're both static) and they look very simple, so I don't think is worth creating a render function for each one (the last cleared render requires some "calculation", so it's better to leave it separated), but I would suggest add those two renders directly

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done

@Azhng Azhng force-pushed the ui-reset-sql-stats branch from 5b6ad95 to dcbf151 Compare April 7, 2021 02:34
.tooltip-hover-area {
padding-top: 3px;
padding-right: 10px;
} No newline at end of file
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can we get a new line here? 😄

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done.

<div>
<Tooltip text={toolTipText} className={cxStats("align-float")}>
<div className={cxStats("tooltip-hover-area")}>
<div className={cxStmt("numeric-stats-table__info-icon")}>i</div>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We have an InfoCircle icon, you might be interested in.

import { Icon } from "@cockroachlabs/ui-components";
...
<Icon iconName="InfoCircle" />

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done.

{activeFilters ? resultsCountAndClear : resultsPerPageLabel}
</h4>
<h4 className={lastCleared}>{renderLastCleared(lastReset)}</h4>
<div>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Right now you are floating the children of this div. I think you could get the same effect by adding a "display:flex" to this container and not need to apply styles to the individual children.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done. 👍

@Azhng Azhng force-pushed the ui-reset-sql-stats branch from dcbf151 to 848763b Compare April 8, 2021 17:22
Copy link
Copy Markdown
Contributor

@nathanstilwell nathanstilwell left a comment

Choose a reason for hiding this comment

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

LGTM

@Azhng
Copy link
Copy Markdown
Contributor Author

Azhng commented Apr 8, 2021

TFTR!

@Azhng Azhng merged commit 3ea3a9a into cockroachdb:master Apr 8, 2021
craig bot pushed a commit to cockroachdb/cockroach that referenced this pull request Apr 15, 2021
63342: ui: add button to reset SQL stats r=Azhng a=Azhng

Release note (ui change): User can now reset SQL stats from DB Console.

Follow up to: cockroachdb/ui#271
Closes #33315 

63401: ui: e2e tests, improved cypress test for tsx, overview and db page r=nanduu04 a=nanduu04

Previously, only visual regression tests were written

Wrote cypress tests using the cypress-testing-library

[CRDB-2388](https://cockroachlabs.atlassian.net/browse/CRDB-2388?atlOrigin=eyJpIjoiOWIzNzY0ZjkzY2RhNGU3ZTgyZTUyOTY5MjE4ZmM5YmIiLCJwIjoiaiJ9)

Release note: None

63713: config: deflake TestMarshalableZoneConfigRoundTrip r=aayushshah15 a=aayushshah15

A previous change (#63079) made this test flakey by (needlessly) making
one of the marshalled fields a value derived from two other fields
(as opposed to just one). This commit fixes the flake.

Release note: None

63726: install: fix log flags in roachprod start r=knz a=tbg

I broke this in #63472, twofold.

1. if the version switch returned false, we weren't passing log flags
   at all, so there weren't any log files.
2. the version switch returned false on current master, since 21.1 is
   not tagged yet (we're still in the prerelease versions, currently
   at 21.1.0-alpha.3).

I tested that this fix works.

Release note: None


Co-authored-by: Azhng <archer.xn@gmail.com>
Co-authored-by: Nandu Pokhrel <nandup@cockroachlabs.com>
Co-authored-by: Aayush Shah <aayush.shah15@gmail.com>
Co-authored-by: Tobias Grieger <tobias.b.grieger@gmail.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants