-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
93207: pkg/ui: Add span details component to tracez_v2. r=benbardin a=benbardin This PR adds the "span details" and "raw trace" screens to the new tracez_v2 page. Previously, only the "snapshot details (i.e. list spans) screen existed on that page. The detailed span information page is where users will go to dig in to the specifics of a span. In particular, we'll display accumulated data on child spans of that page, helping navigate to problem segments more easily. Note that this PR brings the v2 page up to feature parity with the v1 page. Though the redesign is not yet complete, we'll be able to turn down the v1 page after this lands. This PR also modifies the route structure a little to encapsulate better. Release note: None <img width="1583" alt="Screen Shot 2022-12-07 at 1 52 26 PM" src="https://user-images.githubusercontent.com/261508/206270214-9708e298-cc8e-4a69-9554-8bfb8555277c.png"> <img width="1583" alt="Screen Shot 2022-12-07 at 1 51 59 PM" src="https://user-images.githubusercontent.com/261508/206270152-8d0a36f0-c64d-40bd-a47e-1573039e33ac.png"> <img width="1664" alt="Screen Shot 2022-12-05 at 12 12 41 PM" src="https://user-images.githubusercontent.com/261508/206269949-a62130c7-53cf-4655-84ae-8f6c42d4e66e.png"> Informs #83679 94661: coldata: fix recent flaky behavior r=yuzefovich a=yuzefovich In a just merged b353d18 when addressing the PR feedback I introduced a possibility of a crash in tests. In particular, this can occur if we choose to randomize `coldata.BatchSize` value larger than the default (or if the test explicitly overrides it). The problem is that `BatchSize()` can return different values in `init()` of `coldata` package and during the test runs, so we now use `MaxBatchSize` where applicable. Epic: None Release note: None Co-authored-by: Ben Bardin <[email protected]> Co-authored-by: Yahor Yuzefovich <[email protected]>
- Loading branch information
Showing
13 changed files
with
995 additions
and
213 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
73 changes: 73 additions & 0 deletions
73
pkg/ui/workspaces/cluster-ui/src/tracez/snapshot/rawTraceComponent.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
// Copyright 2022 The Cockroach Authors. | ||
// | ||
// Use of this software is governed by the Business Source License | ||
// included in the file licenses/BSL.txt. | ||
// | ||
// As of the Change Date specified in that file, in accordance with | ||
// the Business Source License, use of this software will be governed | ||
// by the Apache License, Version 2.0, included in the file | ||
// licenses/APL.txt. | ||
|
||
import { GetTraceResponse } from "src/api"; | ||
import Long from "long"; | ||
import { Loading } from "src/loading"; | ||
import React, { useEffect } from "react"; | ||
import classNames from "classnames/bind"; | ||
import styles from "../snapshot.module.scss"; | ||
const cx = classNames.bind(styles); | ||
|
||
export const RawTraceComponent: React.FC<{ | ||
nodeID: string; | ||
snapshotID: number; | ||
traceID: Long; | ||
rawTrace: GetTraceResponse; | ||
rawTraceLoading: boolean; | ||
rawTraceError?: Error; | ||
refreshRawTrace: (req: { | ||
nodeID: string; | ||
snapshotID: number; | ||
traceID: Long; | ||
}) => void; | ||
}> = props => { | ||
const { | ||
nodeID, | ||
snapshotID, | ||
traceID, | ||
rawTrace, | ||
rawTraceLoading, | ||
rawTraceError, | ||
refreshRawTrace, | ||
} = props; | ||
|
||
useEffect(() => { | ||
if (!(nodeID && snapshotID && traceID)) { | ||
return; | ||
} | ||
refreshRawTrace({ | ||
nodeID, | ||
snapshotID, | ||
traceID, | ||
}); | ||
}, [nodeID, snapshotID, traceID, refreshRawTrace]); | ||
|
||
return ( | ||
<Loading | ||
loading={rawTraceLoading} | ||
page={"raw trace"} | ||
error={rawTraceError} | ||
render={() => { | ||
return ( | ||
<> | ||
<section | ||
data-testid="raw-trace-component" | ||
className={cx("span-section")} | ||
> | ||
<pre>{rawTrace?.serialized_recording}</pre> | ||
</section> | ||
<div className={cx("bottom-padding")} /> | ||
</> | ||
); | ||
}} | ||
/> | ||
); | ||
}; |
Oops, something went wrong.