Skip to content

Commit

Permalink
[backend-comparison] Add Operating System information (#1531)
Browse files Browse the repository at this point in the history
* [backend-comparison] Add Operating System information

* [backend-comparison] Simplify serialization of os info
  • Loading branch information
syl20bnr authored Mar 26, 2024
1 parent 5bac300 commit 28233d9
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 2 deletions.
19 changes: 19 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,11 @@ text_placeholder = "0.5.0"
pollster = "0.3"
wgpu = "0.18.0"

# Burnbench
# Benchmarks and Burnbench
arboard = "3.3.2"
github-device-flow = "0.2.0"
os_info = "3.8.2"
wsl = "0.1.0"

bincode = { version = "2.0.0-rc.3", features = [
"alloc",
Expand Down
4 changes: 3 additions & 1 deletion backend-comparison/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ clap = { workspace = true }
crossterm = { workspace = true, optional = true }
derive-new = { workspace = true }
dirs = { workspace = true }
github-device-flow = { workspace = true }
github-device-flow = { workspace = true }
os_info = { workspace = true }
rand = { workspace = true }
ratatui = { workspace = true, optional = true }
reqwest = {workspace = true, features = ["blocking", "json"]}
Expand All @@ -44,6 +45,7 @@ strum = { workspace = true }
strum_macros = { workspace = true }
sysinfo = { workspace = true, features = ["serde"] }
wgpu = { workspace = true }
wsl = { workspace = true }

[dev-dependencies]
rstest = { workspace = true }
Expand Down
18 changes: 18 additions & 0 deletions backend-comparison/src/persistence/system_info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,31 @@ use wgpu;
pub(crate) struct BenchmarkSystemInfo {
cpus: Vec<String>,
gpus: Vec<String>,
os: BenchmarkOSInfo,
}

#[derive(Default, Clone, Serialize, Deserialize)]
pub(crate) struct BenchmarkOSInfo {
name: String,
#[serde(rename = "wsl")]
windows_linux_subsystem: bool,
}

impl From<os_info::Info> for BenchmarkOSInfo {
fn from(info: os_info::Info) -> Self {
BenchmarkOSInfo {
name: format!("{}", info),
windows_linux_subsystem: wsl::is_wsl(),
}
}
}

impl BenchmarkSystemInfo {
pub(crate) fn new() -> Self {
Self {
cpus: BenchmarkSystemInfo::enumerate_cpus(),
gpus: BenchmarkSystemInfo::enumerate_gpus(),
os: BenchmarkOSInfo::from(os_info::get()),
}
}

Expand Down

0 comments on commit 28233d9

Please sign in to comment.