]> git.ipfire.org Git - fireperf.git/commitdiff
stats: Rename connections to open_connections
authorMichael Tremer <michael.tremer@ipfire.org>
Thu, 4 Feb 2021 14:20:45 +0000 (14:20 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Thu, 4 Feb 2021 14:22:08 +0000 (14:22 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/client.c
src/server.c

index a6f158513073ea9fd22f38f9bda811be853b7e05..c8ec7a1bec074989dc57bc777aa40c5a29a25830 100644 (file)
@@ -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);
index adf5fe76e9f6b1cf3a1f4c533a7fbc9184319249..02fdeb96b4de71fa8308348f0602093b49bfa55c 100644 (file)
@@ -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;