-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathInternetometer.h
More file actions
27 lines (21 loc) · 912 Bytes
/
Copy pathInternetometer.h
File metadata and controls
27 lines (21 loc) · 912 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
//
// Yandex Internetometer (yandex.ru/internet) test mode.
// Measurement logic based on https://github.com/Master290/internetometer-cli (MIT)
//
#ifndef SPEEDTEST_INTERNETOMETER_H
#define SPEEDTEST_INTERNETOMETER_H
#include <functional>
#include <string>
#include <vector>
struct YandexProbes {
std::vector<std::string> latency_urls;
std::string download_url;
std::string upload_url;
long upload_size = 0;
};
using YandexProgressFn = std::function<void(bool, double)>;
bool yandexGetProbes(YandexProbes& probes, bool insecure);
bool yandexLatency(const YandexProbes& probes, long& ping_ms, long& jitter_ms, bool insecure);
bool yandexDownload(const YandexProbes& probes, double& mbps, bool insecure, YandexProgressFn progress = nullptr);
bool yandexUpload(const YandexProbes& probes, double& mbps, bool insecure, YandexProgressFn progress = nullptr);
#endif // SPEEDTEST_INTERNETOMETER_H