pub struct Wrk { /* private fields */ }Expand description
Wrapper around Wrk enabling to run benchmarks, record historical data and plot graphs.
Implementations§
Source§impl Wrk
impl Wrk
Sourcepub fn url(&self) -> &String
pub fn url(&self) -> &String
Url of the service to benchmark against. Use the full URL of the request. IE: http://localhost:1234/some/uri.
Sourcepub fn benchmarks(&self) -> &Benchmarks
pub fn benchmarks(&self) -> &Benchmarks
Set of benchmarks for the current instance.
Sourcepub fn benchmarks_history(&self) -> &Benchmarks
pub fn benchmarks_history(&self) -> &Benchmarks
Historical benchmarks data, indexed by dates.
Sourcepub fn history_dir(&self) -> &PathBuf
pub fn history_dir(&self) -> &PathBuf
Directory on disk where to store and read the historical benchmark data.
Sourcepub fn user_script(&self) -> &Option<PathBuf>
pub fn user_script(&self) -> &Option<PathBuf>
User defined LUA script to run through wrk.
**NOTE: This script MUST not override the wrk function done() as it already
overriden by this crate to allow wrk to spit out a parsable JSON output.
Sourcepub fn max_error_percentage(&self) -> &u8
pub fn max_error_percentage(&self) -> &u8
Max percentage of errors vs total request to conside a benchmark healthy.
Sourcepub fn benchmark_date(&self) -> &Option<DateTime<Utc>>
pub fn benchmark_date(&self) -> &Option<DateTime<Utc>>
Current benchmark date and time.
Source§impl Wrk
impl Wrk
Sourcepub fn set_url(&mut self, val: String) -> &mut Self
pub fn set_url(&mut self, val: String) -> &mut Self
Url of the service to benchmark against. Use the full URL of the request. IE: http://localhost:1234/some/uri.
Sourcepub fn set_timeout(&mut self, val: u8) -> &mut Self
pub fn set_timeout(&mut self, val: u8) -> &mut Self
Wrk timeout in seconds
Sourcepub fn set_benchmarks(&mut self, val: Benchmarks) -> &mut Self
pub fn set_benchmarks(&mut self, val: Benchmarks) -> &mut Self
Set of benchmarks for the current instance.
Sourcepub fn set_benchmarks_history(&mut self, val: Benchmarks) -> &mut Self
pub fn set_benchmarks_history(&mut self, val: Benchmarks) -> &mut Self
Historical benchmarks data, indexed by dates.
Sourcepub fn set_history_dir(&mut self, val: PathBuf) -> &mut Self
pub fn set_history_dir(&mut self, val: PathBuf) -> &mut Self
Directory on disk where to store and read the historical benchmark data.
Sourcepub fn set_user_script(&mut self, val: Option<PathBuf>) -> &mut Self
pub fn set_user_script(&mut self, val: Option<PathBuf>) -> &mut Self
User defined LUA script to run through wrk.
**NOTE: This script MUST not override the wrk function done() as it already
overriden by this crate to allow wrk to spit out a parsable JSON output.
Sourcepub fn set_headers(&mut self, val: Headers) -> &mut Self
pub fn set_headers(&mut self, val: Headers) -> &mut Self
Header to add to the wrk request.
Sourcepub fn set_method(&mut self, val: String) -> &mut Self
pub fn set_method(&mut self, val: String) -> &mut Self
Method for the wrk request.
Sourcepub fn set_max_error_percentage(&mut self, val: u8) -> &mut Self
pub fn set_max_error_percentage(&mut self, val: u8) -> &mut Self
Max percentage of errors vs total request to conside a benchmark healthy.
Sourcepub fn set_benchmark_date(&mut self, val: Option<DateTime<Utc>>) -> &mut Self
pub fn set_benchmark_date(&mut self, val: Option<DateTime<Utc>>) -> &mut Self
Current benchmark date and time.
Source§impl Wrk
impl Wrk
Sourcepub fn url_mut(&mut self) -> &mut String
pub fn url_mut(&mut self) -> &mut String
Url of the service to benchmark against. Use the full URL of the request. IE: http://localhost:1234/some/uri.
Sourcepub fn timeout_mut(&mut self) -> &mut u8
pub fn timeout_mut(&mut self) -> &mut u8
Wrk timeout in seconds
Sourcepub fn benchmarks_mut(&mut self) -> &mut Benchmarks
pub fn benchmarks_mut(&mut self) -> &mut Benchmarks
Set of benchmarks for the current instance.
Sourcepub fn benchmarks_history_mut(&mut self) -> &mut Benchmarks
pub fn benchmarks_history_mut(&mut self) -> &mut Benchmarks
Historical benchmarks data, indexed by dates.
Sourcepub fn history_dir_mut(&mut self) -> &mut PathBuf
pub fn history_dir_mut(&mut self) -> &mut PathBuf
Directory on disk where to store and read the historical benchmark data.
Sourcepub fn user_script_mut(&mut self) -> &mut Option<PathBuf>
pub fn user_script_mut(&mut self) -> &mut Option<PathBuf>
User defined LUA script to run through wrk.
**NOTE: This script MUST not override the wrk function done() as it already
overriden by this crate to allow wrk to spit out a parsable JSON output.
Sourcepub fn headers_mut(&mut self) -> &mut Headers
pub fn headers_mut(&mut self) -> &mut Headers
Header to add to the wrk request.
Sourcepub fn method_mut(&mut self) -> &mut String
pub fn method_mut(&mut self) -> &mut String
Method for the wrk request.
Sourcepub fn max_error_percentage_mut(&mut self) -> &mut u8
pub fn max_error_percentage_mut(&mut self) -> &mut u8
Max percentage of errors vs total request to conside a benchmark healthy.
Sourcepub fn benchmark_date_mut(&mut self) -> &mut Option<DateTime<Utc>>
pub fn benchmark_date_mut(&mut self) -> &mut Option<DateTime<Utc>>
Current benchmark date and time.