Skip to content

Commit a4c2ddc

Browse files
committed
Pr Feedback; remove collector version of CollectorConfig and un-needed helpers on target
1 parent 1c200c6 commit a4c2ddc

File tree

4 files changed

+8
-77
lines changed

4 files changed

+8
-77
lines changed

collector/src/bin/collector.rs

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ use collector::artifact_stats::{
3636
use collector::codegen::{codegen_diff, CodegenType};
3737
use collector::compile::benchmark::category::Category;
3838
use collector::compile::benchmark::codegen_backend::CodegenBackend;
39-
use collector::compile::benchmark::collector_config::CollectorConfig;
4039
use collector::compile::benchmark::profile::Profile;
4140
use collector::compile::benchmark::scenario::Scenario;
4241
use collector::compile::benchmark::target::Target;
@@ -1332,22 +1331,20 @@ Make sure to modify `{dir}/perf-config.json` if the category/artifact don't matc
13321331

13331332
// Obtain the configuration and validate that it matches the
13341333
// collector's setup
1335-
let collector_config: CollectorConfig = rt
1336-
.block_on(conn.get_collector_config(&collector_name))?
1337-
.into();
1334+
let collector_config: database::CollectorConfig =
1335+
rt.block_on(conn.get_collector_config(&collector_name))?;
13381336

13391337
let collector_target = collector_config.target();
13401338
if collector_target.as_str() != target {
13411339
panic!(
1342-
"Mismatching target for collector expected `{}` got `{}`",
1343-
collector_target, target
1340+
"Mismatching target for collector expected `{collector_target}` got `{target}`"
13441341
);
13451342
}
13461343

13471344
// Dequeue a job
13481345
let benchmark_job = rt.block_on(conn.dequeue_benchmark_job(
13491346
&collector_name,
1350-
&collector_config.target().to_db_target(),
1347+
collector_config.target(),
13511348
collector_config.benchmark_set(),
13521349
))?;
13531350

collector/src/compile/benchmark/collector_config.rs

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

collector/src/compile/benchmark/mod.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ use tempfile::TempDir;
1919

2020
pub mod category;
2121
pub mod codegen_backend;
22-
pub mod collector_config;
2322
pub(crate) mod patch;
2423
pub mod profile;
2524
pub mod scenario;

collector/src/compile/benchmark/target.rs

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -39,32 +39,20 @@ impl Target {
3939
}
4040
}
4141

42-
impl From<database::Target> for Target {
43-
fn from(value: database::Target) -> Self {
44-
match value {
45-
database::Target::X86_64UnknownLinuxGnu => Self::X86_64UnknownLinuxGnu,
46-
}
47-
}
48-
}
49-
5042
impl Target {
5143
pub fn as_str(self) -> &'static str {
5244
match self {
5345
Target::X86_64UnknownLinuxGnu => "x86_64-unknown-linux-gnu",
5446
}
5547
}
48+
}
5649

57-
pub fn from_db_target(target: &database::Target) -> Target {
58-
match target {
50+
impl From<database::Target> for Target {
51+
fn from(value: database::Target) -> Self {
52+
match value {
5953
database::Target::X86_64UnknownLinuxGnu => Self::X86_64UnknownLinuxGnu,
6054
}
6155
}
62-
63-
pub fn to_db_target(&self) -> database::Target {
64-
match self {
65-
Target::X86_64UnknownLinuxGnu => database::Target::X86_64UnknownLinuxGnu,
66-
}
67-
}
6856
}
6957

7058
impl From<Target> for database::Target {

0 commit comments

Comments
 (0)