Skip to content

Commit

Permalink
Reworked how warmup plot is going to work: render in the browser
Browse files Browse the repository at this point in the history
The R setup would render this immediately, but the plots are rearely used, so, instead of doing it at report generation time, we can leave it to on-demand requesting of data and rendering.
  • Loading branch information
smarr committed May 6, 2023
1 parent 88e744f commit dbfa19d
Show file tree
Hide file tree
Showing 9 changed files with 30 additions and 17 deletions.
3 changes: 2 additions & 1 deletion src/views/compare.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,12 +107,13 @@ function fetchProfile(projectName: string, change, runId, trialId, jqInsert) {
});
}

function insertProfiles(e) {
function insertProfiles(e): void {
const projectName = <string>$('#project-name').attr('value');
const jqButton = $(e.target);
let profileInsertTarget = jqButton.parent().parent();
jqButton.remove();

// format is serialized in data-format.ts:dataSeriesIds()
const profilesIds = jqButton.data('content').split(',');
for (const ids of profilesIds) {
const [change, runId, trialId] = ids.split('/');
Expand Down
16 changes: 8 additions & 8 deletions src/views/compare/stats-row-buttons-info.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@
data-content="{%= f.formatEnvironment(d.envId, it.environments) %}"></button>
{% }

if (d.warmupPlotUrl) {
%}<button type="button" class="btn btn-sm btn-light btn-expand" data-img="{%= d.warmupPlotUrl %}"></button>
{% }
if (d.hasWarmup) {
%}<button type="button" class="btn btn-sm btn-light btn-warmup" data-content="{%= f.dataSeriesIds(d.dataSeries) %}"></button>
{%
}

if (d.profileIds) {
const p = d.profileIds;
%}<button type="button" class="btn btn-sm btn-profile" data-content="{%= p.base.commitId %}/{%= p.base.runId %}/{%= p.base.trialId %},{%= p.change.commitId %}/{%= p.change.runId %}/{%= p.change.trialId %}"></button>{%
if (d.hasProfiles) {
%}<button type="button" class="btn btn-sm btn-profile" data-content="{%= f.dataSeriesIds(d.dataSeries) %}"></button>
{%
}
%}
<button type="button" class="btn btn-sm btn-timeline" data-content='{%- JSON.stringify(
%}<button type="button" class="btn btn-sm btn-timeline" data-content='{%- JSON.stringify(
f.benchmarkId(b.b, b.e, b.s, b.v, d.numV, b.c, d.numC, b.i, d.numI, b.ea, d.numEa)) %}'></button>
19 changes: 12 additions & 7 deletions src/views/view-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,25 +54,30 @@ export interface CompareStatsRowAcrossVersionsPartial {
dataFormatters: DataFormat;
}

export interface ProfileId {
commitId: string;
/**
* Identifies the set of measurements of a specific run, i.e., a concrete
* benchmark execution, and a specific trial, i.e., in a specific environment.
*/
export interface DataSeriesId {
commitId: string; // this one is a bit redundant, it's implied by the trialId
runId: number;
trialId: number;
}

export interface ProfileIds {
base: ProfileId;
change: ProfileId;
export interface DataSeriesVersionComparison {
base: DataSeriesId;
change: DataSeriesId;
}

export interface DetailedInfo {
cmdline: string;

envId: number;

warmupPlotUrl?: string;
hasWarmup: boolean;
hasProfiles: boolean;

profileIds?: ProfileIds;
dataSeries?: DataSeriesVersionComparison;

/** Number of VarValues */
numV: number;
Expand Down
4 changes: 3 additions & 1 deletion tests/views/compare-view.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,9 @@ const environments: Environment[] = [
const details: DetailedInfo = {
cmdline: 'som/some-command with args',
envId: 1,
profileIds: {
hasProfiles: true,
hasWarmup: true,
dataSeries: {
base: {
commitId: '123456',
runId: 1,
Expand Down
1 change: 1 addition & 0 deletions tests/views/expected-results/compare-versions.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ <h3 id="suite1-exe1">suite1</h3>
data-content="<code>som/some-command with args</code>"></button>
<button type="button" class="btn btn-sm btn-environment btn-popover"
data-content="MyHost | Linux | 121kb | Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz | 3GHz"></button>
<button type="button" class="btn btn-sm btn-light btn-warmup" data-content="123456/1/2,123457/3/4"></button>
<button type="button" class="btn btn-sm btn-profile" data-content="123456/1/2,123457/3/4"></button>
<button type="button" class="btn btn-sm btn-timeline" data-content='{"b":"my-benchmark","e":"exe1","s":"suite2"}'></button></td>
</tr></tbody>
Expand Down
1 change: 1 addition & 0 deletions tests/views/expected-results/stats-row-button-info.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@
data-content="<code>som/some-command with args</code>"></button>
<button type="button" class="btn btn-sm btn-environment btn-popover"
data-content="MyHost | Linux | 121kb | Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz | 3GHz"></button>
<button type="button" class="btn btn-sm btn-light btn-warmup" data-content="123456/1/2,123457/3/4"></button>
<button type="button" class="btn btn-sm btn-profile" data-content="123456/1/2,123457/3/4"></button>
<button type="button" class="btn btn-sm btn-timeline" data-content='{"b":"my-benchmark","e":"exe1","s":"suite2"}'></button>
1 change: 1 addition & 0 deletions tests/views/expected-results/stats-row-exe.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
data-content="<code>som/some-command with args</code>"></button>
<button type="button" class="btn btn-sm btn-environment btn-popover"
data-content="MyHost | Linux | 121kb | Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz | 3GHz"></button>
<button type="button" class="btn btn-sm btn-light btn-warmup" data-content="123456/1/2,123457/3/4"></button>
<button type="button" class="btn btn-sm btn-profile" data-content="123456/1/2,123457/3/4"></button>
<button type="button" class="btn btn-sm btn-timeline" data-content='{"b":"my-benchmark","e":"exe1","s":"suite2"}'></button></td>
</tr>
1 change: 1 addition & 0 deletions tests/views/expected-results/stats-row-version.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
data-content="<code>som/some-command with args</code>"></button>
<button type="button" class="btn btn-sm btn-environment btn-popover"
data-content="MyHost | Linux | 121kb | Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz | 3GHz"></button>
<button type="button" class="btn btn-sm btn-light btn-warmup" data-content="123456/1/2,123457/3/4"></button>
<button type="button" class="btn btn-sm btn-profile" data-content="123456/1/2,123457/3/4"></button>
<button type="button" class="btn btn-sm btn-timeline" data-content='{"b":"my-benchmark","e":"exe1","s":"suite2"}'></button></td>
</tr>
1 change: 1 addition & 0 deletions tests/views/expected-results/stats-tbl.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
data-content="<code>som/some-command with args</code>"></button>
<button type="button" class="btn btn-sm btn-environment btn-popover"
data-content="MyHost | Linux | 121kb | Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz | 3GHz"></button>
<button type="button" class="btn btn-sm btn-light btn-warmup" data-content="123456/1/2,123457/3/4"></button>
<button type="button" class="btn btn-sm btn-profile" data-content="123456/1/2,123457/3/4"></button>
<button type="button" class="btn btn-sm btn-timeline" data-content='{"b":"my-benchmark","e":"exe1","s":"suite2"}'></button></td>
</tr></tbody>
Expand Down

0 comments on commit dbfa19d

Please sign in to comment.