Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TC-1 #359

Merged
merged 26 commits into from
Mar 27, 2024
Merged

TC-1 #359

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
318d669
benchmarks: make cu_price configurable
Lou-Kamades Mar 13, 2024
6764a5a
benchmarks: confirmation slot bench attempts to minimize RPC distance
Lou-Kamades Mar 13, 2024
f55df40
benchmarks: add timeout_ms to confirmation_slot bench
Lou-Kamades Mar 13, 2024
c79b8f5
bench: add function to post data to Ping Thing
Lou-Kamades Mar 15, 2024
8d26c71
Merge branch 'main' into lou/tc-1
Lou-Kamades Mar 19, 2024
22a2eec
update cli merge confilicts
Lou-Kamades Mar 19, 2024
d278be1
bench: (TC1) add option for posting confirmation data to Ping Thing
Lou-Kamades Mar 19, 2024
3af8e53
bench: review comments
Lou-Kamades Mar 21, 2024
ee9bdf8
bench: convert ConfirmationSlotResult to an enum
Lou-Kamades Mar 21, 2024
b2c91ac
bench: fix tx size test
Lou-Kamades Mar 21, 2024
fd181d6
configure rpc_client with level=confirmed
grooviegermanikus Mar 22, 2024
1e5c1af
moved around stuff
grooviegermanikus Mar 22, 2024
d7c57c6
bench: ConfirmationResponseFromRpc::Success includes sent and confirm…
Lou-Kamades Mar 24, 2024
764952e
revamped status counting
grooviegermanikus Mar 26, 2024
69f5d97
add more narrow logs
grooviegermanikus Mar 26, 2024
a7f5823
Merge branch 'main' into lou/tc-1
Lou-Kamades Mar 26, 2024
0568dc7
bench: add max_timeout_ms to send_and_confirm_bulk_transactions
Lou-Kamades Mar 26, 2024
efbc428
cleanup
grooviegermanikus Mar 26, 2024
7881652
minor checks
grooviegermanikus Mar 26, 2024
9c2df94
simple result report for confirmation-slot
grooviegermanikus Mar 26, 2024
40bf799
Merge remote-tracking branch 'origin/lou/tc-1' into lou/tc-1
grooviegermanikus Mar 26, 2024
dd10fa3
bench: add TC-1 postgres result struct
Lou-Kamades Mar 27, 2024
48889e7
restore timeout
grooviegermanikus Mar 27, 2024
7e4b25b
Merge remote-tracking branch 'origin/lou/tc-1' into lou/tc-1
grooviegermanikus Mar 27, 2024
0d93ebf
rename txns -> txs, round -> run
grooviegermanikus Mar 27, 2024
259a895
add work-in-progress warning
grooviegermanikus Mar 27, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion bench/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,13 @@ path = "src/main.rs"
[[bin]]
# WIP
name = "benchnew"
path = "src/cli.rs"
path = "src/benchnew.rs"

[dependencies]
clap = { workspace = true }
csv = "1.2.1"
dirs = "5.0.0"
solana-lite-rpc-util = { workspace = true }
solana-sdk = { workspace = true }
solana-rpc-client = { workspace = true }
solana-transaction-status = { workspace = true }
Expand All @@ -34,6 +35,8 @@ dashmap = { workspace = true }
bincode = { workspace = true }
itertools = "0.10.5"
spl-memo = "4.0.0"
url = "*"
reqwest = "0.11.26"
lazy_static = "1.4.0"

[dev-dependencies]
Expand Down
13 changes: 9 additions & 4 deletions bench/src/benches/api_load.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,12 @@ use solana_sdk::signature::{read_keypair_file, Keypair, Signer};
use crate::create_memo_tx_small;

// TC3 measure how much load the API endpoint can take
pub async fn api_load(payer_path: &Path, rpc_url: String, time_ms: u64) -> anyhow::Result<()> {
pub async fn api_load(
payer_path: &Path,
rpc_url: String,
test_duration_ms: u64,
cu_price_micro_lamports: u64,
) -> anyhow::Result<()> {
warn!("THIS IS WORK IN PROGRESS");

let rpc = Arc::new(RpcClient::new(rpc_url));
Expand All @@ -29,7 +34,7 @@ pub async fn api_load(payer_path: &Path, rpc_url: String, time_ms: u64) -> anyho
let hash = rpc.get_latest_blockhash().await?;
let time = tokio::time::Instant::now();

while time.elapsed().as_millis() < time_ms.into() {
while time.elapsed().as_millis() < test_duration_ms.into() {
let rpc = rpc.clone();
let payer = payer.clone();

Expand All @@ -40,7 +45,7 @@ pub async fn api_load(payer_path: &Path, rpc_url: String, time_ms: u64) -> anyho

tokio::spawn(async move {
let msg = msg.as_bytes();
let tx = create_memo_tx_small(msg, &payer, hash);
let tx = create_memo_tx_small(msg, &payer, hash, cu_price_micro_lamports);
match rpc.send_transaction(&tx).await {
Ok(_) => success.fetch_add(1, Ordering::Relaxed),
Err(_) => failed.fetch_add(1, Ordering::Relaxed),
Expand All @@ -50,7 +55,7 @@ pub async fn api_load(payer_path: &Path, rpc_url: String, time_ms: u64) -> anyho
txs += 1;
}

let calls_per_second = txs as f64 / (time_ms as f64 * 1000.0);
let calls_per_second = txs as f64 / (test_duration_ms as f64 * 1000.0);
info!("calls_per_second: {}", calls_per_second);
info!("failed: {}", failed.load(Ordering::Relaxed));
info!("success: {}", success.load(Ordering::Relaxed));
Expand Down
Loading
Loading