Skip to content

Commit

Permalink
ui: add link on txn insight details fingerprint
Browse files Browse the repository at this point in the history
Previously, the fingerprint id showing on the
contention table inside the transaction insights details
didn't have a link to the fingerprint details page.
This commit adds the link, including the proper setTimeScale
to use the start time of the selected transaction.

Fixes cockroachdb#91291

Release note (ui change): Add link on fingerprint ID
on high contention table inside Transaction Insights
Details page.
  • Loading branch information
maryliag committed Dec 2, 2022
1 parent b137871 commit 4c4017e
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,22 @@ import React, { useState } from "react";
import { ColumnDescriptor, SortedTable, SortSetting } from "src/sortedtable";
import { DATE_FORMAT, Duration } from "src/util";
import { EventExecution, InsightExecEnum } from "../types";
import { insightsTableTitles, QueriesCell } from "../workloadInsights/util";
import {
insightsTableTitles,
QueriesCell,
TransactionDetailsLink,
} from "../workloadInsights/util";
import { TimeScale } from "../../timeScaleDropdown";

interface InsightDetailsTableProps {
data: EventExecution[];
execType: InsightExecEnum;
setTimeScale?: (tw: TimeScale) => void;
}

export function makeInsightDetailsColumns(
execType: InsightExecEnum,
setTimeScale: (tw: TimeScale) => void,
): ColumnDescriptor<EventExecution>[] {
return [
{
Expand All @@ -32,7 +39,12 @@ export function makeInsightDetailsColumns(
{
name: "fingerprintID",
title: insightsTableTitles.fingerprintID(execType),
cell: (item: EventExecution) => String(item.fingerprintID),
cell: (item: EventExecution) =>
TransactionDetailsLink(
item.fingerprintID,
item.startTime,
setTimeScale,
),
sort: (item: EventExecution) => item.fingerprintID,
},
{
Expand Down Expand Up @@ -83,7 +95,7 @@ export function makeInsightDetailsColumns(
export const WaitTimeDetailsTable: React.FC<
InsightDetailsTableProps
> = props => {
const columns = makeInsightDetailsColumns(props.execType);
const columns = makeInsightDetailsColumns(props.execType, props.setTimeScale);
const [sortSetting, setSortSetting] = useState<SortSetting>({
ascending: false,
columnTitle: "contention",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,7 @@ export const TransactionInsightDetails: React.FC<
<WaitTimeDetailsTable
data={blockingExecutions}
execType={insightDetails.execType}
setTimeScale={setTimeScale}
/>
</div>
</Col>
Expand Down

0 comments on commit 4c4017e

Please sign in to comment.