Skip to content

Commit 8129d0d

Browse files
Remove background thread from collector
It is currently unused and the replacement for tracking in-progress benchmarking will probably use the database as the communication engine rather than passing state to the server via HTTP.
1 parent b68e883 commit 8129d0d

File tree

6 files changed

+3
-148
lines changed

6 files changed

+3
-148
lines changed

Cargo.lock

Lines changed: 0 additions & 28 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

collector/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ semver = "0.9"
2020
reqwest = { version = "0.10", features = ["json"] }
2121
xz2 = "0.1.3"
2222
tar = "0.4"
23-
crossbeam-channel = "0.4.2"
2423
tokio = { version = "0.2", features = ["rt-core"] }
2524
rustc-artifacts = "0.2"
2625
database = { path = "../database" }

collector/src/api.rs

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,3 @@
1-
pub mod collected {
2-
use crate::Commit;
3-
4-
#[derive(Debug, PartialEq, Clone, serde::Serialize, serde::Deserialize)]
5-
pub enum Request {
6-
// Will benchmark commit with these benchmarks
7-
BenchmarkCommit {
8-
commit: Commit,
9-
// crate name
10-
benchmarks: Vec<String>,
11-
},
12-
// benchmark finished for this benchmark/commit
13-
BenchmarkDone {
14-
// crate name
15-
benchmark: String,
16-
commit: Commit,
17-
},
18-
}
19-
20-
#[derive(Debug, PartialEq, Clone, serde::Serialize, serde::Deserialize)]
21-
pub struct Response {
22-
// nothing
23-
}
24-
}
25-
261
pub mod next_commit {
272
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
283
pub struct Response {

collector/src/background_worker.rs

Lines changed: 0 additions & 59 deletions
This file was deleted.

collector/src/main.rs

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
extern crate clap;
55

66
use anyhow::{bail, Context};
7-
use collector::api::collected;
87
use database::{pool::Connection, ArtifactId, Commit};
98
use log::debug;
109
use std::collections::HashSet;
@@ -16,11 +15,9 @@ use std::process::Command;
1615
use std::{str, time::Instant};
1716
use tokio::runtime::Runtime;
1817

19-
mod background_worker;
2018
mod execute;
2119
mod sysroot;
2220

23-
use background_worker::send_home;
2421
use execute::{Benchmark, Profiler};
2522
use sysroot::Sysroot;
2623

@@ -195,21 +192,11 @@ fn bench(
195192
compiler: Compiler<'_>,
196193
benchmarks: &[Benchmark],
197194
iterations: usize,
198-
call_home: bool,
199195
self_profile: bool,
200196
) -> BenchmarkErrors {
201197
let mut errors = BenchmarkErrors::new();
202198
eprintln!("Benchmarking {} for triple {}", cid, compiler.triple);
203199

204-
if call_home {
205-
if let ArtifactId::Commit(commit) = cid {
206-
send_home(collected::Request::BenchmarkCommit {
207-
commit: commit.clone(),
208-
benchmarks: benchmarks.iter().map(|b| b.name.to_string()).collect(),
209-
});
210-
}
211-
}
212-
213200
let has_measureme = Command::new("summarize").output().is_ok();
214201
if self_profile {
215202
assert!(
@@ -267,15 +254,6 @@ fn bench(
267254
&format!("{:?}", s),
268255
));
269256
};
270-
271-
if call_home {
272-
if let ArtifactId::Commit(commit) = cid {
273-
send_home(collected::Request::BenchmarkDone {
274-
benchmark: benchmark.name.to_string(),
275-
commit: commit.clone(),
276-
});
277-
}
278-
}
279257
}
280258
let end = start.elapsed();
281259

@@ -559,7 +537,6 @@ fn main_result() -> anyhow::Result<i32> {
559537
},
560538
&benchmarks,
561539
1,
562-
/* call_home */ false,
563540
self_profile,
564541
);
565542
res.fail_if_nonzero()?;
@@ -606,7 +583,6 @@ fn main_result() -> anyhow::Result<i32> {
606583
Compiler::from_sysroot(&sysroot),
607584
&benchmarks,
608585
3,
609-
/* call_home */ true,
610586
self_profile,
611587
);
612588

@@ -684,7 +660,6 @@ fn main_result() -> anyhow::Result<i32> {
684660
},
685661
&benchmarks,
686662
3,
687-
/* call_home */ false,
688663
/* self_profile */ false,
689664
);
690665
res.fail_if_nonzero()?;
@@ -768,7 +743,6 @@ fn main_result() -> anyhow::Result<i32> {
768743
Ok(2)
769744
}
770745
};
771-
background_worker::shut_down();
772746
ret
773747
}
774748

site/src/server.rs

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ use crate::db::{self, Cache, Crate, Profile};
4444
use crate::interpolate::Interpolated;
4545
use crate::load::{Config, InputData};
4646
use crate::selector::{self, PathComponent, Tag};
47-
use collector::api::collected;
4847
use db::{ArtifactId, Lookup};
4948
use parking_lot::RwLock;
5049

@@ -576,11 +575,8 @@ pub async fn handle_github(
576575
crate::github::handle_github(request, data).await
577576
}
578577

579-
pub async fn handle_collected(
580-
_body: collected::Request,
581-
_data: &InputData,
582-
) -> ServerResult<collected::Response> {
583-
Ok(collected::Response {})
578+
pub async fn handle_collected() -> ServerResult<()> {
579+
Ok(())
584580
}
585581

586582
fn get_self_profile_data(
@@ -1066,9 +1062,7 @@ async fn serve_req(ctx: Arc<Server>, req: Request) -> Result<Response, ServerErr
10661062
.body(hyper::Body::empty())
10671063
.unwrap());
10681064
}
1069-
Ok(to_response(
1070-
handle_collected(body!(parse_body(&body)), &data).await,
1071-
))
1065+
Ok(to_response(handle_collected().await))
10721066
} else if p == "/perf/github-hook" {
10731067
if !verify_gh(&data.config, &req, &body) {
10741068
return Ok(http::Response::builder()

0 commit comments

Comments
 (0)