goose icon indicating copy to clipboard operation
goose copied to clipboard

HTML report file when using Gaggle

Open bellackn opened this issue 2 years ago • 7 comments

How would I generate an HTML report when using a manager node and multiple workers? Is this even possible?

  • The manager doesn't accept the --report-file flag
  • The worker does, but after a loadtest finishes (either Ctrl-C or via --run-time), it throws this error:
thread 'main' panicked at 'internal error: entered unreachable code', C:\Users\nbellack\.cargo\registry\src\github.com-1ecc6299db9ec823\goose-0.15.2\src\metrics.rs:2189:17
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
error: process didn't exit successfully: `target\debug\loadtesting.exe --worker` (exit code: 101)

bellackn avatar Mar 28 '22 10:03 bellackn

I can confirm that I am getting the same error. Will investigate....

slashrsm avatar Mar 29 '22 10:03 slashrsm

With #427 I can use --report-file on manager and I see the report file being generated at the end of the load test.

@bellackn Would you mind testing that branch?

slashrsm avatar Mar 29 '22 10:03 slashrsm

Thanks @slashrsm, the error is gone. However, new problems occur with your branch:

  • the report file data tables remain empty, although the graphs show the requests correctly
  • the worker process doesn't show any metrics when finished

Also, maybe this is unrelated, but this branch doesn't work with goose_eggs. Will update the comment with details.

bellackn avatar Mar 29 '22 11:03 bellackn

It turns out that manager won't write the report (which is what I expected), but the workers will (they seem to inherit the report file configuration from the manager).

I think that the correct way to solve this would be to allow --report-file on both managers and workers. Each would then respect only what was set locally, not what workers got from managers for example.

the worker process doesn't show any metrics when finished

I see the metrics printed on the manager and workers. I started the test with these options

manager:

--manager --expect-workers 2  --host http://localhost -u10 -t10s -s2s --report-file report.html

worker:

--worker

Could you share your run configuration?

slashrsm avatar Mar 29 '22 12:03 slashrsm

You're right, the metrics show up correctly. I ran the tests for a too short amount of time and also had a random waiting time built in. So, works as expected, thanks!

However, I have already teased that the branch doesn't work with goose_eggs anymore. My code:

use goose::prelude::*;
use goose_eggs::{validate_and_load_static_assets, Validate};

#[tokio::main]
async fn main() -> Result<(), GooseError> {
    GooseAttack::initialize()?
        .register_taskset(
            taskset!("WebsiteUser")
                .register_task(task!(load_index)),
        )
        .execute()
        .await?
        .print();

    Ok(())
}

/// Load the start page and all associated static assets
async fn load_index(user: &mut GooseUser) -> GooseTaskResult {
    let goose = user.get("/").await?;
    validate_and_load_static_assets(
        user,
        goose,
        // Validate title and other arbitrary text on the response HTML
        &Validate::builder()
            .title("foo")
            .build(),
    )
    .await?;

    Ok(())
}

The error:

error[E0308]: mismatched types
  --> src\main.rs:28:9
   |
28 |         user,
   |         ^^^^ expected struct `goose::goose::GooseUser`, found a different struct `goose::goose::GooseUser`
   |
   = note: expected mutable reference `&mut goose::goose::GooseUser` (struct `goose::goose::GooseUser`)
              found mutable reference `&mut goose::goose::GooseUser` (struct `goose::goose::GooseUser`)
   = note: perhaps two different versions of crate `goose` are being used?

Not related to the HTML report at all, but this works with goose v0.15.2 and not on your fork branch.

bellackn avatar Mar 29 '22 13:03 bellackn

Is it solved? In which release was it merged?

ActivePeter avatar Dec 05 '23 13:12 ActivePeter

Unfortunately this is still a lingering bug. And the current release of Goose also currently doesn't support Gaggles, the functionality still needs to be added back: https://github.com/tag1consulting/goose/pull/548

jeremyandrews avatar Dec 05 '23 14:12 jeremyandrews