Help us understand the problem. What is going on with this article?

Speedtest.net の公式 CLI が公開されたので試してみる

実は speedtest-cli は非公式ツール

バイナリをダウンロードして叩くだけの speedtest-cli はMatt Martzさんが作成した非公式のツール。
完成度が高いので誤解されやすいが、非公式ツールで、実装の関係で結果も本物とは誤差があるらしい。

LinuxでもSpeedtestがしたい(speedtest-cli)

オフィシャルCLIが公開

speedtest-cliの完成度が高いので、正直微妙だが、Speedtest.net の運営元である Ookla が10月29日にオフィシャルのCLIツールを公開した。

https://www.speedtest.net/insights/blog/introducing-speedtest-cli/

使ってみた感想としては、お手軽ツールではなくキチンと測定したい人向け。
Linux用だけでなく、MacOSやFreeBSD、Windows用が公開されているので、比較用には便利。
あと、speedtest-cliに比べてCPU負荷が低い。

Speedtest CLI - Internet connection measurement for developers

alt

ただインストールがリポジトリ経由だったりと、セットアップは必要。rootが必要になるのも痛い。

インストール方法
wget https://bintray.com/ookla/rhel/rpm -O bintray-ookla-rhel.repo
sudo mv bintray-ookla-rhel.repo /etc/yum.repos.d/
sudo yum install speedtest

使った感じはこんな感じ
speedtest-cliに比べ、見やすさと表示される値はこっちのほうが良い。
結果のURLも自動で作成されるしね。

speedtest-official
$ speedtest

   Speedtest by Ookla

     Server: OPEN Project (via 20G SINET) - Tokyo (id = 15047)
        ISP: Oracle Public Cloud
    Latency:     1.59 ms   (0.04 ms jitter)
   Download:    46.78 Mbps (data used: 72.3 MB)
     Upload:    46.73 Mbps (data used: 72.7 MB)
Packet Loss:     0.0%
 Result URL: https://www.speedtest.net/result/c/03c00778-c2ab-440c-ad3e-b57416f94c28

参考までにspeedtest-cliはこんな感じ

speedtest-cli
$ speedtest-cli
Retrieving speedtest.net configuration...
Testing from Oracle Public Cloud (132.145.112.27)...
Retrieving speedtest.net server list...
Retrieving information for the selected server...
Hosted by OPEN Project (via 20G SINET) (Tokyo) [6.34 km]: 11.416 ms
Testing download speed................................................................................
Download: 42.60 Mbit/s
Testing upload speed................................................................................................
Upload: 43.67 Mbit/s

CPU負荷について

Oracle Cloud の Always Freeインスタンス(0.8vCPU、1GBRAM)の結果だが、あきらかにオフィシャルCLIのほうがCPU負荷が低い。

alt

オプション

知っている人は知っている「OPEN Project」の狙い撃ち

OPEN_Project狙いうち
./speedtest -L | grep "OPEN Project" | awk '{print $1}' | xargs ./speedtest -s

speedtest-cliとは違ってダウンロードだけはできない。
出力フォーマット(csv, tsv, json, jsonl, json-pretty)は変更可。

パラメータ
$ ./speedtest -h
Speedtest by Ookla is the official command line client for testing the speed and performance of your internet connection.

Version: speedtest 1.0.0.2

Usage: speedtest [<options>]
  -h, --help                        Print usage information
  -V, --version                     Print version number
  -L, --servers                     List nearest servers
  -s, --server-id=#                 Specify a server from the server list using its id
  -I, --interface=ARG               Attempt to bind to the specified interface when connecting to servers
  -i, --ip=ARG                      Attempt to bind to the specified IP address when connecting to servers
  -o, --host=ARG                    Specify a server, from the server list, using its host's fully qualified domain name
  -p, --progress=yes|no             Enable or disable progress bar (Note: only available for 'human-readable'
                                    or 'json' and defaults to yes when interactive)
  -P, --precision=#                 Number of decimals to use (0-8, default=2)
  -f, --format=ARG                  Output format (see below for valid formats)
  -u, --unit[=ARG]                  Output unit for displaying speeds (Note: this is only applicable
                                    for ‘human-readable’ output format and the default unit is Mbps)
  -a                                Shortcut for [-u auto-decimal-bits]
  -A                                Shortcut for [-u auto-decimal-bytes]
  -b                                Shortcut for [-u auto-binary-bits]
  -B                                Shortcut for [-u auto-binary-bytes]
      --selection-details           Show server selection details
      --ca-certificate=ARG          CA Certificate bundle path
  -v                                Logging verbosity. Specify multiple times for higher verbosity
      --output-header               Show output header for CSV and TSV formats

 Valid output formats: human-readable (default), csv, tsv, json, jsonl, json-pretty

 Machine readable formats (csv, tsv, json, jsonl, json-pretty) use bytes as the unit of measure with max precision

 Valid units for [-u] flag:
   Decimal prefix, bits per second:  bps, kbps, Mbps, Gbps
   Decimal prefix, bytes per second: B/s, kB/s, MB/s, GB/s
   Binary prefix, bits per second:   kibps, Mibps, Gibps
   Binary prefix, bytes per second:  kiB/s, MiB/s, GiB/s
   Auto-scaled prefix: auto-binary-bits, auto-binary-bytes, auto-decimal-bits, auto-decimal-bytes
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away