Skip to content

Commit

Permalink
Add overview table for missing data (#168)
Browse files Browse the repository at this point in the history
  • Loading branch information
smarr authored Jul 18, 2023
2 parents ff8f752 + 25c70ce commit 6826fcf
Show file tree
Hide file tree
Showing 6 changed files with 58 additions and 26 deletions.
40 changes: 28 additions & 12 deletions src/backend/compare/html/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,6 @@ <h4 class="alert-heading">Revisions Not Found</h4>
</div>
{% } %}

{% if (it.noData) { %}
<div class="compare">
<h3>Issue with Unexpected Data</h3>
<p>The data provided for baseline and change does not seem to have a common benchmarks/executors.</p>
<p>This is known to happen for instance, when benchmarks or parameters are changed, or executors renamed.</p>
</div>
{% } %}

{% if (it.revisionFound) { %}
<div id="version-details" class="compare">
<h2>Version Details</h2>
Expand Down Expand Up @@ -112,10 +104,34 @@ <h2>Version Details</h2>

{% if (it.notInBoth) { %}
<h3>Changes in Benchmark Set</h3>
TODO
show table with
commitid, exe, suite, bench, varvalue, cores, inputsize, extraargs

<table class="table table-sm">
<thead>
<tr>
<th scope="col">Commit</th>
<th scope="col">Executor</th>
<th scope="col">Suite</th>
<th scope="col">Benchmark</th>
<th scope="col">Variable Values</th>
<th scope="col">Cores</th>
<th scope="col">Input Size</th>
<th scope="col">Extra Arguments</th>
</tr>
</thead>
<tbody>
{% for (const m of it.stats.acrossVersions.missing) { %}
<tr>
<td>{%= m.commitId.substring(0, 6) %}</td>
<td>{%= m.e %}</td>
<td>{%= m.s %}</td>
<td>{%= m.b %}</td>
<td>{%= m.v %}</td>
<td>{%= m.c %}</td>
<td>{%= m.i %}</td>
<td>{%= m.ea %}</td>
</tr>
{% } %}
</tbody>
</table>
{% } %}

{%- include('compare-versions.html', {...it.stats, config: it.config}) %}
Expand Down
31 changes: 24 additions & 7 deletions src/backend/compare/prep-data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ import {
CompareNavPartial,
CompareStatsRow,
CompareStatsTable,
CompareViewWithData
CompareViewWithData,
MissingBenchmark
} from '../../shared/view-types.js';
import {
calculateInlinePlotHeight,
Expand Down Expand Up @@ -632,8 +633,14 @@ export async function calculateAllChangeStatisticsAndInlinePlots(
criteria: Map<string, ComparisonStatsWithUnit> | null = null,
outputFolder: string | null = null,
plotName: string | null = null
): Promise<{ numRunConfigs: number; comparisonData: ByExeSuiteComparison }> {
): Promise<{
numRunConfigs: number;
comparisonData: ByExeSuiteComparison;
missing: MissingBenchmark[];
}> {
const comparisonData = new Map<string, Map<string, CompareStatsTable>>();
const missing: MissingBenchmark[] = [];

// those two counts are likely always the same,
// but for the moment, I'll keep them separate
let lastPlotId = 0;
Expand Down Expand Up @@ -663,6 +670,16 @@ export async function calculateAllChangeStatisticsAndInlinePlots(
plotName
);

for (const row of result.stats) {
if (row.missing) {
for (const m of row.missing) {
if (m.criterion.name === 'total') {
missing.push({ ...row.benchId, ...m });
}
}
}
}

lastPlotId = result.lastPlotId;
numRunConfigs += result.numRunConfigs;

Expand All @@ -672,7 +689,7 @@ export async function calculateAllChangeStatisticsAndInlinePlots(
bySuiteCompare.set(suite, byBenchmark);
}
}
return { numRunConfigs, comparisonData };
return { numRunConfigs, comparisonData, missing };
}

/**
Expand Down Expand Up @@ -1072,8 +1089,7 @@ export async function prepareCompareView(
navigation,
hasExeComparison: navigation.navExeComparison.suites.length > 0,

noData: false, // TODO: need to derive this from one of the stats details
notInBoth: null, // TODO: need to get this out of the stats calculations
notInBoth: allStats.acrossVersions.missing.length > 0,

stats: { ...allStats, environments },
config: {
Expand Down Expand Up @@ -1140,7 +1156,7 @@ export async function calculateAllStatisticsAndRenderPlots(
const criteriaAcrossVersions = new Map<string, ComparisonStatsWithUnit>();
const criteriaAcrossExes = new Map<string, ComparisonStatsWithUnit>();

const { numRunConfigs, comparisonData } =
const { numRunConfigs, comparisonData, missing } =
await calculateAllChangeStatisticsAndInlinePlots(
byExeSuiteBench,
hasProfiles,
Expand Down Expand Up @@ -1184,7 +1200,8 @@ export async function calculateAllStatisticsAndRenderPlots(
overviewPngUrl: files.png,
overviewSvgUrls: files.svg
},
allMeasurements: comparisonData
allMeasurements: comparisonData,
missing
},
acrossExes
};
Expand Down
6 changes: 4 additions & 2 deletions src/shared/view-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,8 @@ export interface MissingData {
criterion: CriterionData;
}

export type MissingBenchmark = BenchmarkId & MissingData;

export interface CompareStatsRow {
benchId: BenchmarkId;
details: RunDetails;
Expand Down Expand Up @@ -164,6 +166,7 @@ export interface AllStats {
acrossVersions: {
summary: StatsSummary;
allMeasurements: ByExeSuiteComparison;
missing: MissingBenchmark[];
};
acrossExes: BySuiteComparison;
}
Expand Down Expand Up @@ -207,8 +210,7 @@ export interface CompareViewWithoutData extends CompareViewBasics {
export interface CompareViewWithData extends CompareViewBasics {
revisionFound: true;

noData: boolean;
notInBoth: any; // TODO
notInBoth: boolean;

base: RevisionData;
change: RevisionData;
Expand Down
3 changes: 2 additions & 1 deletion tests/backend/compare/compare-view.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,8 @@ describe('Compare View Parts', () => {
const data: CompareVersionsPartial = {
acrossVersions: {
allMeasurements: new Map(),
summary: <any>{}
summary: <any>{},
missing: []
},
acrossExes: new Map(),
environments,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,6 @@ <h3>Comparing <a href="repo-url/compare/4dff7e...bc1105">4dff7e with bc1105</a><





<div id="version-details" class="compare">
<h2>Version Details</h2>
<dl class="row">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,6 @@ <h3>Comparing <a href="repo-url/compare/5820ec...5fa4bd">5820ec with 5fa4bd</a><





<div id="version-details" class="compare">
<h2>Version Details</h2>
<dl class="row">
Expand Down

0 comments on commit 6826fcf

Please sign in to comment.