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

Feature request: Add a timestamp in the JSON output #66

Open
gnud opened this issue Oct 24, 2020 · 6 comments
Open

Feature request: Add a timestamp in the JSON output #66

gnud opened this issue Oct 24, 2020 · 6 comments

Comments

@gnud
Copy link

gnud commented Oct 24, 2020

It would be lovely if you introduce a timestamp in the JSON output, so that if I probe with this app every few minutes I would know the probe time.

For the moment I need to transform the JSON output each time the app completes, or if we can have append custom object application arguments with data generated from somewhere else.
E.g:
speed-test -v -j -d '{"ts": "fdffd", "hostname": "pc1"}'

that way you don't have to change a lot, just at the end of the result generation to merge the arguments object.

Thanks.

@sindresorhus
Copy link
Owner

Doesn't seem like adding a timestamp will help you much though since it seems you'll need to add other things to the JSON too. It would probably be easier for you to use something like https://stedolan.github.io/jq/

@gnud
Copy link
Author

gnud commented Oct 25, 2020

By adding the timestamp on a fork, works as planned.

My goal was, when it starts the Speedtest probing to record the start time, then I process the output to monitoring software, visualizing the data metrics by download/upload per minute.

Here is a fork as reference: https://github.com/gnud/speed-test

If you approve the changes I can open a PR.

@sindresorhus
Copy link
Owner

Yeah, looks good. PR welcome.

@sindresorhus
Copy link
Owner

If anyone wants to work on this, see the initial attempt and feedback in #67.

@danodlr
Copy link

danodlr commented Dec 17, 2021

Hello @sindresorhus, This is my first time doing Open Source and I would like to start helping with this issue, I have read #67 as you suggested and the source code, the documentation about this timestamp could be added in the section Usage in the README file as part of the Options or only as a note that --json adds a timestamp?

@gnud
Copy link
Author

gnud commented Dec 18, 2021

@danodlr since I can't allocate any time at the moment, please finish it.

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

No branches or pull requests

3 participants