Fix throughput calculation

This commit is contained in:
2025-08-22 14:26:56 -04:00
parent ce7e596836
commit c536522f21

View File

@@ -772,15 +772,13 @@ int main(int argc, char *argv[]) {
double startTime = now();
for (double prevTime = startTime,
prevConnections = connectionId.load(std::memory_order_relaxed);
prevRequests = g_total_requests.load(std::memory_order_relaxed);
!g_shutdown.load(std::memory_order_relaxed);) {
sleep(g_config.stats_interval);
double currTime = now();
double currConnections = connectionId.load(std::memory_order_relaxed);
double throughput = (currConnections - prevConnections) /
(currTime - prevTime) *
g_config.requests_per_connection;
double currRequests = g_total_requests.load(std::memory_order_relaxed);
double throughput = (currRequests - prevRequests) / (currTime - prevTime);
// Get latency statistics
uint64_t total_requests = g_total_requests.load(std::memory_order_relaxed);
@@ -807,7 +805,7 @@ int main(int argc, char *argv[]) {
}
prevTime = currTime;
prevConnections = currConnections;
prevRequests = currRequests;
}
for (auto &thread : threads) {