Skip to content

Commit 712661f

Browse files
authored
Merge branch 'master' into categorize-perf-runs
2 parents 85364da + 54e3858 commit 712661f

20 files changed

+604
-789
lines changed

Cargo.lock

+509-726
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

collector/Cargo.toml

+6-7
Original file line numberDiff line numberDiff line change
@@ -6,28 +6,27 @@ edition = '2018'
66

77
[dependencies]
88
clap = "2.25"
9-
env_logger = "0.7"
9+
env_logger = "0.8"
1010
anyhow = "1"
1111
thiserror = "1"
1212
log = "0.4"
1313
serde = { version = "1", features = ["derive"] }
1414
serde_json = "1"
1515
tempfile = "3"
1616
libc = "0.2"
17-
chrono = "0.4"
17+
chrono = { version = "0.4", features = ["serde"] }
1818
lazy_static = "1"
19-
semver = "0.9"
20-
reqwest = { version = "0.10", features = ["json"] }
19+
semver = "1.0"
20+
reqwest = { version = "0.11", features = ["json"] }
2121
xz2 = "0.1.3"
2222
tar = "0.4"
23-
tokio = { version = "0.2", features = ["rt-core"] }
24-
rustc-artifacts = "0.2"
23+
tokio = { version = "1.6", features = ["rt"] }
2524
database = { path = "../database" }
2625
intern = { path = "../intern" }
2726
futures = "0.3.5"
2827
num_cpus = "1.13"
2928
jobserver = "0.1.21"
30-
crossbeam-utils = "0.7"
29+
crossbeam-utils = "0.8"
3130
snap = "1"
3231
filetime = "0.2.14"
3332
walkdir = "2"

collector/src/lib.rs

+26
Original file line numberDiff line numberDiff line change
@@ -224,3 +224,29 @@ pub fn command_output(cmd: &mut Command) -> anyhow::Result<process::Output> {
224224

225225
Ok(output)
226226
}
227+
228+
#[derive(Debug, Clone, Deserialize)]
229+
pub struct MasterCommit {
230+
pub sha: String,
231+
pub parent_sha: String,
232+
/// This is the pull request which this commit merged in.
233+
#[serde(default)]
234+
pub pr: Option<u32>,
235+
pub time: chrono::DateTime<chrono::Utc>,
236+
}
237+
238+
/// This provides the master-branch Rust commits which should have accompanying
239+
/// bors artifacts available.
240+
///
241+
/// The first commit returned (at index 0) is the most recent, the last is the
242+
/// oldest.
243+
///
244+
/// Specifically, this is the last 168 days of bors commits.
245+
///
246+
/// Note that this does not contain try commits today, so it should not be used
247+
/// to validate hashes or expand them generally speaking. This may also change
248+
/// in the future.
249+
pub async fn master_commits() -> Result<Vec<MasterCommit>, Box<dyn std::error::Error + Sync + Send>> {
250+
let response = reqwest::get("https://triage.rust-lang.org/bors-commit-list").await?;
251+
Ok(response.json().await?)
252+
}

collector/src/main.rs

