Fixes #551 by including the following details in the request log:
scenario_index
scenario_name
transaction_index (optional)
transaction_name (optional)
Adding this information to the request log caused the GooseRequestMetric to grow statistically larger than the other members of the GooseMetric enum. Clippy recommended boxing it because of this:
% cargo clippy
Checking goose v0.17.1-dev (devel/goose)
warning: large size difference between variants
--> src/metrics.rs:46:1
|
46 | / pub enum GooseMetric {
47 | | Request(GooseRequestMetric),
| | --------------------------- the largest variant contains at least 280 bytes
48 | | Transaction(TransactionMetric),
| | ------------------------------ the second-largest variant contains at least 72 bytes
49 | | Scenario(ScenarioMetric),
50 | | }
| |_^ the entire enum is at least 280 bytes
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#large_enum_variant
= note: `#[warn(clippy::large_enum_variant)]` on by default
help: consider boxing the large fields to reduce the total size of the enum
|
47 | Request(Box<GooseRequestMetric>),
| ~~~~~~~~~~~~~~~~~~~~~~~
warning: `goose` (lib) generated 1 warning
Finished dev [unoptimized + debuginfo] target(s) in 1.92s
Because transaction_index is optional it is represented as a String in the log instead of as a usize (whereas scenario_index is represented as a usize as it's always guaranteed to be set). If empty, it will show up as "", whereas "0" indicates the first transaction in the scenario.
For example, a snippet from a CSV-formatted request log:
Fixes #551 by including the following details in the request log:
scenario_index
scenario_name
transaction_index
(optional)transaction_name
(optional)Adding this information to the request log caused the GooseRequestMetric to grow statistically larger than the other members of the GooseMetric enum. Clippy recommended boxing it because of this:
Because
transaction_index
is optional it is represented as aString
in the log instead of as ausize
(whereas scenario_index is represented as a usize as it's always guaranteed to be set). If empty, it will show up as""
, whereas"0"
indicates the first transaction in the scenario.For example, a snippet from a CSV-formatted request log:
Or similarly, a snippet from a JSON-formatted request log:
A raw-formatted request log:
And finally, a pretty-formatted request log: