Skip to content

Commit

Permalink
TEMP: hack benchmark config into code
Browse files Browse the repository at this point in the history
  • Loading branch information
brianolson committed Aug 4, 2023
1 parent 2e0c2a3 commit 2fc6b87
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
13 changes: 10 additions & 3 deletions config/src/config/benchmark.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,22 @@ pub struct BenchmarkConfig {
pub rpc_in_flight: usize,
}

impl BenchmarkConfig {
// for hacking NodeConfig serde(default="")
pub fn default_some() -> Option<Self> {
Some(Self::default())
}
}

impl Default for BenchmarkConfig {
fn default() -> Self {
Self {
enabled: false,
enabled: true,
max_network_channel_size: 1000,
benchmark_service_threads: Some(2),

enable_direct_send_testing: false,
direct_send_data_size: 100 * 1024, // 100 KB
enable_direct_send_testing: true,
direct_send_data_size: 100_000,
direct_send_per_second: 1_000,

enable_rpc_testing: false,
Expand Down
2 changes: 1 addition & 1 deletion config/src/config/node_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ pub struct NodeConfig {
pub storage: StorageConfig,
#[serde(default)]
pub validator_network: Option<NetworkConfig>,
#[serde(default)]
#[serde(default = "BenchmarkConfig::default_some")]
pub benchmark: Option<BenchmarkConfig>,
}

Expand Down

0 comments on commit 2fc6b87

Please sign in to comment.