Skip to content

Commit

Permalink
Merge pull request valkey-io#780 from shachlanAmazon/license-fix
Browse files Browse the repository at this point in the history
Remove indirect dependency with problematic license.
  • Loading branch information
ikolomi authored Jan 10, 2024
2 parents adcd778 + fb4fa7e commit 3e81825
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 27 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/lint-rust/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion benchmarks/rust/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"] }
Expand Down
16 changes: 7 additions & 9 deletions benchmarks/rust/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand Down Expand Up @@ -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,
Expand All @@ -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;
Expand All @@ -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(),
Expand Down Expand Up @@ -236,7 +235,6 @@ async fn single_benchmark_task(
data_size: usize,
) -> HashMap<ChosenAction, Vec<Duration>> {
let mut buffer = itoa::Buffer::new();
let mut stopwatch = Stopwatch::new();
let mut results = HashMap::new();
results.insert(
ChosenAction::GetNonExisting,
Expand All @@ -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);
}
}

Expand Down
23 changes: 8 additions & 15 deletions deny.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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 = [""]
2 changes: 1 addition & 1 deletion glide-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 3e81825

Please sign in to comment.