Skip to content

Commit

Permalink
ui: remove timeScale update from statement details link from insight …
Browse files Browse the repository at this point in the history
…details

Fixes cockroachdb#97952.

This commit removes the setTimeScale call from the StatementDetailsLink function.
Navigating to the Statement Details page from the Insights Details page will no
longer set the global time scale to 0 minutes.

Epic: none

Release note: None
  • Loading branch information
ericharmeling committed Mar 7, 2023
1 parent 709d765 commit 4b95c34
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export function makeInsightDetailsColumns(
),
cell: (item: ContentionEvent) =>
item.stmtInsightEvent
? StatementDetailsLink(item.stmtInsightEvent, setTimeScale)
? StatementDetailsLink(item.stmtInsightEvent)
: item.waitingStmtFingerprintID,
sort: (item: ContentionEvent) => item.waitingStmtFingerprintID,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ export const StatementInsightDetailsOverviewTab: React.FC<
/>
<SummaryCardItem
label="Statement Fingerprint ID"
value={StatementDetailsLink(insightDetails, setTimeScale)}
value={StatementDetailsLink(insightDetails)}
/>
</SummaryCard>
</Col>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,7 @@ export function makeStatementInsightsColumns(
{
name: "statementFingerprintID",
title: insightsTableTitles.fingerprintID(execType),
cell: (item: StmtInsightEvent) =>
StatementDetailsLink(item, setTimeScale),
cell: (item: StmtInsightEvent) => StatementDetailsLink(item),
sort: (item: StmtInsightEvent) => item.statementFingerprintID,
showByDefault: true,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ export function TransactionDetailsLink(

export function StatementDetailsLink(
insightDetails: StmtInsightEvent,
setTimeScale: (tw: TimeScale) => void,
): React.ReactElement {
const linkProps = {
statementFingerprintID: HexStringToInt64String(
Expand All @@ -50,18 +49,9 @@ export function StatementDetailsLink(
appNames: [insightDetails.application],
implicitTxn: insightDetails.implicitTxn,
};
const timeScale: TimeScale = {
windowSize: moment.duration(insightDetails.elapsedTimeMillis),
fixedWindowEnd: insightDetails.endTime,
sampleSize: moment.duration(1, "hour"),
key: "Custom",
};

return (
<Link
to={StatementLinkTarget(linkProps)}
onClick={() => setTimeScale(timeScale)}
>
<Link to={StatementLinkTarget(linkProps)}>
<div>{String(insightDetails.statementFingerprintID)}</div>
</Link>
);
Expand Down

0 comments on commit 4b95c34

Please sign in to comment.