Upgrading From 0.18
Change the dependency to goose = "^0.19". The changes below can break a load test written for Goose 0.18, or change what it does.
Removed options
| 0.18 | 0.19 |
|---|---|
--hatch-rate (-r) | --increase-rate (-r), see launching users |
--startup-time (-s) | --increase-time (-s), see launching users |
GooseDefault::HatchRate | GooseDefault::IncreaseRate, see Defaults |
GooseDefault::StartupTime | GooseDefault::IncreaseTime, see Defaults |
GooseConfiguration fields hatch_rate and startup_time | increase_rate and increase_time, see Custom options |
goose::util::get_hatch_rate() | goose::util::parse_rate() |
Controller commands hatchrate and startuptime | increaserate and increasetime, see Controller commands |
Crate feature gaggle | None: Gaggle was removed in 0.17.0 and will be restored in 0.20, before the 1.0 release. For a distributed load test today, use 0.16.4; see Gaggle. |
The new --decrease-rate and --decrease-time control the ramp down; without them Goose stops all users at once, as 0.18 did. See the ramp down rate. Neither is allowed with --iterations: the run fails at startup with `configuration.decrease_rate` can not be set with `configuration.iterations`., or the same for decrease_time. Drop the decrease option, as each user stops after its iterations anyway.
API changes
- API change: the command line is parsed with
clap. Removeuse gumdrop::Options;:GooseConfiguration::parse_args_default()is now a method of its own, andGooseConfigurationimplementsclap::Parser. See Custom options. - API change: every
GooseConfigurationfield for an option that takes a single value, such ashost,run_time,increase_timeoriterations, is anOption,Nonewhen not given; set one withSome, as inconfiguration.run_time = Some("30s".to_string()). Thehelpfield is gone. See Custom options. - API change: session data must implement
Clone; add#[derive(Clone)]to the struct. See the Session example. - API change:
GooseConfiguration::parse_args_default()returnsGooseError::InvalidOptionfor-hand--help, with the flag asoptionand the detailhelp was requested, where 0.18 returned the configuration with itshelpfield set totrue. See Building the configuration yourself. - API change:
TransactionError::RequestFailed { raw_request }holds aBox<GooseRequestMetric>,TransactionError::LoggerFailed { source }a boxedSendError, and the newTransactionError::Custom(String)lets a transaction returnErr("reason".into()). See Transaction error types. - API change: a
matchwithout a wildcard arm needs new arms forTransactionError::Custom(see Transaction error types),GooseError::ThresholdsFailed(see The end of the run),GooseMethod::Custom(see The API) and the newGooseDefaultvariants (see Defaults). - API change: scenario and transaction names are
Arc<str>in place ofString:Scenario.name,Scenario.machine_name, thenameofScenarioMetric,TransactionMetricandScenarioMetricAggregate,TransactionMetricAggregate.scenario_name,GooseRequestMetric.nameandGooseRequestMetric.scenario_name, and thescenario_nameargument ofGooseUser::new(). Reading one as&strworks unchanged. See the API documentation. - API change:
Transaction.nameand thetransaction_nameofGooseRequestMetricandTransactionMetricAggregateare agoose::goose::TransactionNamein place of aString:TransactionOnly(Arc<str>)for a name set withset_name(), orInheritNameByRequests(Arc<str>)for one set withset_name_for_transaction_and_requests(). Read the name withname_for_transaction().GooseRequestMetric.transaction_indexis ausizein place of aString. See Naming Transactions and the API documentation. - API change: times are kept in microseconds.
GooseRequestMetricTimingDatahastimes_us,minimum_time_us,maximum_time_usandtotal_time_usin place of the millisecondtimes,minimum_time,maximum_timeandtotal_time;TransactionMetricAggregateandScenarioMetricAggregatekeep their times inrun_times; a struct literal ofGooseRequestMetric,TransactionMetricorScenarioMetricmust set the newresponse_time_fraction_usorrun_time_fraction_us. See Response times and the API documentation ofGooseRequestMetricTimingData,TransactionMetricAggregateandScenarioMetricAggregate. - goose-eggs 0.6 is built for Goose 0.18. A load test that uses goose-eggs moves to Goose 0.19 with goose-eggs 0.7: set
goose-eggs = "0.7". See Goose Eggs. - API change: the default crate features are now
cookies, sodefault-features = falseturns off cookie support, where in 0.18 it turned off TLS, and therustls-tlsfeature no longer changes the TLS that load test requests use. - API change:
controller::ControllerCommandcarries each command’s parsed value, andutil::parse_timespan()returnsOption<usize>. See Controller commands and the API documentation ofControllerCommandandparse_timespan(). - API change:
TestPlan::total_users()stops atusize::MAXin place of overflowing, andGooseError::InvalidControllerCommandis no longer returned, though the variant is kept. See the API documentation ofTestPlan. - API change:
TransactionDetailhas no lifetime parameter: itsscenario_nameis anArc<str>, itstransaction_indexanOption<usize>and itstransaction_nameaTransactionName, where 0.18 held&strs.GooseRequestMetric.transaction_indexisusize::MAXfor a request made outside a transaction. See the API documentation ofTransactionDetail. - API change: a transaction error is recorded.
GooseMetricshas the new public fieldtransaction_errors, aGooseTransactionErrorMetricsofGooseTransactionErrorMetricAggregates, andGooseTransactionErrorMetricis an error log entry.GooseMetrichas the new variantsAll,BatchandTransactionError, andGooseLogthe new variantsTransactionErrorandFailedTransaction, so amatchon either without a wildcard arm needs new arms. See Error log. - API change:
GooseMetricshas the new public fieldthresholds, each rule’sThresholdResult, and the newgoose::thresholdmodule holdsThresholdandThresholdResult. See Thresholds. - API change:
GooseConfigurationhas new public fields:threshold,no_threshold_abort,threshold_abort_delay,output_dir,compress,notes,report_graph_data,render_reportandwebsocket, among others, and, with thepdf-reportsfeature,pdf_scaleandpdf_timeout, anOption<f64>and anOption<u64>set in code withGooseDefault::PdfScaleandGooseDefault::PdfTimeout. See Custom options and Output files. - API change:
config::RUN_FOLDERandreset_killswitch()are public. See Output files and Killswitch.
Behavior changes
- behavior change:
Transaction::set_name()names only the transaction; its requests keep their own names. Useset_name_for_transaction_and_requests()for the 0.18 behavior. See Naming transactions. - behavior change:
--scenariosmatches machine names exactly, where 0.18 matched any part of the name; use*as a wildcard, as in--scenarios "anon*". See Limiting scenarios. - behavior change: HTTPS uses rustls in place of the system’s native TLS library. Certificates are still checked by the operating system’s verifier, so a CA the system trusts is trusted, and
--accept-invalid-certsskips the check in every build. See TLS. - behavior change: an option value that begins with a hyphen goes after
=, as in--goose-log=-run.log. Given as its own argument it is read as options, so--goose-log -run.logreads as--goose-logand-r un.log, and fails becauseun.logis not a number. When the command line itself does not parse, as with--goose-log -x.log, the error ends with a tip to use=. A negative number is still read as a value:--timeout -5reaches the timeout check and is refused there, and--users -1is refused with a tip that--userstakes no negative number. An output option followed by another option, as in--goose-log --quiet, is given without a path and writesgoose.loginto the run’s folder. See Output files. - behavior change: a report or log file whose name ends in
.gzis written gzipped. See Compression. - behavior change:
--report-filereports are written even with--no-print-metrics. See Output files. - behavior change:
-hprints a short summary and--helpthe full reference, both to stdout. See Run-time options. - behavior change:
--run-time 0,--increase-time 0,--decrease-time 0and--throttle-requests 0undo the matchingGooseDefault, and an empty log path, as in--request-log "", turns off a log aGooseDefaultsets;GooseDefault::IterationsandGooseDefault::NoGranularDatanow take effect. See Defaults. - behavior change: values that started no users or broke Goose are refused before the load test starts: a test plan with no users, a time span too large to hold, an increase or decrease rate below one user a day, a rate or
--timeoutthat is not a finite number, and a--timeoutthat rounds to less than 1 ms, including a negative one. A fractional--timeoutis rounded to the nearest millisecond, so0.0005runs as 1 ms and anything below it is refused. See Test plan and Run-time options. - behavior change: a time span, as given to
--run-time,--increase-time,--decrease-time,--threshold-abort-delay, a test plan step or a Controller command, is only hours, minutes and seconds written ash,mands, as in1h30mor45s, in either case. 0.18 read15mins,5hoursand2h3minby their leading part, as 15 minutes, 5 hours and 2 hours 3 minutes; 0.19 refuses them, so write15m,5hand2h3m. See Run-time options. - behavior change: times under 10 ms are shown to the hundredth of a millisecond, and percentiles are never more than 1% off, so figures differ from the whole milliseconds 0.18 printed. See Response times.
- behavior change: the JSON report’s timing data holds
times_usin place oftimes, its averages are means of the microseconds, it includes the test plan history, and each transaction’stransaction_nameis an object such as{"TransactionOnly":"login"}, where 0.18 wrote a string. See JSON report. - behavior change: the CSV request log ends with a
response_time_uscolumn, the scenario log withrun_time_us, and the transaction log withrun_time_usand thenerror; the JSON, raw and pretty formats addresponse_time_fraction_usorrun_time_fraction_us. In JSON logs the keys follow the order of the fields instead of being sorted,transaction_nameis an object such as{"TransactionOnly":"login"}, where 0.18 wrote a string (the error log’s new transaction error entries write it as a string); the CSV request log’stransaction_namecolumn is empty unless the name was set withset_name_for_transaction_and_requests(); and the request, debug and error logs writetransaction_indexas a number, such as0, where 0.18 wrote the string"0". See Logging and Request log. - behavior change:
elapsedin the request, error, transaction and scenario logs counts milliseconds since the load test started, where 0.18 counted from when each user was built;GooseUser.startedis likewise the time the load test started, the same for every user, and the HTML report’s active users graph shows the increase ramp. See Logging, Request log and Users. - behavior change:
GooseRawRequest.headers, as read throughgoose.request.raw.headersor aTransactionError::RequestFailed, is empty unless the request log, debug log or error log is enabled. See Request log. - behavior change: Controller
userstakes 1 to 100000, and on a running load test keeps its run time and ramp down;runtimechanges a running users ramp; a value that can’t be used is answered with what it must be;config-json(and the WebSocket Controller’sconfig) shows an unset option asnulland has nohelpkey, and telnetconfigshowsNonefor an unset option andSome(...)around a set one. See Controller commands. - behavior change: the telnet Controller’s
metrics-jsonand the WebSocket Controller’smetricsreplies holdtimes_usin place oftimesand write each transaction’stransaction_nameas an object, as the JSON report does, and a WebSocket message over 131,072 bytes closes the connection. See WebSocket Controller. - behavior change: the killswitch keeps the first reason it is given, and is cleared when a run starts. See Killswitch.
- behavior change: users start and stop on time at any rate. 0.18 rounded the time between two users up to the next half second when it was over 500 ms, so
--increase-rate 1.5started 1 user a second and a test plan step of 500 users in 5 minutes took 8 minutes 20 seconds. In 0.19--increase-rate 1.5starts a user every 667 ms, and that step takes 5 minutes. This applies to--increase-rate,--decrease-rate, test plan steps and users changed by a Controller. See Specifying the increase rate. - behavior change:
GooseScheduler::Randomshuffles transactions. 0.18 ran them in Serial order. 0.19 shuffles each scenario’s whole list once, so every user of a scenario runs the same random order; sequenced transactions are shuffled only within their sequence, andon_startandon_stoptransactions run as before. See Random Scheduler. - behavior change: a transaction’s error is recorded. Each line of the transaction log, in every format, ends with an
errorfield, empty for a transaction that succeeded. The error log gets an entry for each transaction error, and its CSV header gains the columnsscenario_index,scenario_name,transaction_index,transaction_nameandrun_timeaftererror; a request error row leaves them empty. The console summary and the HTML, Markdown, PDF and JSON reports add a Transaction Errors table when there are any, which--no-error-summaryleaves out. See Transaction log and Error log. - behavior change: the JSON report keeps each request’s times by status code in
status_code_timings, underraw_metrics.requests, and holds transaction errors intransaction_errors. Itsraw_request_metricsrows are each request and the Aggregated row. See JSON report. - behavior change: with
--co-mitigation, the Aggregated# reqsis the “Actual requests” plus the “Synthetic requests” of the coordinated omission summary, and those counts start again when the metrics are reset after the ramp up. See Coordinated omission metrics. - behavior change: the errors and transaction errors tables start again when the metrics are reset after the ramp up, as the other tables do, where 0.18 kept the ramp up’s errors in them.
--no-reset-metricskeeps them, and the error log still records every error. See Metrics. - behavior change: a scenario counts every user that ran it in the measured time, including users that had not completed an iteration, and the HTML, Markdown and JSON reports’ Aggregated scenario Iterations is all runs divided by all users, as on the console, where 0.18’s reports added up each scenario’s iterations. See Scenarios.
- behavior change: an average with no times to average, such as a scenario no user ran, is 0, where it was NaN (
nullin the JSON report). See Metrics. - behavior change:
--scenariosaccepts_, soname_1selects a second scenario registered asname, and a pattern that matches no scenario logs a warning. See Limiting scenarios. - behavior change: a telnet or WebSocket Controller that can’t listen on its port logs an error, and the load test runs without it;
--no-autostartis then refused when no Controller listens and dashboard control is off, as nothing could start the run. See Controlling a running load test and Printer-friendly HTML report example. - behavior change: a load test that a Controller starts again after it stopped counts its requests from zero. See Controlling a running load test.
- behavior change: the first column of the Markdown report’s scenario table is headed
Scenario, where 0.18 headed itTransaction. See Markdown report. - behavior change:
--telnet-port 0and--websocket-port 0are refused, where 0.18 read them as the default ports 5116 and 5117. Leave the option out for the default. See Controlling a running load test. - behavior change: the WebSocket Controller is off by default, as it takes no authentication and any web page a browser opens could reach it. A load test that used it adds
--websocketorGooseDefault::WebSocket;--no-websocketandGooseDefault::NoWebSocketstill run, with a warning, and are refused with--websocket.--no-autostart --no-telnetnow needs--websocketor--dashboard-control. See WebSocket Controller. - behavior change: the telnet and WebSocket Controllers listen on
127.0.0.1by default, where 0.18 listened on0.0.0.0, as neither has authentication. A load test controlled over telnet or WebSocket from another machine, or from outside its container, now needs--telnet-host 0.0.0.0or--websocket-host 0.0.0.0(orGooseDefault::TelnetHostorGooseDefault::WebSocketHost), or an ssh tunnel to127.0.0.1:5116; a Controller listening on any address that is not loopback prints a warning at startup. See Controlling a running load test. - behavior change: a Controller’s
configandconfig-jsonshow a dashboard auth token that is set as(set), never the token, as does{:?}of aGooseConfiguration. See Controller commands.