From 27d84e41f4b941fdb164fa3d5198f812604086b5 Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Thu, 4 Feb 2021 14:20:45 +0000 Subject: [PATCH] stats: Rename connections to open_connections Signed-off-by: Michael Tremer --- src/client.c | 8 ++++---- src/server.c | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/client.c b/src/client.c index a6f1585..c8ec7a1 100644 --- a/src/client.c +++ b/src/client.c @@ -37,7 +37,7 @@ struct fireperf_client_stats { struct timespec last_printed; // Total number of open connections - unsigned int connections; + unsigned int open_connections; size_t bytes_sent; size_t total_bytes_sent; @@ -305,7 +305,7 @@ int fireperf_client(struct fireperf_config* conf, int epollfd, int timerfd) { while (!conf->terminated && !timeout_expired) { // Open connections - while (stats.connections < conf->parallel) { + while (stats.open_connections < conf->parallel) { int fd = open_connection(conf); if (fd < 0) continue; @@ -318,7 +318,7 @@ int fireperf_client(struct fireperf_config* conf, int epollfd, int timerfd) { goto ERROR; } - stats.connections++; + stats.open_connections++; } int fds = epoll_wait(epollfd, events, EPOLL_MAX_EVENTS, -1); @@ -363,7 +363,7 @@ int fireperf_client(struct fireperf_config* conf, int epollfd, int timerfd) { close(fd); - stats.connections--; + stats.open_connections--; } else if (events[i].events & EPOLLOUT) { r = send_data_to_server(conf, &stats, fd, pool); diff --git a/src/server.c b/src/server.c index adf5fe7..02fdeb9 100644 --- a/src/server.c +++ b/src/server.c @@ -38,7 +38,7 @@ struct fireperf_server_stats { struct timespec last_printed; // Total number of open connections - unsigned int connections; + unsigned int open_connections; size_t bytes_received; size_t total_bytes_received; @@ -71,7 +71,7 @@ static int dump_stats(struct fireperf_config* conf, struct fireperf_server_stats INFO( conf, "--- %s --------------------\n", timestamp); DEBUG(conf, " %-20s: %19.4fs\n", "Delta", delta); - INFO( conf, " %-20s: %20u\n", "Open Connection(s)", stats->connections); + INFO( conf, " %-20s: %20u\n", "Open Connection(s)", stats->open_connections); INFO( conf, " %-20s: %18s/s\n", "Current Bandwidth", bps); INFO( conf, " %-20s: %20s\n", "Total Bytes Received", total_bytes_received); @@ -257,7 +257,7 @@ int fireperf_server(struct fireperf_config* conf, int epollfd, int timerfd) { } // A connection has been opened - stats.connections++; + stats.open_connections++; // Handle timer events } else if (fd == timerfd) { @@ -289,7 +289,7 @@ int fireperf_server(struct fireperf_config* conf, int epollfd, int timerfd) { close(fd); // This connection is now closed - stats.connections--; + stats.open_connections--; // Skip processing anything else, because it would be pointless continue; -- 2.47.3