Skip to content

Commit

Permalink
move oltp client config to its own section
Browse files Browse the repository at this point in the history
  • Loading branch information
brayniac committed Oct 8, 2024
1 parent 2322bca commit a431c50
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
8 changes: 2 additions & 6 deletions configs/oltp.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,11 @@ endpoints = [
"mysql://user_name:password@localhost:3333",
]

[client]
# number of threads used to drive client requests
[oltp]
# number of threads used to drive oltp requests
threads = 4
# the total number of connections to each endpoint
poolsize = 20
# the connect timeout in milliseconds
connect_timeout = 10000
# set the timeout in milliseconds
request_timeout = 1000

[workload]
# the number of threads that will be used to generate the workload
Expand Down
2 changes: 1 addition & 1 deletion src/clients/oltp/mysql/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ pub fn launch_tasks(
) {
info!("launching mysql protocol tasks");

for _ in 0..config.client().unwrap().poolsize() {
for _ in 0..config.oltp().unwrap().poolsize() {
for endpoint in config.target().endpoints() {
runtime.spawn(task(
work_receiver.clone(),
Expand Down
7 changes: 7 additions & 0 deletions src/config/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ mod client;
mod debug;
mod general;
mod metrics;
mod oltp;

Check failure

Code scanning / clippy

file not found for module oltp Error

file not found for module oltp

Check failure

Code scanning / clippy

file not found for module oltp Error

file not found for module oltp
mod protocol;
mod pubsub;
mod storage;
Expand All @@ -18,6 +19,7 @@ pub use client::Client;
pub use debug::Debug;
pub use general::General;
pub use metrics::{Format as MetricsFormat, Metrics};
pub use oltp::{Oltp as OltpConfig};

Check failure

Code scanning / clippy

unresolved import oltp::Oltp Error

unresolved import oltp::Oltp

Check failure

Code scanning / clippy

unresolved import oltp::Oltp Error

unresolved import oltp::Oltp
pub use protocol::Protocol;
pub use pubsub::Pubsub;
pub use storage::Storage;
Expand All @@ -40,6 +42,7 @@ pub struct Config {
general: General,
client: Option<Client>,
debug: Debug,
oltp: Option<OltpConfig>,
pubsub: Option<Pubsub>,
target: Target,
tls: Option<Tls>,
Expand Down Expand Up @@ -90,6 +93,10 @@ impl Config {
self.client.as_ref()
}

pub fn oltp(&self) -> Option<&OltpConfig> {
self.oltp.as_ref()
}

pub fn pubsub(&self) -> Option<&Pubsub> {
self.pubsub.as_ref()
}
Expand Down

0 comments on commit a431c50

Please sign in to comment.