-
-
Notifications
You must be signed in to change notification settings - Fork 73
Add timings to stage view #814
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
Changes from 1 commit
b3e5dd8
ffd9f8e
1924246
2d49427
248cebd
14292bf
38581e1
6864ef1
e0d0683
9bc3cda
47495ae
f2da90d
2e39bc7
1f4ad27
c29e548
344081d
b8dc2bb
7c7c421
63d237c
e3aa025
c8a6416
ddad509
324c87e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -23,7 +23,6 @@ export default function SingleRun({ run, currentJobPath }: SingleRunProps) { | |
|
|
||
| const layout: LayoutInfo = { | ||
| ...defaultLayout, | ||
| nodeSpacingH: 45, | ||
| }; | ||
|
|
||
| function Changes() { | ||
|
|
@@ -44,9 +43,9 @@ export default function SingleRun({ run, currentJobPath }: SingleRunProps) { | |
| } | ||
|
|
||
| return ( | ||
| <div className="pgv-single-run"> | ||
| <div className="pgv-single-run" style={{ height: "100px" }}> | ||
|
||
| <div> | ||
| <a href={currentJobPath + run.id} className="pgw-user-specified-text"> | ||
| <a href={currentJobPath + run.id} className="pgv-user-specified-text"> | ||
| <StatusIcon status={run.result} /> | ||
| {run.displayName} | ||
| <span> | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,19 +4,19 @@ | |
| align-items: center; | ||
|
|
||
| // This is hacky - the pipeline graph is too tall and isn't centered | ||
| .PWGx-PipelineGraph-container { | ||
| height: 36px; | ||
|
|
||
| & > div { | ||
| margin-top: -36px; | ||
| } | ||
| } | ||
| //.PWGx-PipelineGraph-container { | ||
timja marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| // height: 36px; | ||
| // | ||
| // & > div { | ||
| // margin-top: -36px; | ||
| // } | ||
| //} | ||
|
|
||
| &:last-of-type { | ||
| border-bottom: none; | ||
| } | ||
|
|
||
| .pgw-user-specified-text { | ||
| .pgv-user-specified-text { | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. typo I noticed |
||
| display: grid; | ||
| grid-template-columns: auto 1fr; | ||
| align-items: start; | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -134,6 +134,7 @@ export function layoutGraph( | |
| positionNodes(allNodeColumns, layout); | ||
|
|
||
| const bigLabels = createBigLabels(allNodeColumns, collapsed); | ||
| const timings = createTimings(allNodeColumns, collapsed); | ||
| const smallLabels = createSmallLabels(allNodeColumns, collapsed); | ||
| const branchLabels = createBranchLabels(allNodeColumns, collapsed); | ||
| const connections = createConnections(allNodeColumns); | ||
|
|
@@ -146,9 +147,7 @@ export function layoutGraph( | |
| for (const row of column.rows) { | ||
| for (const node of row) { | ||
| measuredWidth = Math.max(measuredWidth, node.x + nodeSpacingH / 2); | ||
| measuredHeight = collapsed | ||
| ? 60 | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. may need re-adding behind setting |
||
| : Math.max(measuredHeight, node.y + ypStart); | ||
| measuredHeight = Math.max(measuredHeight, node.y + ypStart); | ||
| } | ||
| } | ||
| } | ||
|
|
@@ -157,6 +156,7 @@ export function layoutGraph( | |
| nodeColumns: allNodeColumns, | ||
| connections, | ||
| bigLabels, | ||
| timings, | ||
| smallLabels, | ||
| branchLabels, | ||
| measuredWidth, | ||
|
|
@@ -340,12 +340,16 @@ function createBigLabels( | |
| ): Array<NodeLabelInfo> { | ||
| const labels: Array<NodeLabelInfo> = []; | ||
|
|
||
| if (collapsed) { | ||
| return []; | ||
| } | ||
| // if (collapsed) { | ||
|
||
| // return []; | ||
| // } | ||
|
|
||
| for (const column of columns) { | ||
| const node = column.rows[0][0]; | ||
|
|
||
| if (node.isPlaceholder && node.type === "counter") { | ||
| continue; | ||
| } | ||
| const stage = column.topStage; | ||
| const text = stage ? stage.name : node.name; | ||
| const key = "l_b_" + node.key; | ||
|
|
@@ -369,6 +373,48 @@ function createBigLabels( | |
| return labels; | ||
| } | ||
|
|
||
| /** | ||
| * Generate label descriptions for big labels at the top of each column | ||
| */ | ||
| function createTimings( | ||
| columns: Array<NodeColumn>, | ||
| collapsed: boolean, | ||
| ): Array<NodeLabelInfo> { | ||
| const labels: Array<NodeLabelInfo> = []; | ||
|
|
||
| // if (collapsed) { | ||
|
||
| // return []; | ||
| // } | ||
|
|
||
| for (const column of columns) { | ||
| const node = column.rows[0][0]; | ||
| if (node.isPlaceholder) { | ||
| continue; | ||
| } | ||
| const stage = column.topStage; | ||
|
|
||
| const text = stage?.totalDurationMillis + ""; | ||
| if (!text) { | ||
| // shouldn't happen | ||
| continue; | ||
| } | ||
| const key = "l_t_" + node.key; | ||
|
|
||
| console.log(stage, node); | ||
|
|
||
| labels.push({ | ||
| x: column.centerX, | ||
| y: node.y + 55, | ||
| node, | ||
| stage, | ||
| text, | ||
| key, | ||
| }); | ||
| } | ||
|
|
||
| return labels; | ||
| } | ||
|
|
||
| /** | ||
| * Generate label descriptions for small labels under the nodes | ||
| */ | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,10 +1,11 @@ | ||
| import { CSSProperties } from "react"; | ||
|
|
||
| import { sequentialStagesLabelOffset } from "../PipelineGraphLayout.ts"; | ||
| import { LayoutInfo, NodeLabelInfo } from "../PipelineGraphModel.tsx"; | ||
| import { TooltipLabel } from "./convertLabelToTooltip.tsx"; | ||
| import { nodeStrokeWidth } from "./StatusIcons.tsx"; | ||
| import { TruncatingLabel } from "./TruncatingLabel.tsx"; | ||
| import { Total } from "../../../../common/utils/timings.tsx"; | ||
|
|
||
| interface RenderBigLabelProps { | ||
| details: NodeLabelInfo; | ||
|
|
@@ -72,6 +73,61 @@ | |
| ); | ||
| } | ||
|
|
||
| /** | ||
| * Generate the Component for a big label | ||
| */ | ||
| export function TimingsLabel({ | ||
| details, | ||
| layout, | ||
| measuredHeight, | ||
| isSelected, | ||
| }: RenderBigLabelProps) { | ||
| const { nodeSpacingH, labelOffsetV, connectorStrokeWidth, ypStart } = layout; | ||
|
|
||
| const labelWidth = nodeSpacingH - connectorStrokeWidth * 2; | ||
| const labelHeight = ypStart - labelOffsetV; | ||
| const labelOffsetH = Math.floor(labelWidth / -2); | ||
|
|
||
| // These are about layout more than appearance, so they should probably remain inline | ||
| const timingsLabelStyle: CSSProperties = { | ||
| position: "absolute", | ||
| width: labelWidth, | ||
| maxHeight: labelHeight + "px", | ||
| textAlign: "center", | ||
| marginLeft: labelOffsetH, | ||
| }; | ||
|
|
||
| const x = details.x; | ||
| const bottom = measuredHeight - details.y + labelOffsetV; | ||
|
|
||
| // These are about layout more than appearance, so they're inline | ||
| const style: CSSProperties = { | ||
| ...timingsLabelStyle, | ||
| bottom: bottom + "px", | ||
| left: x + "px", | ||
| }; | ||
|
|
||
| const classNames = ["PWGx-pipeline-big-label"]; | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. could review if all these classes and features are needed, its mostly a copy of big label |
||
| if (isSelected) { | ||
| classNames.push("PWGx-pipeline-big-label--selected"); | ||
| } | ||
| if (details.stage && details.stage.synthetic) { | ||
timja marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| classNames.push("pgv-graph-node--synthetic"); | ||
| } | ||
| if (details.stage?.skeleton) { | ||
| classNames.push("pgv-graph-node--skeleton"); | ||
| } | ||
| if (details.node.id < 0) { | ||
| classNames.push("pgv-graph-node--skeleton"); | ||
| } | ||
|
|
||
| return ( | ||
| <div className={classNames.join(" ")} style={style} key={details.key}> | ||
| <Total ms={parseInt(details.text, 10)} /> | ||
| </div> | ||
| ); | ||
| } | ||
|
|
||
| interface SmallLabelProps { | ||
| details: NodeLabelInfo; | ||
| layout: LayoutInfo; | ||
|
|
||
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.
needs to be re-added behind a setting, possibly we can calculate it based on longest stage name too so we don't have to lose all the value by shortening it