Skip to content

Commit cb42a56

Browse files
authored
[CI][Benchmarks] Benchmarks dashboard fixes (#19361)
- Fix printing annotation with 'unknown' version - Hide Compute Runtime, Bench Hash, and Bench URL lines in points tooltips for undefined values
1 parent 5efbbb6 commit cb42a56

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

devops/scripts/benchmarks/html/chart-annotations.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,9 @@ function addVersionChangeAnnotations(data, options) {
8383

8484
// Create annotation for each unique change
8585
Object.values(changes).forEach(change => {
86+
// Skip if the change version is null or undefined
87+
if (!change.newVersion || change.newVersion === 'unknown') return;
88+
8689
const annotationId = `${change.date}`;
8790
// If annotation at a given date already exists, update it
8891
if (options.plugins.annotation.annotations[annotationId]) {

devops/scripts/benchmarks/html/scripts.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -144,9 +144,10 @@ function createChart(data, containerId, type) {
144144
`Value: ${point.y.toFixed(2)} ${data.unit}`,
145145
`Stddev: ${point.stddev.toFixed(2)} ${data.unit}`,
146146
`Git Hash: ${point.gitHash}`,
147-
`Compute Runtime: ${point.compute_runtime}`,
148-
`Bench hash: ${point.gitBenchHash?.substring(0, 7)}`,
149-
`Bench URL: ${point.gitBenchUrl}`,
147+
...(point.compute_runtime && point.compute_runtime !== 'null' && point.compute_runtime !== 'unknown' ?
148+
[`Compute Runtime: ${point.compute_runtime}`] : []),
149+
...(point.gitBenchHash ? [`Bench hash: ${point.gitBenchHash.substring(0, 7)}`] : []),
150+
...(point.gitBenchUrl ? [`Bench URL: ${point.gitBenchUrl}`] : []),
150151
];
151152
} else {
152153
return [`${context.dataset.label}:`,

0 commit comments

Comments
 (0)