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

Improve time unit granularity for CSV file output from test runs #2275

Closed
rpocklin opened this issue Dec 1, 2021 · 2 comments
Closed

Improve time unit granularity for CSV file output from test runs #2275

rpocklin opened this issue Dec 1, 2021 · 2 comments

Comments

@rpocklin
Copy link
Contributor

rpocklin commented Dec 1, 2021

Currently output from test runs can be stored in JSON or CSV file formats.

In JSON, the timestamp of each event sampled is in in ISO8601 format when serialized (eg. {time: "2021-12-01T14:04:26.5295103+11:00"} which has 7 decimal places, but in the CSV output it is defined as Time.Unix() which is only give second level granularity (eg. 1638331259), which is not sufficient when looking at load and performance tests.

I don't see a way to specify the desired format easily across output formats, but recommend at least it have a sufficient level of granularity to compare test runs on an intra-second scale. It may be better to have both file formats output the same format, but currently it is already different.

Here is a PR to improve this (but am open to other suggestions and feedback of course) which uses UnixMicro() to add 6 decimal places of granularity to the timestamp for CSV file output: #2274

@na--
Copy link
Member

na-- commented Apr 12, 2023

This was originally supposed to be closed by #2274, though in the end the PR was trimmed down and didn't actually fully resolve this issue. It just laid out the groundwork by adding a timeFormat option and support for RFC3399, but that support was still limited to 1-second precision. #2906 then fully resolved it by adding nanosecond precision and will be released in the upcoming k6 v0.44.0.

@na-- na-- closed this as completed Apr 12, 2023
@na-- na-- added this to the v0.44.0 milestone Apr 12, 2023
@fenchu
Copy link

fenchu commented May 16, 2023

Tested v0.44.1 and I still get sec timestamp resolution: #2839

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants