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

Benchmark info #1543

Draft
wants to merge 3 commits into
base: dev
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
9 changes: 5 additions & 4 deletions zingolib/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,16 @@ edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[features]
benchmarks = []
ci = []
darkside_tests = []
default = ["sync"]
deprecations = ["lightclient-deprecated"]
lightclient-deprecated = []
darkside_tests = []
sync = ['dep:zingo-sync']
tempfile = ["dep:tempfile"]
test-elevation = ["portpicker", "testvectors", "tempfile", "tempdir"]
testvectors = []
tempfile = ["dep:tempfile"]
default = ["sync"]
sync = ['dep:zingo-sync']
zaino-test = ['test-elevation']

[dependencies]
Expand Down
2 changes: 2 additions & 0 deletions zingolib/src/testutils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ use regtest::RegtestManager;
use tokio::time::sleep;

pub mod assertions;
#[cfg(feature = "benchmarks")]
pub mod benchmarks;
pub mod chain_generics;
pub mod fee_tables;
/// TODO: Add Doc Comment Here!
Expand Down
43 changes: 43 additions & 0 deletions zingolib/src/testutils/benchmarks.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
//! a benchmark is a measurement of how quickly zingo can sync.
//! benchmarks need to take into account many factors

use zcash_primitives::consensus::BlockHeight;

/// all relevant data for a sync.
/// this struct will convert to json to be saved
/// todo: distinguish between raw json standard and zingo specific template, add Options
pub struct SyncBenchmark {
network_info: NetworkInfo,
system_info: (),
account_info: AccountInfo,
client_info: ClientInfo,
/// /
final_time: u64,
/// /
final_height: BlockHeight,
/// /
sync_time: u64,
/// TODO should this be an alias?
synced_blocks: u32,
}

/// the connected server, indexer, and chain
/// also, how fast is the network
pub struct NetworkInfo {
url: Url,
chain_type: ChainType,
bandwidth: (),
latency: (),
}
/// the hardware and underlying system
pub struct SystemInfo {}
/// the account (wallet) being synced
pub struct AccountInfo {
wallet_id: NetworkSeedVersion,
hdwallet_accounts: Option<u32>,
}
/// the software being used to sync
pub struct ClientInfo {
client: String,
version: String,
}