diff --git a/.github/workflows/lint-rust/action.yml b/.github/workflows/lint-rust/action.yml index 63530e0e69..ef62499b29 100644 --- a/.github/workflows/lint-rust/action.yml +++ b/.github/workflows/lint-rust/action.yml @@ -33,7 +33,7 @@ runs: - run: | cargo update cargo install cargo-deny - cargo deny check licenses --config ${GITHUB_WORKSPACE}/deny.toml + cargo deny check --config ${GITHUB_WORKSPACE}/deny.toml working-directory: ${{ inputs.cargo-toml-folder }} shell: bash diff --git a/benchmarks/rust/Cargo.toml b/benchmarks/rust/Cargo.toml index c9a35e861f..b5cde1d37c 100644 --- a/benchmarks/rust/Cargo.toml +++ b/benchmarks/rust/Cargo.toml @@ -14,7 +14,6 @@ logger_core = {path = "../../logger_core"} redis = { path = "../../submodules/redis-rs/redis", features = ["aio"] } futures = "0.3.28" rand = "0.8.5" -stopwatch = "0.0.7" itoa = "1.0.6" futures-time = "^3.0.0" clap = { version = "4.3.8", features = ["derive"] } diff --git a/benchmarks/rust/src/main.rs b/benchmarks/rust/src/main.rs index 0c387888b2..9d7ae81b0a 100644 --- a/benchmarks/rust/src/main.rs +++ b/benchmarks/rust/src/main.rs @@ -11,9 +11,8 @@ use std::{ collections::HashMap, path::Path, sync::{atomic::AtomicUsize, Arc}, - time::Duration, + time::{Duration, Instant}, }; -use stopwatch::Stopwatch; #[derive(Parser, Debug)] #[command(author, version, about, long_about = None)] @@ -102,7 +101,7 @@ async fn perform_benchmark(args: Args) { }) .await; - let mut stopwatch = stopwatch::Stopwatch::start_new(); + let start = Instant::now(); let results = join_all((0..*concurrent_tasks_count).map(|_| async { single_benchmark_task( &connections, @@ -114,7 +113,7 @@ async fn perform_benchmark(args: Args) { .await })) .await; - stopwatch.stop(); + let elapsed = start.elapsed(); let combined_results = results.into_iter().fold(HashMap::new(), |mut acc, map| { if acc.is_empty() { return map; @@ -139,7 +138,7 @@ async fn perform_benchmark(args: Args) { ); results_json.insert( "tps".to_string(), - Value::Number((number_of_operations as i64 * 1000 / stopwatch.elapsed_ms()).into()), + Value::Number((number_of_operations as i64 * 1000 / elapsed.as_millis() as i64).into()), ); results_json.insert( "client_count".to_string(), @@ -236,7 +235,6 @@ async fn single_benchmark_task( data_size: usize, ) -> HashMap> { let mut buffer = itoa::Buffer::new(); - let mut stopwatch = Stopwatch::new(); let mut results = HashMap::new(); results.insert( ChosenAction::GetNonExisting, @@ -257,10 +255,10 @@ async fn single_benchmark_task( } let index = current_op % connections.len(); let mut connection = connections[index].clone(); - stopwatch.restart(); + let start = Instant::now(); let action = perform_operation(&mut connection, &mut buffer, data_size).await; - stopwatch.stop(); - results.get_mut(&action).unwrap().push(stopwatch.elapsed()); + let elapsed = start.elapsed(); + results.get_mut(&action).unwrap().push(elapsed); } } diff --git a/deny.toml b/deny.toml index df4a911ed9..b099ec17fc 100644 --- a/deny.toml +++ b/deny.toml @@ -38,13 +38,14 @@ db-urls = ["https://github.com/rustsec/advisory-db"] # The lint level for security vulnerabilities vulnerability = "deny" # The lint level for unmaintained crates -unmaintained = "warn" +unmaintained = "deny" # The lint level for crates that have been yanked from their source registry -yanked = "warn" +yanked = "deny" # The lint level for crates with security notices. Note that as of # 2019-12-17 there are no security notice advisories in # https://github.com/rustsec/advisory-db -notice = "warn" +notice = "deny" +unsound = "deny" # A list of advisory IDs to ignore. Note that ignored advisories will still # output a note when they are encountered. ignore = [ @@ -92,7 +93,7 @@ deny = [ #"Nokia", ] # Lint level for licenses considered copyleft -copyleft = "warn" +copyleft = "deny" # Blanket approval or denial for OSI-approved or FSF Free/Libre licenses # * both - The license will be approved if it is both OSI-approved *AND* FSF # * either - The license will be approved if it is either OSI-approved *OR* FSF @@ -156,7 +157,7 @@ registries = [ # https://embarkstudios.github.io/cargo-deny/checks/bans/cfg.html [bans] # Lint level for when multiple versions of the same crate are detected -multiple-versions = "warn" +multiple-versions = "allow" # Lint level for when a crate version requirement is `*` wildcards = "allow" # The graph highlighting used when creating dotgraphs for crates @@ -197,20 +198,12 @@ skip-tree = [ [sources] # Lint level for what to happen when a crate from a crate registry that is not # in the allow list is encountered -unknown-registry = "warn" +unknown-registry = "deny" # Lint level for what to happen when a crate from a git repository that is not # in the allow list is encountered -unknown-git = "warn" +unknown-git = "deny" # List of URLs for allowed crate registries. Defaults to the crates.io index # if not specified. If it is specified but empty, no registries are allowed. allow-registry = ["https://github.com/rust-lang/crates.io-index"] # List of URLs for allowed Git repositories allow-git = [] - -[sources.allow-org] -# 1 or more github.com organizations to allow git sources for -github = [""] -# 1 or more gitlab.com organizations to allow git sources for -gitlab = [""] -# 1 or more bitbucket.org organizations to allow git sources for -bitbucket = [""] diff --git a/glide-core/Cargo.toml b/glide-core/Cargo.toml index a1efd883b5..5f4a1fe097 100644 --- a/glide-core/Cargo.toml +++ b/glide-core/Cargo.toml @@ -25,7 +25,7 @@ integer-encoding = "4.0.0" thiserror = "1" rand = "0.8.5" futures-intrusive = "0.5.0" -directories = "5.0" +directories = "4.0" once_cell = "1.18.0" arcstr = "1.1.5" sha1_smol = "1.0.0"