Skip to content

Commit

Permalink
use function stats_reset_interval()
Browse files Browse the repository at this point in the history
Git commit bb8d71e 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().
  • Loading branch information
auerswal authored and schweikert committed Feb 20, 2024
1 parent c138b08 commit 266eb16
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/fping.c
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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);
}
}

Expand Down

0 comments on commit 266eb16

Please sign in to comment.