Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 19 additions & 5 deletions database/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,17 @@ impl Profile {
pub fn default_profiles() -> Vec<Self> {
vec![Profile::Check, Profile::Debug, Profile::Doc, Profile::Opt]
}

pub fn all_values() -> &'static [Self] {
&[
Self::Check,
Self::Debug,
Self::Opt,
Self::Doc,
Self::DocJson,
Self::Clippy,
]
}
}

impl std::str::FromStr for Profile {
Expand Down Expand Up @@ -1023,11 +1034,7 @@ impl BenchmarkRequest {
return Ok(Profile::default_profiles());
}

self.profiles
.split(',')
.map(Profile::from_str)
.collect::<Result<Vec<_>, _>>()
.map_err(|e| anyhow::anyhow!("Invalid profile: {e}"))
parse_profiles(&self.profiles).map_err(|e| anyhow::anyhow!("{e}"))
}

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

pub fn parse_profiles(profiles: &str) -> Result<Vec<Profile>, String> {
profiles
.split(',')
.map(|s| Profile::from_str(s).map_err(|_| format!("Invalid profile: {s}")))
.collect()
}

/// Cached information about benchmark requests in the DB
pub struct BenchmarkRequestIndex {
/// Tags (SHA or release name) of all known benchmark requests
Expand Down
12 changes: 8 additions & 4 deletions site/frontend/templates/pages/help.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@
<h3><b><code>@rust-timer</code> commands</b></h3>
<p><code>@rust-timer</code> supports several commands, the most common (and simple) being
<code>@rust-timer queue</code>. This command is usually invoked as <code>@bors try @rust-timer
queue</code>,
which starts a bors "try" run (not a merge). <code>@rust-timer</code> will wait for the try run
to finish,
and if it succeeds will then queue a perf run.
queue</code>, which starts a bors <a
href="https://rustc-dev-guide.rust-lang.org/tests/ci.html#try-builds">"try build"</a> (not a
merge). <code>@rust-timer</code> will wait for the try build to finish, and if it succeeds will
then queue a perf run.
</p>
<p><code>@rust-timer queue</code> has a few extra options that can be useful:</p>
<ul>
Expand All @@ -49,6 +49,10 @@ <h3><b><code>@rust-timer</code> commands</b></h3>
rustc-perf will also gather data for this backend for the parent/baseline commit, so that we
have something to compare to.
</li>
<li><code>profiles=&lt;PROFILES&gt;</code> configures which profiles should be benchmarked.
If you select a non-default profile, rustc-perf will also gather data for this profile for the
parent/baseline commit, so that we have something to compare to.
</li>
</ul>
<p><code>@rust-timer build $commit</code> will queue a perf run for the given commit
<code>$commit</code>.
Expand Down
Loading
Loading