drill-update-dependencies.patch 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. From 12efcc691c4e1fa50b276658be66e20be16d7af1 Mon Sep 17 00:00:00 2001
  2. From: Maxime Devos <maximedevos@telenet.be>
  3. Date: Mon, 6 Jun 2022 16:47:13 +0000
  4. Subject: [PATCH] Update dependencies.
  5. Warning:
  6. * I don't use the Cargo package manager, I use the Guix package
  7. manager and the antioxidant build system.
  8. * This package manager has a different dependency resolving
  9. algorithm from Guix.
  10. * The antioxidant-build-system hasn't implemented running tests yet.
  11. * On first sight, the changes for the tokio update seem to have
  12. slightly different semantics. Maybe buggy.
  13. Because the crate is downloaded for crates.io, Cargo.toml had to be
  14. changed to Cargo.toml.orig.
  15. Upstream PR: <https://github.com/fcsonline/drill/pull/133>.
  16. ---
  17. Cargo.toml | 24 ++++++++++++------------
  18. src/actions/delay.rs | 4 ++--
  19. src/benchmark.rs | 7 ++++---
  20. 3 files changed, 18 insertions(+), 17 deletions(-)
  21. diff --git a/Cargo.toml.orig b/Cargo.toml.orig
  22. index e411b9d..86e1190 100644
  23. --- a/Cargo.toml.orig
  24. +++ b/Cargo.toml.orig
  25. @@ -9,19 +9,19 @@ license = "GPL-3.0"
  26. edition = "2018"
  27. [dependencies]
  28. -clap = "2.32.0"
  29. -colored = "1.7.0"
  30. -csv = "1.0.5"
  31. -regex = "1.1.2"
  32. +clap = "2.34.0"
  33. +colored = "1.9.3"
  34. +csv = "1.1.5"
  35. +regex = "1.5.4"
  36. serde = { version = "1.0", features = ["derive"] }
  37. -serde_json = "1.0.39"
  38. -yaml-rust = "0.4.3"
  39. -url = "2.1.1"
  40. +serde_json = "1.0.74"
  41. +yaml-rust = "0.4.5"
  42. +url = "2.2.2"
  43. linked-hash-map = "0.5.3"
  44. -tokio = { version = "0.2.20", features = ["rt-core", "rt-threaded", "time", "net", "io-driver"] }
  45. -reqwest = { version = "0.10.4", features = ["cookies", "trust-dns"] }
  46. -async-trait = "0.1.30"
  47. -futures = "0.3.5"
  48. +tokio = { version = "1.18.2", features = ["rt-core", "rt-threaded", "time", "net", "io-driver"] }
  49. +reqwest = { version = "0.11.10", features = ["cookies", "trust-dns"] }
  50. +async-trait = "0.1.42"
  51. +futures = "0.3.21"
  52. lazy_static = "1.4.0"
  53. num_cpus = "1.13.0"
  54. -rand = "0.7.3"
  55. +rand = "0.8.4"
  56. diff --git a/src/actions/delay.rs b/src/actions/delay.rs
  57. index d53e99b..8ef4c71 100644
  58. --- a/src/actions/delay.rs
  59. +++ b/src/actions/delay.rs
  60. @@ -1,6 +1,6 @@
  61. use async_trait::async_trait;
  62. use colored::*;
  63. -use tokio::time::delay_for;
  64. +use tokio::time::sleep;
  65. use yaml_rust::Yaml;
  66. use crate::actions::extract;
  67. @@ -36,7 +36,7 @@ impl Delay {
  68. #[async_trait]
  69. impl Runnable for Delay {
  70. async fn execute(&self, _context: &mut Context, _reports: &mut Reports, _pool: &Pool, config: &Config) {
  71. - delay_for(Duration::from_secs(self.seconds as u64)).await;
  72. + sleep(Duration::from_secs(self.seconds as u64)).await;
  73. if !config.quiet {
  74. println!("{:width$} {}{}", self.name.green(), self.seconds.to_string().cyan().bold(), "s".magenta(), width = 25);
  75. diff --git a/src/benchmark.rs b/src/benchmark.rs
  76. index 94f6fee..7ee7956 100644
  77. --- a/src/benchmark.rs
  78. +++ b/src/benchmark.rs
  79. @@ -1,3 +1,4 @@
  80. +// Modified by Maxime Devos (2022) (see 5(a) in LICENSE)
  81. use std::collections::HashMap;
  82. use std::sync::{Arc, Mutex};
  83. use std::time::{Duration, Instant};
  84. @@ -5,7 +6,7 @@ use std::time::{Duration, Instant};
  85. use futures::stream::{self, StreamExt};
  86. use serde_json::{json, Value};
  87. -use tokio::{runtime, time::delay_for};
  88. +use tokio::{runtime, time::sleep};
  89. use crate::actions::{Report, Runnable};
  90. use crate::config::Config;
  91. @@ -30,7 +31,7 @@ pub struct BenchmarkResult {
  92. async fn run_iteration(benchmark: Arc<Benchmark>, pool: Pool, config: Arc<Config>, iteration: i64) -> Vec<Report> {
  93. if config.rampup > 0 {
  94. let delay = config.rampup / config.iterations;
  95. - delay_for(Duration::new((delay * iteration) as u64, 0)).await;
  96. + sleep(Duration::new((delay * iteration) as u64, 0)).await;
  97. }
  98. let mut context: Context = Context::new();
  99. @@ -68,7 +69,7 @@ pub fn execute(benchmark_path: &str, report_path_option: Option<&str>, relaxed_i
  100. println!();
  101. let threads = std::cmp::min(num_cpus::get(), config.concurrency as usize);
  102. - let mut rt = runtime::Builder::new().threaded_scheduler().enable_all().core_threads(threads).max_threads(threads).build().unwrap();
  103. + let rt = runtime::Builder::new_multi_thread().enable_all().worker_threads(threads).max_blocking_threads(threads).build().unwrap();
  104. rt.block_on(async {
  105. let mut benchmark: Benchmark = Benchmark::new();
  106. let pool_store: PoolStore = PoolStore::new();
  107. base-commit: ce5ba790b3b28eafe6717104d4df3816ef2cbe1e
  108. --
  109. 2.30.2