Skip to content

Commit 03d5941

Browse files
authored
Merge pull request #2330 from Kobzol/profiles-in-commands
Parse profiles in GitHub commands
2 parents e395e6f + 7170a6a commit 03d5941

File tree

3 files changed

+93
-40
lines changed

3 files changed

+93
-40
lines changed

database/src/lib.rs

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,17 @@ impl Profile {
232232
pub fn default_profiles() -> Vec<Self> {
233233
vec![Profile::Check, Profile::Debug, Profile::Doc, Profile::Opt]
234234
}
235+
236+
pub fn all_values() -> &'static [Self] {
237+
&[
238+
Self::Check,
239+
Self::Debug,
240+
Self::Opt,
241+
Self::Doc,
242+
Self::DocJson,
243+
Self::Clippy,
244+
]
245+
}
235246
}
236247

237248
impl std::str::FromStr for Profile {
@@ -1023,11 +1034,7 @@ impl BenchmarkRequest {
10231034
return Ok(Profile::default_profiles());
10241035
}
10251036

1026-
self.profiles
1027-
.split(',')
1028-
.map(Profile::from_str)
1029-
.collect::<Result<Vec<_>, _>>()
1030-
.map_err(|e| anyhow::anyhow!("Invalid profile: {e}"))
1037+
parse_profiles(&self.profiles).map_err(|e| anyhow::anyhow!("{e}"))
10311038
}
10321039

10331040
pub fn is_completed(&self) -> bool {
@@ -1056,6 +1063,13 @@ pub fn parse_backends(backends: &str) -> Result<Vec<CodegenBackend>, String> {
10561063
.collect()
10571064
}
10581065

1066+
pub fn parse_profiles(profiles: &str) -> Result<Vec<Profile>, String> {
1067+
profiles
1068+
.split(',')
1069+
.map(|s| Profile::from_str(s).map_err(|_| format!("Invalid profile: {s}")))
1070+
.collect()
1071+
}
1072+
10591073
/// Cached information about benchmark requests in the DB
10601074
pub struct BenchmarkRequestIndex {
10611075
/// Tags (SHA or release name) of all known benchmark requests

site/frontend/templates/pages/help.html

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@
2121
<h3><b><code>@rust-timer</code> commands</b></h3>
2222
<p><code>@rust-timer</code> supports several commands, the most common (and simple) being
2323
<code>@rust-timer queue</code>. This command is usually invoked as <code>@bors try @rust-timer
24-
queue</code>,
25-
which starts a bors "try" run (not a merge). <code>@rust-timer</code> will wait for the try run
26-
to finish,
27-
and if it succeeds will then queue a perf run.
24+
queue</code>, which starts a bors <a
25+
href="https://rustc-dev-guide.rust-lang.org/tests/ci.html#try-builds">"try build"</a> (not a
26+
merge). <code>@rust-timer</code> will wait for the try build to finish, and if it succeeds will
27+
then queue a perf run.
2828
</p>
2929
<p><code>@rust-timer queue</code> has a few extra options that can be useful:</p>
3030
<ul>
@@ -49,6 +49,10 @@ <h3><b><code>@rust-timer</code> commands</b></h3>
4949
rustc-perf will also gather data for this backend for the parent/baseline commit, so that we
5050
have something to compare to.
5151
</li>
52+
<li><code>profiles=&lt;PROFILES&gt;</code> configures which profiles should be benchmarked.
53+
If you select a non-default profile, rustc-perf will also gather data for this profile for the
54+
parent/baseline commit, so that we have something to compare to.
55+
</li>
5256
</ul>
5357
<p><code>@rust-timer build $commit</code> will queue a perf run for the given commit
5458
<code>$commit</code>.

0 commit comments

Comments
 (0)