Skip to content

Commit cd59152

Browse files
Merge pull request #787 from lqd/online-profilers
detailed-query page: add links to load the crox profile in speedscope and the FF profiler
2 parents 451bf0d + 8c267ed commit cd59152

File tree

1 file changed

+23
-1
lines changed

1 file changed

+23
-1
lines changed

site/static/detailed-query.html

+23-1
Original file line numberDiff line numberDiff line change
@@ -128,21 +128,43 @@ <h3 id="title"></h3>
128128
let url = dl_url(commit, bench, run);
129129
return `<a href="${url}">raw</a>`;
130130
};
131+
let processed_url = (commit, bench, run, ty) => {
132+
return `/perf/processed-self-profile?commit=${commit}&benchmark=${bench}&run_name=${run}&type=${ty}`;
133+
};
131134
let processed_link = (commit, bench, run, ty) => {
132-
let url = `/perf/processed-self-profile?commit=${commit}&benchmark=${bench}&run_name=${run}&type=${ty}`;
135+
let url = processed_url(commit, bench, run, ty);
133136
return `<a href="${url}">${ty}</a>`;
134137
};
138+
let processed_crox_url = (commit, bench, run) => {
139+
let crox_url = window.location.origin + processed_url(commit, bench, run, "crox");
140+
return encodeURIComponent(crox_url);
141+
};
142+
let speedscope_link = (commit, bench, run) => {
143+
let benchmark_name = `${bench} run ${run}`;
144+
let crox_url = processed_crox_url(commit, bench, run);
145+
let speedscope_url = `https://www.speedscope.app/#profileURL=${crox_url}&title=${encodeURIComponent(benchmark_name)}`;
146+
return `<a href="${speedscope_url}">speedscope.app</a>`;
147+
};
148+
let firefox_profiler_link = (commit, bench, run) => {
149+
let crox_url = processed_crox_url(commit, bench, run);
150+
let ff_url = `https://profiler.firefox.com/from-url/${crox_url}/marker-chart/?v=5`;
151+
return `<a href="${ff_url}">Firefox profiler</a>`;
152+
};
135153
txt = `Download/view
136154
${dl_link(state.commit, state.benchmark, state.run_name)},
137155
${processed_link(state.commit, state.benchmark, state.run_name, "flamegraph")},
138156
${processed_link(state.commit, state.benchmark, state.run_name, "crox")}
157+
(${speedscope_link(state.commit, state.benchmark, state.run_name)},
158+
${firefox_profiler_link(state.commit, state.benchmark, state.run_name)})
139159
results for ${state.commit.substring(0, 10)}`;
140160
if (state.base_commit) {
141161
txt += "<br>";
142162
txt += `Download/view
143163
${dl_link(state.base_commit, state.benchmark, state.run_name)},
144164
${processed_link(state.base_commit, state.benchmark, state.run_name, "flamegraph")},
145165
${processed_link(state.base_commit, state.benchmark, state.run_name, "crox")}
166+
(${speedscope_link(state.base_commit, state.benchmark, state.run_name)},
167+
${firefox_profiler_link(state.base_commit, state.benchmark, state.run_name)})
146168
results for ${state.base_commit.substring(0, 10)}`;
147169
}
148170
document.querySelector("#raw-urls").innerHTML = txt;

0 commit comments

Comments
 (0)