added client version in report

This commit is contained in:
2026-03-25 11:18:07 +01:00
parent 43172dea51
commit 4b0ccce606
6 changed files with 29 additions and 24 deletions

2
Cargo.lock generated
View File

@@ -1865,7 +1865,7 @@ checksum = "0c790de23124f9ab44544d7ac05d60440adc586479ce501c1d6d7da3cd8c9cf5"
[[package]]
name = "slimes"
version = "0.1.0"
version = "1.0.0"
dependencies = [
"chrono",
"clap",

View File

@@ -1,11 +1,11 @@
[package]
name = "slimes"
version = "0.1.0"
version = "1.0.0"
edition = "2024"
[dependencies]
chrono = { version = "0.4.44", features = ["serde"] }
clap = { version = "4.6.0", features = ["derive"] }
clap = { version = "4.6.0", features = ["cargo", "derive"] }
colored = "3.1.1"
cpal = { version = "0.17.3", optional = true }
display-info = { version = "0.5.9", optional = true }

36
server/Cargo.lock generated
View File

@@ -1558,24 +1558,6 @@ dependencies = [
"serde",
]
[[package]]
name = "server"
version = "0.1.0"
dependencies = [
"anyhow",
"axum",
"chrono",
"clap",
"serde",
"serde_json",
"sqlx",
"tokio",
"tower-http",
"tower_governor",
"tracing",
"tracing-subscriber",
]
[[package]]
name = "sha1"
version = "0.10.6"
@@ -1629,6 +1611,24 @@ version = "0.4.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0c790de23124f9ab44544d7ac05d60440adc586479ce501c1d6d7da3cd8c9cf5"
[[package]]
name = "slimes-server"
version = "0.1.0"
dependencies = [
"anyhow",
"axum",
"chrono",
"clap",
"serde",
"serde_json",
"sqlx",
"tokio",
"tower-http",
"tower_governor",
"tracing",
"tracing-subscriber",
]
[[package]]
name = "smallvec"
version = "1.15.1"

View File

@@ -10,6 +10,7 @@ chrono = { version = "0.4.44", features = ["serde"] }
clap = { version = "4.6.0", features = ["derive"] }
serde = { version = "1.0.228", features = ["derive"] }
serde_json = "1.0.149"
# slimes = { version = "1.0.0", path = ".." }
sqlx = { version = "0.8.6", features = ["chrono", "sqlite", "runtime-tokio"] }
tokio = { version = "1.50.0", features = ["rt-multi-thread", "macros"] }
tower-http = { version = "0.6.8", features = ["fs", "cors"] }

View File

@@ -3,6 +3,8 @@
pub mod benchmark;
pub mod slimes;
pub const DEFAULT_PRIME_LIMIT: u64 = 500_000;
#[macro_export]
macro_rules! vprintln {
($verbose:expr, $($arg:tt)*) => {

View File

@@ -4,14 +4,14 @@ use std::{
};
use chrono::Utc;
use clap::Parser;
use clap::{Parser, crate_version};
use colored::Colorize;
use mac_address::get_mac_address;
use serde::Serialize;
use sysinfo::System;
use slimes::{
application_header,
DEFAULT_PRIME_LIMIT, application_header,
benchmark::{BenchmarkResults, run_benchmark_multithread, run_benchmark_singlethread},
slimes::get_all_slimes,
vprintln,
@@ -30,7 +30,7 @@ pub struct Cli {
pub skip_system_info: bool,
/// Benchmark: Upper limit for prime calculation (higher number = longer test)
#[arg(short, long, default_value_t = 500_000)]
#[arg(short, long, default_value_t = DEFAULT_PRIME_LIMIT)]
pub prime_limit: u64,
/// Benchmark: Enforce cpu thread amount to use.
@@ -57,6 +57,7 @@ struct FullReport {
timestamp: String,
slimes: Option<HashMap<String, Vec<String>>>,
benchmark: Option<BenchmarkReport>,
client_version: String,
}
#[derive(Serialize)]
@@ -78,6 +79,7 @@ fn main() {
timestamp: Utc::now().to_rfc3339(),
slimes: None,
benchmark: None,
client_version: crate_version!().to_string(),
};
vprintln!(