Skip to content

feat(cli): add json output to coder speedtest #13475

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

Merged
merged 13 commits into from
Jun 5, 2024
Merged

Conversation

ethanndickson
Copy link
Member

@ethanndickson ethanndickson commented Jun 5, 2024

Adds output formatter (--output) to the coder speedtest command that supports json, and the default table.
Table formatter also now supports table separators.

$ coder speedtest pog2
Starting a 5s download test...
INTERVAL       THROUGHPUT           
0.00-1.00 sec  1821.5677 Mbits/sec  
1.00-2.01 sec  1917.1062 Mbits/sec  
2.01-3.05 sec  1618.2648 Mbits/sec  
3.05-4.05 sec  1911.1037 Mbits/sec  
4.05-5.11 sec  1561.0834 Mbits/sec  
------------------------------------
0.00-5.12 sec  1762.7815 Mbits/sec  
$ coder speedtest --output='json' pog2
Starting a 5s download test...
{
  "overall": {
    "start_time_seconds": 0,
    "end_time_seconds": 5.153840548,
    "throughput_mbits": 1748.0876461139599
  },
  "intervals": [
    {
      "start_time_seconds": 0,
      "end_time_seconds": 1.004183525,
      "throughput_mbits": 1871.219896781318
    },
    {
      "start_time_seconds": 1.004183525,
      "end_time_seconds": 2.006560015,
      "throughput_mbits": 1824.380920985088
    },
    {
      "start_time_seconds": 2.006560015,
      "end_time_seconds": 3.009975467,
      "throughput_mbits": 1605.130489858153
    },
    {
      "start_time_seconds": 3.009975467,
      "end_time_seconds": 4.011640821,
      "throughput_mbits": 1808.9268244771497
    },
    {
      "start_time_seconds": 4.011640821,
      "end_time_seconds": 5.145398001,
      "throughput_mbits": 1642.5659822502735
    }
  ]
}

Closes #13437

Copy link

github-actions bot commented Jun 5, 2024

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@ethanndickson
Copy link
Member Author

I have read the CLA Document and I hereby sign the CLA

cdrcommunity added a commit to coder/cla that referenced this pull request Jun 5, 2024
Copy link
Member

@deansheather deansheather left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Congrats on first PR 🎉

@deansheather deansheather self-requested a review June 5, 2024 08:11
@ethanndickson ethanndickson enabled auto-merge (squash) June 5, 2024 08:11
@ethanndickson ethanndickson merged commit a4bba52 into main Jun 5, 2024
28 checks passed
@ethanndickson ethanndickson deleted the ethan/speedtest-json branch June 5, 2024 08:31
@github-actions github-actions bot locked and limited conversation to collaborators Jun 5, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add JSON output to speedtest CLI command
2 participants