Note: This project is community supported and provided as-is for users and client integrators. Contributions are welcome (PRs and issues).
ndt7-client-cc is a Network-Diagnostic-Tool (NDT) single-include C++11 client library and command line client. NDT is a widely used network performance test that measures the download and upload speed, and complements these measurements with kernel-level measurements. NDT is the most popular network performance test hosted by Measurement Lab.
This library implements the ndt7 protocol. The libndt7 code should be considered an alpha release.
We forked this library from measurement-kit/libndt@6a9040c21fc.
libndt7 depends on OpenSSL (for TLS support and in the future for WebSocket support) and cURL (to autodiscover servers).
Download single_include/libndt7.hpp and put it in the current working directory.
This example runs a download-only ndt7 test with a nearby, healthy server.
Create a file named main.cpp
with this content:
#include "libndt7.hpp"
int main() {
using namespace measurementlab;
libndt7::Settings settings;
std::unique_ptr<libndt7::Client> client;
settings.metadata["client_name"] = CLIENT_NAME;
settings.metadata["client_version"] = CLIENT_VERSION;
client.reset(new libndt7::Client{settings});
client->run();
}
Compile your client with a unique name using:
g++ -std=c++11 -Wall -Wextra -I. \
-DCLIENT_NAME=\"my-ndt7-client\" \
-DCLIENT_VERSION=\"v0.1.0\" \
-o main main.cpp
For API documentation, see include/libndt7/libndt7.hpp for the full API.
See ndt7-client-cc.cpp for a comprehensive, reference client.
To develop libndt7 or run tests, you need a clone of the repository.
git clone https://github.com/m-lab/ndt7-client-cc
Build and run tests with:
cmake .
cmake --build .
ctest -a --output-on-failure .
By default the reference client (ndt7-client-cc
) and the single include
libndt7.hpp are installed to system a default location like /usr/local/
.
$ cmake --install .
-- Install configuration: ""
-- Installing: /usr/local/bin/ndt7-client-cc
-- Installing: /usr/local/include/libndt7/libndt7.hpp
You may specify an alternate prefix.
cmake --install . --prefix /my/install/prefix
Building with CMake also builds a simple command line client. Get usage info by running:
./ndt7-client-cc -help
Vendored dependencies are in third_party
. We include the complete path to
where they can be found such that updating is obvious.