Fix throughput calculation
This commit is contained in:
@@ -772,15 +772,13 @@ int main(int argc, char *argv[]) {
|
|||||||
|
|
||||||
double startTime = now();
|
double startTime = now();
|
||||||
for (double prevTime = startTime,
|
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);) {
|
!g_shutdown.load(std::memory_order_relaxed);) {
|
||||||
sleep(g_config.stats_interval);
|
sleep(g_config.stats_interval);
|
||||||
|
|
||||||
double currTime = now();
|
double currTime = now();
|
||||||
double currConnections = connectionId.load(std::memory_order_relaxed);
|
double currRequests = g_total_requests.load(std::memory_order_relaxed);
|
||||||
double throughput = (currConnections - prevConnections) /
|
double throughput = (currRequests - prevRequests) / (currTime - prevTime);
|
||||||
(currTime - prevTime) *
|
|
||||||
g_config.requests_per_connection;
|
|
||||||
|
|
||||||
// Get latency statistics
|
// Get latency statistics
|
||||||
uint64_t total_requests = g_total_requests.load(std::memory_order_relaxed);
|
uint64_t total_requests = g_total_requests.load(std::memory_order_relaxed);
|
||||||
@@ -807,7 +805,7 @@ int main(int argc, char *argv[]) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
prevTime = currTime;
|
prevTime = currTime;
|
||||||
prevConnections = currConnections;
|
prevRequests = currRequests;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (auto &thread : threads) {
|
for (auto &thread : threads) {
|
||||||
|
|||||||
Reference in New Issue
Block a user