Skip to content

Commit

Permalink
Merge pull request schweikert#172 from vlvkobal/develop
Browse files Browse the repository at this point in the history
Fix xmt stats in Netdata output
  • Loading branch information
schweikert authored Mar 1, 2020
2 parents 589d326 + edf8475 commit 25e30da
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/fping.c
Original file line number Diff line number Diff line change
Expand Up @@ -1487,6 +1487,15 @@ void print_netdata(void)
for (i = 0; i < num_hosts; i++) {
h = table[i];

/* if we just sent the probe and didn't receive a reply, we shouldn't count it */
h->discard_next_recv_i = 0;
if (h->waiting && timeval_diff(&current_time, &h->last_send_time) < h->timeout) {
if (h->num_sent_i) {
h->num_sent_i--;
h->discard_next_recv_i = 1;
}
}

if (!sent_charts) {
printf("CHART fping.%s_packets '' 'FPing Packets for host %s' packets '%s' fping.packets line 110020 %d\n", h->name, h->host, h->name, report_interval / 100000);
printf("DIMENSION xmt sent absolute 1 1\n");
Expand All @@ -1504,15 +1513,6 @@ void print_netdata(void)
/* printf("DIMENSION lost '' absolute 1 1\n"); */
}

/* if we just sent the probe and didn't receive a reply, we shouldn't count it */
h->discard_next_recv_i = 0;
if (h->waiting && timeval_diff(&current_time, &h->last_send_time) < h->timeout) {
if (h->num_sent_i) {
h->num_sent_i--;
h->discard_next_recv_i = 1;
}
}

printf("BEGIN fping.%s_quality\n", h->name);
/*
if( h->num_recv_i <= h->num_sent_i )
Expand Down

0 comments on commit 25e30da

Please sign in to comment.