Reference ndt7 Go client implementation. Useful resources:
The main branch contains stable code. We don't promise we won't break
the API, but we'll try not to.
You need Go >= 1.25.5.
Clone the repository wherever you want with
git clone https://github.com/m-lab/ndt7-client-goFrom inside the repository, use go build -v ./cmd/ndt7-client to
build the client. Binaries will be placed in ..
If you're into a one-off install, this
go install -v github.com/m-lab/ndt7-client-go/cmd/ndt7-client@latestis equivalent to cloning the repository, running go build -v ./cmd/ndt7-client,
installing the binary in $HOME/go/bin and deleting the repository.
In case you are integrating an ndt7-client binary into a third-party application, it may be useful to build it with a custom client name. Since this value is passed to the server as metadata, doing so will allow you to retrieve measurements coming from your custom integration in Measurement Lab's data easily.
To set a custom client name at build time:
CLIENTNAME=my-custom-client-name
go build -ldflags "-X main.ClientName=$CLIENTNAME" ./cmd/ndt7-clientWhile ndt7-client is a "single shot" ndt7 client, there is also a
non-interactive periodic test runner ndt7-prometheus-exporter.
git clone https://github.com/m-lab/ndt7-client-go
docker build -t ndt7-prometheus-exporter .To run tests repeatedly
PORT=9191
docker run -d -p ${PORT}:8080 ndt7-prometheus-exporter# scrape ndt7 test metrics
- job_name: ndt7
metrics_path: /metrics
static_configs:
- targets:
# host:port of the exporter
- localhost:9191
# scrape ndt7-prometheus-exporter itself
- job_name: ndt7-prometheus-exporter
static_configs:
- targets:
# host:port of the exporter
- localhost:9191
Run:
ndt7-clientto run a speedtest.
Use:
ndt7-client -format jsonto obtain output in JSON format.