Skip to content

Commit

Permalink
Set upload benchmark endpoints (#4947)
Browse files Browse the repository at this point in the history
* chore: Add endpoints for upload benchmark

* fix: Do not add up transferred bytes for upload benchmark
  • Loading branch information
flozia authored and ahal committed Nov 16, 2022
1 parent 7aa4511 commit 49b3da7
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
4 changes: 3 additions & 1 deletion src/connectionbenchmark/benchmarktasktransfer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,9 @@ void BenchmarkTaskTransfer::transferProgressed(qint64 bytesSent,
}
case BenchmarkUpload: {
Q_UNUSED(reply);
m_bytesTransferred += bytesSent;
if (bytesSent > 0) {
m_bytesTransferred = bytesSent;
}
break;
}
default: {
Expand Down
2 changes: 1 addition & 1 deletion src/connectionbenchmark/connectionbenchmark.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ class ConnectionBenchmark final : public QObject {

private:
QUrl m_downloadUrl = QUrl(Constants::BENCHMARK_DOWNLOAD_URL);
QUrl m_uploadUrl = QUrl(Constants::BENCHMARK_UPLOAD_URL);
QUrl m_uploadUrl = QUrl(Constants::benchmarkUploadUrl());

QList<BenchmarkTask*> m_benchmarkTasks;

Expand Down
6 changes: 4 additions & 2 deletions src/constants.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,6 @@ constexpr uint32_t BENCHMARK_THRESHOLD_SPEED_FAST = 25000000; // 25 Megabit
constexpr uint32_t BENCHMARK_THRESHOLD_SPEED_MEDIUM = 10000000; // 10 Megabit
constexpr const char* BENCHMARK_DOWNLOAD_URL =
"https://archive.mozilla.org/pub/vpn/speedtest/50m.data";
// TODO: Add url for upload benchmark
constexpr const char* BENCHMARK_UPLOAD_URL = "";

#if defined(UNIT_TEST)
# define CONSTEXPR(type, functionName, releaseValue, debugValue, \
Expand Down Expand Up @@ -115,6 +113,10 @@ constexpr const char* GOOGLE_SUBSCRIPTIONS_URL =

constexpr const char* ADDON_SETTINGS_GROUP = "addons";

PRODBETAEXPR(
const char*, benchmarkUploadUrl, "https://benchmark.vpn.mozilla.org/upload",
"https://dev.vpn-network-benchmark.nonprod.webservices.mozgcp.net/upload");

PRODBETAEXPR(QString, fxaApiBaseUrl, "https://api.accounts.firefox.com",
envOrDefault("MVPN_FXA_API_BASE_URL",
"https://api-accounts.stage.mozaws.net"))
Expand Down

0 comments on commit 49b3da7

Please sign in to comment.