+6-7
Original file line numberDiff line numberDiff line change
@@ -546,13 +546,12 @@ fn main_result() -> anyhow::Result<i32> {
546546

547547
let benchmark_dir = PathBuf::from("collector/benchmarks");
548548

549-
let mut builder = tokio::runtime::Builder::new();
549+
let mut builder = tokio::runtime::Builder::new_multi_thread();
550550
// We want to minimize noise from the runtime
551551
builder
552-
.core_threads(1)
553-
.max_threads(1)
554-
.enable_io()
555-
.basic_scheduler();
552+
.worker_threads(1)
553+
.max_blocking_threads(1)
554+
.enable_io();
556555
let mut rt = builder.build().expect("built runtime");
557556

558557
let default_db = "results.db";
@@ -810,9 +809,9 @@ fn main_result() -> anyhow::Result<i32> {
810809
}
811810

812811
pub fn get_commit_or_fake_it(sha: &str) -> anyhow::Result<Commit> {
813-
let mut rt = tokio::runtime::Runtime::new().unwrap();
812+
let rt = tokio::runtime::Runtime::new().unwrap();
814813
Ok(rt
815-
.block_on(rustc_artifacts::master_commits())
814+
.block_on(collector::master_commits())
816815
.map_err(|e| anyhow::anyhow!("{:?}", e))
817816
.context("getting master commit list")?
818817
.into_iter()

database/Cargo.toml

+7-7
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,21 @@ edition = "2018"
77
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
88

99
[dependencies]
10-
hashbrown = { version = "0.7", features = ["serde"] }
10+
hashbrown = { version = "0.11", features = ["serde"] }
1111
serde = { version = "1", features = ["derive"] }
1212
serde_json = "1"
13-
rusqlite = { version = "0.23", features = ["bundled"] }
14-
tokio-postgres = { version = "0.5.4", features = ["with-serde_json-1", "with-chrono-0_4"] }
13+
rusqlite = { version = "0.25", features = ["bundled"] }
14+
tokio-postgres = { version = "0.7", features = ["with-serde_json-1", "with-chrono-0_4", "runtime"] }
1515
anyhow = "1"
1616
async-trait = "0.1"
17-
tokio = { version = "0.2.21", features = ["sync", "macros"] }
17+
tokio = { version = "1.6", features = ["sync", "macros"] }
1818
snap = "1"
1919
intern = { path = "../intern" }
2020
chrono = "0.4"
21-
reqwest = { version = "0.10.5", features = ["blocking"] }
22-
postgres-native-tls = "0.3"
21+
reqwest = { version = "0.11", features = ["blocking"] }
22+
postgres-native-tls = "0.5"
2323
native-tls = "0.2"
2424
lazy_static = "1"
25-
env_logger = "0.7"
25+
env_logger = "0.8"
2626
futures = "0.3.5"
2727
log = "0.4"

database/src/bin/export-to-sqlite.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ async fn copy<R: Table>(
310310
R::trailer()
311311
)
312312
.as_str(),
313-
vec![],
313+
Vec::<u32>::new(),
314314
)
315315
.await
316316
.unwrap();

database/src/bin/ingest-json.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -289,14 +289,14 @@ impl Ingesting for Sqlite<'_> {
289289
let mut exact = series.chunks_exact(9);
290290
for series in exact.by_ref() {
291291
cached
292-
.execute(series.iter().flat_map(|v| {
292+
.execute(rusqlite::params_from_iter(series.iter().flat_map(|v| {
293293
vec![
294294
ToSqlOutput::Borrowed(ValueRef::Text(v.krate.as_bytes())),
295295
ToSqlOutput::Borrowed(ValueRef::Text(v.profile.as_bytes())),
296296
ToSqlOutput::Borrowed(ValueRef::Text(v.cache.as_bytes())),
297297
ToSqlOutput::Borrowed(ValueRef::Text(v.statistic.as_bytes())),
298298
]
299-
}))
299+
})))
300300
.unwrap();
301301
}
302302
for v in exact.remainder() {
@@ -357,14 +357,14 @@ impl Ingesting for Sqlite<'_> {
357357
let mut exact = series.chunks_exact(21);
358358
for series in exact.by_ref() {
359359
cached
360-
.execute(series.iter().flat_map(|v| {
360+
.execute(rusqlite::params_from_iter(series.iter().flat_map(|v| {
361361
vec![
362362
ToSqlOutput::Borrowed(ValueRef::Text(v.krate.as_bytes())),
363363
ToSqlOutput::Borrowed(ValueRef::Text(v.profile.as_bytes())),
364364
ToSqlOutput::Borrowed(ValueRef::Text(v.cache.as_bytes())),
365365
ToSqlOutput::Borrowed(ValueRef::Text(v.query.as_bytes())),
366366
]
367-
}))
367+
})))
368368
.unwrap();
369369
}
370370
for v in exact.remainder() {

database/src/pool.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ where
210210
}
211211

212212
async fn get(&self) -> ManagedConnection<T> {
213-
let permit = self.permits.clone().acquire_owned().await;
213+
let permit = self.permits.clone().acquire_owned().await.unwrap();
214214
let conn = {
215215
let mut slots = self.connections.lock().unwrap_or_else(|e| e.into_inner());
216216
slots.pop()

intern/Cargo.toml

+3-5
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,11 @@ version = "0.1.0"
44
authors = ["Mark Rousskov <[email protected]>"]
55
edition = "2018"
66

7-
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
8-
97
[dependencies]
108
bumpalo = "3.2"
11-
parking_lot = "0.10"
12-
arc-swap = "0.4"
13-
hashbrown = "0.7.0"
9+
parking_lot = "0.11"
10+
arc-swap = "1.3"
11+
hashbrown = "0.11"
1412
lazy_static = "1"
1513
serde = "1"
1614
serde_derive = "1"

site/Cargo.toml

+14-15
Original file line numberDiff line numberDiff line change
@@ -5,45 +5,44 @@ version = "0.1.0"
55
edition = '2018'
66

77
[dependencies]
8-
env_logger = "0.7"
8+
env_logger = "0.8"
99
anyhow = "1"
1010
thiserror = "1"
1111
futures = "0.3"
12-
tokio = { version = "0.2", features = ["macros", "time"] }
12+
tokio = { version = "1.6", features = ["macros", "time"] }
1313
log = "0.4"
1414
serde = { version = "1", features = ["rc"] }
1515
serde_derive = "1"
1616
serde_json = "1"
17-
hyper = "0.13"
17+
hyper = { version = "0.14", features = ["server", "stream"] }
1818
headers = "0.3"
1919
http = "0.2"
2020
home = "0.5"
2121
chrono = "0.4"
22-
rmp-serde = "0.14.2"
23-
semver = "0.9"
22+
rmp-serde = "0.15"
23+
semver = "1.0"
2424
ring = "0.16.10"
2525
hex = "0.4.2"
2626
regex = "1"
2727
lazy_static = "1"
28-
reqwest = { version = "0.10", features = ["json", "blocking"] }
28+
reqwest = { version = "0.11", features = ["json", "blocking"] }
2929
toml = "0.5"
3030
rust_team_data = { git = "https://github.com/rust-lang/team" }
31-
parking_lot = "0.10"
31+
parking_lot = "0.11"
3232
snap = "1"
33-
rustc-artifacts = "0.2.2"
34-
itertools = "0.9"
35-
hashbrown = "0.7"
36-
arc-swap = "0.4"
37-
rusqlite = { version = "0.23", features = ["bundled"] }
33+
itertools = "0.10"
34+
hashbrown = { version = "0.11", features = ["serde"] }
35+
arc-swap = "1.3"
36+
rusqlite = { version = "0.25", features = ["bundled"] }
3837
async-trait = "0.1"
3938
database = { path = "../database" }
40-
bytes = "0.5.6"
39+
bytes = "1.0"
4140
url = "2"
4241
analyzeme = { git = "https://github.com/rust-lang/measureme" }
4342
tar = "0.4"
4443
inferno = { version="0.10", default-features = false }
4544
mime = "0.3"
46-
prometheus = "0.11"
45+
prometheus = "0.12"
4746

4847
[target.'cfg(unix)'.dependencies]
4948
jemallocator = "0.3"
@@ -54,4 +53,4 @@ path = "../collector"
5453

5554
[dev-dependencies]
5655
lazy_static = "1"
57-
pretty_assertions = "0.6"
56+
pretty_assertions = "0.7"

site/src/comparison.rs

+7-7
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ pub async fn handle_triage(
2424
let start = body.start;
2525
let end = body.end;
2626
// Compare against self to get next
27-
let master_commits = rustc_artifacts::master_commits().await?;
27+
let master_commits = collector::master_commits().await?;
2828
let comparison = compare_given_commits(
2929
start.clone(),
3030
start.clone(),
@@ -76,7 +76,7 @@ pub async fn handle_compare(
7676
body: api::days::Request,
7777
data: &InputData,
7878
) -> Result<api::days::Response, BoxedError> {
79-
let master_commits = rustc_artifacts::master_commits().await?;
79+
let master_commits = collector::master_commits().await?;
8080
let comparison =
8181
compare_given_commits(body.start, body.end, body.stat, data, &master_commits).await?;
8282

@@ -213,7 +213,7 @@ pub async fn compare_given_commits(
213213
end: Bound,
214214
stat: String,
215215
data: &InputData,
216-
master_commits: &[rustc_artifacts::Commit],
216+
master_commits: &[collector::MasterCommit],
217217
) -> Result<Comparison, BoxedError> {
218218
let a = data
219219
.data_for(true, start.clone())
@@ -257,7 +257,7 @@ impl DateData {
257257
conn: &dyn database::Connection,
258258
commit: ArtifactId,
259259
series: &mut [selector::SeriesResponse<T>],
260-
master_commits: &[rustc_artifacts::Commit],
260+
master_commits: &[collector::MasterCommit],
261261
) -> Self
262262
where
263263
T: Iterator<Item = (db::ArtifactId, Option<f64>)>,
@@ -336,7 +336,7 @@ pub struct Comparison {
336336

337337
impl Comparison {
338338
/// Gets the previous commit before `a`
339-
pub fn prev(&self, master_commits: &[rustc_artifacts::Commit]) -> Option<String> {
339+
pub fn prev(&self, master_commits: &[collector::MasterCommit]) -> Option<String> {
340340
match &self.a_id {
341341
ArtifactId::Commit(a) => master_commits
342342
.iter()
@@ -350,7 +350,7 @@ impl Comparison {
350350
pub async fn is_contiguous(
351351
&self,
352352
conn: &dyn database::Connection,
353-
master_commits: &[rustc_artifacts::Commit],
353+
master_commits: &[collector::MasterCommit],
354354
) -> bool {
355355
match (&self.a_id, &self.b_id) {
356356
(ArtifactId::Commit(a), ArtifactId::Commit(b)) => {
@@ -365,7 +365,7 @@ impl Comparison {
365365
}
366366

367367
/// Gets the sha of the next commit after `b`
368-
pub fn next(&self, master_commits: &[rustc_artifacts::Commit]) -> Option<String> {
368+
pub fn next(&self, master_commits: &[collector::MasterCommit]) -> Option<String> {
369369
match &self.b_id {
370370
ArtifactId::Commit(b) => master_commits
371371
.iter()

site/src/github.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ r? @ghost",
188188
let rollup_merge_sha = rollup_merge_sha.to_owned();
189189
tokio::task::spawn(async move {
190190
// Give github time to create the merge commit reference
191-
tokio::time::delay_for(Duration::from_secs(30)).await;
191+
tokio::time::sleep(Duration::from_secs(30)).await;
192192
// This provides the master SHA so that we can check that we only queue
193193
// an appropriate try build. If there's ever a race condition, i.e.,
194194
// master was pushed while this command was running, the user will have to

site/src/load.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ impl InputData {
147147
pub async fn missing_commits(&self) -> Vec<(Commit, MissingReason)> {
148148
let conn = self.conn().await;
149149
let (master_commits, queued_commits, in_progress_artifacts) = futures::join!(
150-
rustc_artifacts::master_commits(),
150+
collector::master_commits(),
151151
conn.queued_commits(),
152152
conn.in_progress_artifacts()
153153
);

site/src/main.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ async fn main() {
6767
futures::pin_mut!(fut);
6868
loop {
6969
futures::select! {
70-
s = server => {
70+
_s = server => {
7171
eprintln!("Server completed unexpectedly.");
7272
return;
7373
}

site/src/self_profile.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
44
use crate::load::InputData;
55
use anyhow::Context;
6-
use bytes::buf::BufExt;
6+
use bytes::Buf;
77
use hyper::StatusCode;
88
use std::collections::HashMap;
99
use std::fmt;

site/src/self_profile/crox.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ pub fn generate(pieces: super::Pieces, opt: Opt) -> anyhow::Result<Vec<u8>> {
130130

131131
let mut seq = serializer.serialize_seq(None)?;
132132

133-
let data = ProfilingData::from_buffers(pieces.string_data, pieces.string_index, pieces.events)
133+
let data = ProfilingData::from_buffers(pieces.string_data, pieces.string_index, pieces.events, None)
134134
.map_err(|e| anyhow::format_err!("{:?}", e))?;
135135

136136
let thread_to_collapsed_thread =

site/src/self_profile/flamegraph.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ pub struct Opt {}
77

88
pub fn generate(title: &str, pieces: super::Pieces, _: Opt) -> anyhow::Result<Vec<u8>> {
99
let profiling_data =
10-
ProfilingData::from_buffers(pieces.string_data, pieces.string_index, pieces.events)
10+
ProfilingData::from_buffers(pieces.string_data, pieces.string_index, pieces.events, None)
1111
.map_err(|e| anyhow::format_err!("{:?}", e))?;
1212

1313
let recorded_stacks = collapse_stacks(&profiling_data)

site/src/server.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
// option. This file may not be copied, modified, or distributed
88
// except according to those terms.
99

10-
use bytes::buf::BufExt;
10+
use bytes::Buf;
1111
use parking_lot::Mutex;
1212
use std::cell::RefCell;
1313
use std::collections::HashMap;
@@ -1773,7 +1773,7 @@ async fn run_server(data: Arc<RwLock<Option<Arc<InputData>>>>, addr: SocketAddr)
17731773
}))
17741774
}
17751775
});
1776-
let server = hyper::Server::bind(&addr).serve(svc);
1776+
let server = hyper::server::Server::bind(&addr).serve(svc);
17771777
if let Err(e) = server.await {
17781778
eprintln!("server error: {:?}", e);
17791779
}

0 commit comments

Comments
 (0)