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

Added CSV mode #162

Closed
wants to merge 5 commits into from
Closed

Added CSV mode #162

wants to merge 5 commits into from

Conversation

gonzalo
Copy link

@gonzalo gonzalo commented Jul 6, 2015

I'm happy to make this sugestion as my first GitHub contribution to a project :-).
I've added a --csv filename mode that write speedtest results to that filename.

speedtest-cli --csv bandwith_report.csv

If the file doesn't extists it generates a new one with a header. If it cannot write launches an error. This is a sample result:

Test server;Date/Time;Latency;Dowload Speed (Kb/s);Upload Speed (Kb/s)
Grupo TVHoradada (Pilar De La Horadada) [87.32 km];2015-07-06T11:28:32.013159;64.8;59847;25499
Grupo TVHoradada (Pilar De La Horadada) [87.32 km];2015-07-06T11:29:30.652184;62.22;59636;25775
TVAlmansa S.L. (Almansa) [50.87 km];2015-07-06T11:32:33.344205;85.19;60257;24798
TVAlmansa S.L. (Almansa) [50.87 km];2015-07-06T11:33:29.556000;62.26;58992;25111
...

You can install a cron jon to execute the test each hour for example and store results for future analysis or graphic.

$crontab -e
0 */1 * * * /home/myuser/speedtest-cli --csv bandwith_report.csv >> /dev/null

Edited:
Standar output is been redirected to /dev/null in crontab. It could be interesting to add a --silent mode to use in combination with --csv

@gonzalo
Copy link
Author

gonzalo commented Jul 27, 2015

Combining this script with a web server and dygraphs js library you can get a nice upload/download/latency grapht ;-)
descarga

@FatBoyNotSoSlim
Copy link

Hey @gonzalo what was your code for the dygraphs page?

@gonzalo
Copy link
Author

gonzalo commented Aug 27, 2015

Here you have it in a repository https://github.com/gonzalo/html-bandwidth-report

@gonzalo
Copy link
Author

gonzalo commented Oct 13, 2015

Hi @sivel I see that this branch is marked as "needs-revision". Does it need your revision? my revision? Can I make any contribution? I'll be pleased to collaborate because I'm currently using my branch in some installations to test ISP stability.

@sivel
Copy link
Owner

sivel commented Oct 13, 2015

This PR contains merge conflicts that would need to be resolved.

@CelsoSantos
Copy link

I really like this functionality instead of running scripts to capture the output. Can I do anything to help this feature get pushed into the "default" app? If not, is there any expected date for release?

@gonzalo
Copy link
Author

gonzalo commented Nov 24, 2015

Thanks for your support Celso, I would also like to have this features pushed into master branch. I've been using it to check my ISP connnection. Here you have the sample.
captura de pantalla 2015-11-24 a las 17 32 37

@sivel sivel added the on-hold label Dec 22, 2015
Linuturk added a commit to Linuturk/speedtest-cli that referenced this pull request Feb 8, 2016
@C-Duv
Copy link

C-Duv commented May 16, 2016

Good idead, a one-line output format (like CSV) is useful (for monitoring systems).
I think allowing printing CSV directly to STDOUT (instead of a file) could be useful too (can be piped, etc.):
speedtest-cli --csv -

@cjeanneret
Copy link

Hello,

Would be great if the merge conflict could be solved and this PR merged — a CSV (or json, or any other parsable output) is a plus when we want to automate checks and get graphes.

Cheers,

C.

@sivel
Copy link
Owner

sivel commented Aug 29, 2016

Regardless of the merge conflict this PR will not be accepted. The next release already has machine parseable outputs.

See #212

@sivel sivel closed this Aug 29, 2016
Repository owner locked and limited conversation to collaborators Nov 30, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
6 participants