Skip to content

Commit fd1d513

Browse files
committed
refactor: move walltime_results to codspeed crate
1 parent f703a54 commit fd1d513

File tree

8 files changed

+12
-10
lines changed

8 files changed

+12
-10
lines changed

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/cargo-codspeed/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ serde = { workspace = true }
2828
serde_json = { workspace = true }
2929
codspeed = { path = "../codspeed", version = "=2.10.1" }
3030
glob = "0.3.2"
31-
statrs = "0.18.0"
3231

3332
[dev-dependencies]
3433
assert_cmd = "2.0.15"

crates/cargo-codspeed/src/main.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ mod helpers;
44
mod measurement_mode;
55
mod prelude;
66
mod run;
7-
mod walltime_results;
87

98
use crate::prelude::*;
109
use std::{env::args_os, process::exit};

crates/cargo-codspeed/src/run.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,13 @@ use crate::{
33
helpers::get_codspeed_target_dir,
44
measurement_mode::MeasurementMode,
55
prelude::*,
6-
walltime_results::{WalltimeBenchmark, WalltimeResults},
76
};
87
use anyhow::Context;
98
use cargo_metadata::{Metadata, Package};
10-
use codspeed::walltime::get_raw_result_dir_from_workspace_root;
9+
use codspeed::{
10+
walltime::get_raw_result_dir_from_workspace_root,
11+
walltime_results::{WalltimeBenchmark, WalltimeResults},
12+
};
1113
use glob::glob;
1214
use std::{
1315
io::{self, Write},

crates/codspeed/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ libc = "^0.2"
2525
nix = { version = "0.29.0", features = ["fs"] }
2626
serde = { workspace = true }
2727
serde_json = { workspace = true }
28+
statrs = "0.18.0"
2829
uuid = { version = "1.12.1", features = ["v4"] }
2930

3031
[[bench]]

crates/codspeed/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@ mod request;
66
mod shared;
77
pub mod utils;
88
pub mod walltime;
9+
pub mod walltime_results;

crates/codspeed/src/walltime.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1+
use serde::{Deserialize, Serialize};
2+
13
use std::{
24
io::Write,
35
path::{Path, PathBuf},
46
};
57

6-
use serde::{Deserialize, Serialize};
7-
88
#[derive(Debug, Serialize, Deserialize)]
99
pub struct BenchmarkMetadata {
1010
pub name: String,

crates/cargo-codspeed/src/walltime_results.rs renamed to crates/codspeed/src/walltime_results.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use codspeed::walltime::{BenchmarkMetadata, RawWallTimeData};
1+
use crate::walltime::{BenchmarkMetadata, RawWallTimeData};
22
use serde::{Deserialize, Serialize};
33
use statrs::statistics::{Data, Distribution, Max, Min, OrderStatistics};
44

@@ -42,11 +42,11 @@ pub struct WalltimeBenchmark {
4242
}
4343

4444
impl WalltimeBenchmark {
45-
pub(crate) fn is_invalid(&self) -> bool {
45+
pub fn is_invalid(&self) -> bool {
4646
self.stats.min_ns < f64::EPSILON
4747
}
4848

49-
pub(crate) fn name(&self) -> &str {
49+
pub fn name(&self) -> &str {
5050
&self.metadata.name
5151
}
5252
}

0 commit comments

Comments
 (0)