]> git.gsnw.org Git - fping.git/commitdiff
use function stats_reset_interval()
authorErik Auerswald <auerswal@unix-ag.uni-kl.de>
Sat, 17 Feb 2024 16:34:57 +0000 (17:34 +0100)
committerDavid Schweikert <david@schweikert.ch>
Tue, 20 Feb 2024 08:41:16 +0000 (09:41 +0100)
Git commit bb8d71ef27f673f25c7e1648ea982c27bb61ac0d from 2020 among many
other things introduced the function stats_reset_interval() to reset the
*_i interval (or split) host statistics, but did not use it.  This commit
replaces the open coded reset of interval stats inside print_host_splits()
and print_netdata() with calling stats_reset_interval().

src/fping.c

index 820eaef70e58dd89319cbea280cc4200db4a3585..be375655412d746a0b2bc18037324db2ea4ccb35 100644 (file)
@@ -380,6 +380,7 @@ void usage(int);
 int wait_for_reply(int64_t);
 void print_per_system_stats(void);
 void print_per_system_splits(void);
+void stats_reset_interval(HOST_ENTRY *h);
 void print_netdata(void);
 void print_global_stats(void);
 void main_loop();
@@ -1738,7 +1739,7 @@ void print_netdata(void)
         }
         printf("END\n");
 
-        h->num_sent_i = h->num_recv_i = h->max_reply_i = h->min_reply_i = h->total_time_i = 0;
+        stats_reset_interval(h);
     }
 
     sent_charts = 1;
@@ -1798,7 +1799,7 @@ void print_per_system_splits(void)
         }
 
         fprintf(stderr, "\n");
-        h->num_sent_i = h->num_recv_i = h->max_reply_i = h->min_reply_i = h->total_time_i = 0;
+        stats_reset_interval(h);
     }
 }