tag1consulting / goose

Load testing framework, inspired by Locust
https://tag1.com/goose
Apache License 2.0
799 stars 71 forks source link

#222: Allow naming of tasks without naming requests #580

Open alecsmrekar opened 8 months ago

alecsmrekar commented 8 months ago

https://github.com/tag1consulting/goose/issues/222

This is an attempt at giving the user the option to name a transaction without that name affecting the name of the requests inside of it.

At the core of it is the new enum TransactionName, that basically forces you to decide if you need the transaction name in the context of the transaction, or in the context of a request.

Can can test this by registering a transactions in the two following ways and checking out the resulting results (either csv, text or html).

GooseAttack::initialize()?
        .register_scenario(
            scenario!("Some Scenario")
                .register_transaction(transaction!(test).set_name("My Transaction")),
        )
        .execute()
        .await?;

or

GooseAttack::initialize()?
        .register_scenario(
            scenario!("Some Scenario")
                .register_transaction(transaction!(test).set_name_transaction_only("My Transaction")),
        )
        .execute()
        .await?;

I know I probably did some mistakes with how to optimally deal with the borrow checker, but I'm here to learn.