Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Aggregate command does not generate an output that Report/Replay command recognizes #200

Open
meldsza opened this issue Dec 4, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@meldsza
Copy link

meldsza commented Dec 4, 2024

Brief summary

When running the aggregate command on a result.json generated by k6 produces an output that is not recognized by the report command

The issue is when the sse event file is generated, the event param lacks the aggregates field.
Generated event:

{"event":"param","data":{"period":1000}}

Expected event:

{"event":"param","data":{"period":1000,"aggregates":{"counter":["count","rate"],"gauge":["value"],"rate":["rate"],"trend":["avg","max","med","min","p(90)","p(95)","p(99)"]}}}

Most likely, issue is with this line:
https://github.com/grafana/xk6-dashboard/blob/master/dashboard/aggregate.go#L105

k6 version

v0.52.0 (xk6-dashboard plugin build from releases: v0.7.5)

xk6-dashboard version

v0.7.5

OS

Windows 11

Docker version and image (if applicable)

No response

Steps to reproduce the problem

Steps to reproduce:

.\k6.exe run .\test.js -o json=output.json
.\k6-web-dashboard.exe aggregate .\result.json result.ndjson
.\k6-web-dashboard.exe report .\result.ndjson output.html

Note: This can also be replicated using the result.json used in the tests found at: https://github.com/grafana/xk6-dashboard/blob/master/dashboard/testdata/result.json

Expected behaviour

The dashboard loads with the data.

Actual behaviour

The html file fails to load with the error

Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'length')
    at Yl.toAggregate (output.html:18:35128)
    at Eu.onEvent (output.html:18:41236)
    at Tu (output.html:18:42494)Understand this errorAI
@meldsza meldsza added the bug Something isn't working label Dec 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant