Skip to content

Commit 7ba0631

Browse files
committed
Add front end changes exposing artifact sizes
1 parent 28aa733 commit 7ba0631

File tree

1 file changed

+42
-3
lines changed

1 file changed

+42
-3
lines changed

site/static/detailed-query.html

Lines changed: 42 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,14 @@
5959
border-radius: 3px;
6060
user-select: all;
6161
}
62+
63+
#artifact-table th {
64+
text-align: center;
65+
}
66+
67+
#artifact-table td {
68+
padding: 0 0 0 20px;
69+
}
6270
</style>
6371
</head>
6472

@@ -70,6 +78,18 @@
7078
<div id="content">
7179
<h3 id="title"></h3>
7280
<div id="raw-urls"></div>
81+
<h4>Artifact Size</h4>
82+
<table id="artifact-table">
83+
<thead>
84+
<tr id="table-header">
85+
<th>Artifact</th>
86+
<th>Size</th>
87+
<th>Size delta</th>
88+
</tr>
89+
</thead>
90+
<tbody id="artifact-body">
91+
</tbody>
92+
</table>
7393
<p>'Time (%)' is the percentage of the cpu-clock time spent on this query (we do not use
7494
wall-time as we want to account for parallelism).</p>
7595
<p>Executions do not include cached executions.</p>
@@ -152,7 +172,7 @@ <h3 id="title"></h3>
152172
let processed_url = (commit, bench, run, ty) => {
153173
return `/perf/processed-self-profile?commit=${commit}&benchmark=${bench}&run_name=${run}&type=${ty}`;
154174
};
155-
let processed_link = (commit, {benchmark, run_name}, ty) => {
175+
let processed_link = (commit, { benchmark, run_name }, ty) => {
156176
let url = processed_url(commit, benchmark, run_name, ty);
157177
return `<a href="${url}">${ty}</a>`;
158178
};
@@ -313,7 +333,7 @@ <h3 id="title"></h3>
313333
fmt_delta(
314334
to_seconds(cur.incremental_load_time),
315335
to_seconds(delta.incremental_load_time),
316-
false,
336+
false,
317337
),
318338
true).classList.add("incr");
319339
} else {
@@ -322,6 +342,25 @@ <h3 id="title"></h3>
322342
table.appendChild(row);
323343
idx += 1;
324344
}
345+
346+
let artifactTable = document.getElementById("artifact-body");
347+
function td(row, content) {
348+
let td = document.createElement("td");
349+
td.innerHTML = content;
350+
row.appendChild(td);
351+
return td;
352+
}
353+
for (let [idx, element] of data.profile.artifact_sizes.entries()) {
354+
let row = document.createElement("tr");
355+
const label = td(row, element.label);
356+
label.style.textAlign = "center";
357+
td(row, element.bytes);
358+
if (data.base_profile_delta && data.base_profile_delta.artifact_sizes[idx]) {
359+
td(row, data.base_profile_delta.artifact_sizes[idx].bytes);
360+
}
361+
artifactTable.appendChild(row);
362+
idx += 1;
363+
}
325364
}
326365

327366
function to_object(element) {
@@ -368,4 +407,4 @@ <h3 id="title"></h3>
368407
</script>
369408
</body>
370409

371-
</html>
410+
</html>

0 commit comments

Comments
 (0)