From a37cbd2047ad8078613edf2c3bfc2c7ce7be7d3f Mon Sep 17 00:00:00 2001 From: aniketfuryrocks Date: Thu, 12 Jan 2023 14:25:30 +0530 Subject: [PATCH] bench-utils -> bench --- Cargo.lock | 8 +++++--- Cargo.toml | 9 ++------- {bench-utils => bench}/Cargo.toml | 5 ++++- {bench-utils => bench}/src/cli.rs | 0 {bench-utils => bench}/src/helpers.rs | 0 {bench-utils => bench}/src/lib.rs | 0 benches/tps.rs => bench/src/main.rs | 4 ++-- {bench-utils => bench}/src/metrics.rs | 0 tests/client.rs | 2 +- tests/workers.rs | 5 ++--- 10 files changed, 16 insertions(+), 17 deletions(-) rename {bench-utils => bench}/Cargo.toml (65%) rename {bench-utils => bench}/src/cli.rs (100%) rename {bench-utils => bench}/src/helpers.rs (100%) rename {bench-utils => bench}/src/lib.rs (100%) rename benches/tps.rs => bench/src/main.rs (98%) rename {bench-utils => bench}/src/metrics.rs (100%) diff --git a/Cargo.lock b/Cargo.lock index 9b2c6eb1..491b14d9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -444,15 +444,18 @@ dependencies = [ ] [[package]] -name = "bench-utils" +name = "bench" version = "0.1.0" dependencies = [ "anyhow", "clap 4.0.32", + "csv", "log", "serde", "solana-client", "solana-sdk", + "tokio", + "tracing-subscriber", ] [[package]] @@ -2253,13 +2256,12 @@ dependencies = [ "actix-web", "anyhow", "base64 0.21.0", - "bench-utils", + "bench", "bincode", "bs58", "bytes", "clap 4.0.32", "const_env", - "csv", "dashmap", "futures", "jsonrpsee", diff --git a/Cargo.toml b/Cargo.toml index 8c8a9b0a..6ecf2a0c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,16 +6,11 @@ description = "A lite version of solana rpc to send and confirm transactions" [workspace] members = [ - "bench-utils" + "bench" ] -[[bench]] -name="tps" -harness=false - [dev-dependencies] -bench-utils = { path = "./bench-utils" } -csv = "1.1.6" +bench = { path = "./bench" } [dependencies] solana-client = "1.14.12" diff --git a/bench-utils/Cargo.toml b/bench/Cargo.toml similarity index 65% rename from bench-utils/Cargo.toml rename to bench/Cargo.toml index 33866da0..a431a145 100644 --- a/bench-utils/Cargo.toml +++ b/bench/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "bench-utils" +name = "bench" version = "0.1.0" edition = "2021" @@ -9,4 +9,7 @@ solana-sdk = "1.14.12" log = "0.4.17" anyhow = "1.0.68" serde = "1.0.152" +csv = "1.1.6" clap = { version = "4.0.32", features = ["derive"] } +tokio = { version = "1.24.1", features = ["full"]} +tracing-subscriber = "0.3.16" diff --git a/bench-utils/src/cli.rs b/bench/src/cli.rs similarity index 100% rename from bench-utils/src/cli.rs rename to bench/src/cli.rs diff --git a/bench-utils/src/helpers.rs b/bench/src/helpers.rs similarity index 100% rename from bench-utils/src/helpers.rs rename to bench/src/helpers.rs diff --git a/bench-utils/src/lib.rs b/bench/src/lib.rs similarity index 100% rename from bench-utils/src/lib.rs rename to bench/src/lib.rs diff --git a/benches/tps.rs b/bench/src/main.rs similarity index 98% rename from benches/tps.rs rename to bench/src/main.rs index 5e406c29..a98c807f 100644 --- a/benches/tps.rs +++ b/bench/src/main.rs @@ -4,13 +4,13 @@ use std::{ time::{Duration, Instant}, }; -use bench_utils::{ +use bench::{ cli::Args, helpers::BenchHelper, metrics::{AvgMetric, Metric}, }; use clap::Parser; -use lite_rpc::DEFAULT_LITE_RPC_ADDR; +//use lite_rpc::DEFAULT_LITE_RPC_ADDR; use log::info; use solana_client::{nonblocking::rpc_client::RpcClient, rpc_client::SerializableTransaction}; use solana_sdk::{ diff --git a/bench-utils/src/metrics.rs b/bench/src/metrics.rs similarity index 100% rename from bench-utils/src/metrics.rs rename to bench/src/metrics.rs diff --git a/tests/client.rs b/tests/client.rs index 4c252c0f..c78cd732 100644 --- a/tests/client.rs +++ b/tests/client.rs @@ -1,6 +1,6 @@ use std::sync::Arc; -use bench_utils::helpers::BenchHelper; +use bench::helpers::BenchHelper; use lite_rpc::DEFAULT_LITE_RPC_ADDR; use log::info; use solana_client::{nonblocking::rpc_client::RpcClient, rpc_client::SerializableTransaction}; diff --git a/tests/workers.rs b/tests/workers.rs index 80b75927..9a41f7d5 100644 --- a/tests/workers.rs +++ b/tests/workers.rs @@ -1,7 +1,6 @@ -use std::sync::Arc; -use std::time::Duration; +use std::{sync::Arc, time::Duration}; -use bench_utils::helpers::BenchHelper; +use bench::helpers::BenchHelper; use futures::future::try_join_all; use lite_rpc::{ encoding::BinaryEncoding,