artilleryio / artillery

The complete load testing platform. Everything you need for production-grade load tests. Serverless & distributed. Load test with Playwright. Load test HTTP APIs, GraphQL, WebSocket, and more. Use any Node.js module.
https://www.artillery.io
Mozilla Public License 2.0
8.04k stars 511 forks source link

Mean metric is not numeric #2256

Closed ematta closed 1 year ago

ematta commented 1 year ago

Version info:

v2.0.0-38

Running this command:

yarn artillery run --output testrun.json tests/artillery/[playwright-test].yml

I expected to see this happen:

The mean to have a number

--------------------------------
Summary report @ 18:17:35(+0000)
--------------------------------

browser.http_requests: ......................................................... 4321
browser.page.CLS.https://url/:
  min: ......................................................................... 0
  max: ......................................................................... 0
  mean: ........................................................................ undefined
  median: ...................................................................... 0
  p95: ......................................................................... 0
  p99: ......................................................................... 0
browser.page.FCP.https://url/:
  min: ......................................................................... 427.2
  max: ......................................................................... 3348.1
  mean: ........................................................................ undefined
  median: ...................................................................... 1022.7
  p95: ......................................................................... 2276.1
  p99: ......................................................................... 2893.5
browser.page.LCP.https://url/:
  min: ......................................................................... 499.4
  max: ......................................................................... 3629.2
  mean: ........................................................................ undefined
  median: ...................................................................... 1587.9
  p95: ......................................................................... 3328.3
  p99: ......................................................................... 3605.5
browser.page.TTFB.https://url/:
  min: ......................................................................... 23.3
  max: ......................................................................... 425.8
  mean: ........................................................................ undefined
  median: ...................................................................... 46.1
  p95: ......................................................................... 295.9
  p99: ......................................................................... 415.8
vusers.completed: .............................................................. 27
vusers.created: ................................................................ 101
vusers.created_by_name.0: ...................................................... 101
vusers.failed: ................................................................. 74
vusers.session_length:
  min: ......................................................................... 45312.9
  max: ......................................................................... 85215.8
  mean: ........................................................................ undefined
  median: ...................................................................... 62964
  p95: ......................................................................... 83310.3
  p99: ......................................................................... 83310.3
vusers.skipped: ................................................................ 19

Instead, this happened:

Mean is undefined

--------------------------------
Summary report @ 18:17:35(+0000)
--------------------------------

browser.http_requests: ......................................................... 4321
browser.page.CLS.https://url/:
  min: ......................................................................... 0
  max: ......................................................................... 0
  mean: ........................................................................ undefined
  median: ...................................................................... 0
  p95: ......................................................................... 0
  p99: ......................................................................... 0
browser.page.FCP.https://url/:
  min: ......................................................................... 427.2
  max: ......................................................................... 3348.1
  mean: ........................................................................ undefined
  median: ...................................................................... 1022.7
  p95: ......................................................................... 2276.1
  p99: ......................................................................... 2893.5
browser.page.LCP.https://url/:
  min: ......................................................................... 499.4
  max: ......................................................................... 3629.2
  mean: ........................................................................ undefined
  median: ...................................................................... 1587.9
  p95: ......................................................................... 3328.3
  p99: ......................................................................... 3605.5
browser.page.TTFB.https://url/:
  min: ......................................................................... 23.3
  max: ......................................................................... 425.8
  mean: ........................................................................ undefined
  median: ...................................................................... 46.1
  p95: ......................................................................... 295.9
  p99: ......................................................................... 415.8
vusers.completed: .............................................................. 27
vusers.created: ................................................................ 101
vusers.created_by_name.0: ...................................................... 101
vusers.failed: ................................................................. 74
vusers.session_length:
  min: ......................................................................... 45312.9
  max: ......................................................................... 85215.8
  mean: ........................................................................ undefined
  median: ...................................................................... 62964
  p95: ......................................................................... 83310.3
  p99: ......................................................................... 83310.3
vusers.skipped: ................................................................ 19

Files being used:

config:
  target: https://url
  includeFiles:
    - ../../.yarnrc.yml
    - ../../.yarn/
  tls:
    rejectUnauthorized: false
  engines:
    playwright: 
      launchOptions:
        headless: true
      contextOptions:
        baseURL: https://url
  processor: "./index.bundle.js"
  phases:
    # - name: initLoad
    #   duration: 60
    #   arrivalCount: 1
    #   maxVusers: 1
    - name: normalLoad
      duration: 300
      arrivalRate: 5
      maxVusers: 50
scenarios:
  - engine: playwright
    testFunction: "func"
bernardobridge commented 1 year ago

Hi @ematta !

Thanks for reporting this. I'll take a look at it! Can you let me know if in the json report (testrun.json) that you generated, the mean was also showing up as undefined (or not appearing)?


P.S. as I replied here, still having the includeFiles in the config is probably why it's still doing the installs on Fargate!

bernardobridge commented 1 year ago

Hey @ematta 👋, had a thought yesterday, and I believe I've managed to replicate the issue. I think the problem is that since you're using Artillery as a dependency, your lock files still kept dependant packages at an older version.

You should be able to confirm this by running cat node_modules/@artilleryio/int-core/package.json | grep version in the path where your node_modules is (or if that doesn't work, try to find that package @artilleryio/int-core in your node_modules, and confirm which version it has in package.json).

If the version you see there is not 2.2.0, then you won't have mean, and that is causing the reporter to show that as undefined.


You should be able to resolve this by making sure that your lock files are updated. If nothing else works, I believe simply reinstalling artillery (uninstall then install artillery@2.0.0-38 fresh) should work.

ematta commented 1 year ago

You were right. My version is "version": "2.2.0",. Let me uninstall and re-install to see if the version bumps up.

ematta commented 1 year ago

So I uninstalled and re-installed artillery and I am still seeing version 2.2.0 in the new yarn install.

bernardobridge commented 1 year ago

I think you misunderstood me @ematta - sorry if I wasn't clear. The version for that package should be 2.2.0. I meant if it's <2.2.0, then that would be the issue. Are you still getting the mean undefined problem after reinstalling?

I was only able to replicate this when using an existing installation - the package-lock file I had was causing the mismatch. Can you try installing Artillery from scratch in another directory and seeing if you still have the issue?

ematta commented 1 year ago

You were right. This seems to be an error with the previous version hiding in my yarn.lock file. Closing this out since this doesn't seem to be a real issue.