Install iPerf3 from the developer: iPerf - The ultimate speed test tool for TCP, UDP and SCTP. This is a stand-alone cli, which doesn't require brew or MacPorts.
In the Terminal enter:
iperf3 -c <server-ip>
to get the upload speed/bandwidth and:
iperf3 -c <server-ip> -R
to get the download speed/bandwidth
You can get some public iPerf servers here: Public iPerf3 servers. Other servers are available by searching for iperf/iperf3 servers with Google.
I have tested this one: https://speedtest.wtnet.de/ (while watching TV online) with the following results:
iperf3 -c speedtest.wtnet.de -p 5200 -P 10 -4
...
[SUM] 0.00-10.00 sec 12.1 MBytes 10.1 Mbits/sec sender
[SUM] 0.00-10.00 sec 10.9 MBytes 9.17 Mbits/sec receiver
iperf3 -c speedtest.wtnet.de -p 5200 -P 10 -4 -R
...
[SUM] 0.00-10.00 sec 54.2 MBytes 45.5 Mbits/sec 558 sender
[SUM] 0.00-10.00 sec 51.8 MBytes 43.5 Mbits/sec receiver
The 558 in the third sum is the retry countnumber of retransmitted TCP segments (Retr)!