Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions scripts/benchmark/benchmark-history.ts
Original file line number Diff line number Diff line change
Expand Up @@ -524,11 +524,14 @@ export const createBenchmarkHistoryDashboard = (
const runs = [...allRuns].sort((left, right) =>
left.createdAt.localeCompare(right.createdAt),
)
const points = getDashboardPoints(runs.slice(-DASHBOARD_RUN_LIMIT)).map(
const totalRunCount = runs.length
const dashboardRuns = runs.slice(-DASHBOARD_RUN_LIMIT)
const points = getDashboardPoints(dashboardRuns).map(
({ samples: _samples, ...point }) => point,
)
const data = JSON.stringify({
runs,
runs: dashboardRuns,
totalRunCount,
points,
dashboardRunLimit: DASHBOARD_RUN_LIMIT,
})
Expand Down Expand Up @@ -786,7 +789,7 @@ function renderHeader() {
}
const datasets = new Set(dashboardData.points.map((point) => point.datasetName))
getRequiredElement('header-facts').innerHTML =
'<span class="fact"><strong>' + dashboardData.runs.length + '</strong> stored runs</span>' +
'<span class="fact"><strong>' + (dashboardData.totalRunCount ?? dashboardData.runs.length) + '</strong> stored runs</span>' +
'<span class="fact"><strong>' + Math.min(dashboardData.dashboardRunLimit, dashboardData.runs.length) +
'</strong> runs charted</span><span class="fact"><strong>' + datasets.size +
'</strong> datasets</span>' + (latestRun
Expand Down
3 changes: 2 additions & 1 deletion tests/benchmark-history.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,8 @@ test("benchmark history retains full sample records and embeds a self-contained
expect(parsedDashboardData.points).toHaveLength(2)
expect(parsedDashboardData.points[0]).not.toHaveProperty("samples")
expect(parsedDashboardData.runs[0]?.report.tests).toHaveLength(2)
expect(parsedFullDashboardData.runs).toHaveLength(101)
expect(parsedFullDashboardData.runs).toHaveLength(100)
expect(parsedFullDashboardData.totalRunCount).toBe(101)
expect(parsedFullDashboardData.points).toHaveLength(100)
expect(parsedFullDashboardData.points[0]?.runId).toBe("2-1")
expect(dashboard).not.toContain("Largest regressions in view")
Expand Down