Skip to content

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

@meldsza

Description

@meldsza

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions