Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix xmt stats in Netdata output #172

Merged
merged 1 commit into from
Mar 1, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions src/fping.c
Original file line number Diff line number Diff line change
Expand Up @@ -1469,6 +1469,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");
Copy link
Contributor

@ilyam8 ilyam8 Feb 27, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be nice you swap received and sent. It is common pattern in netdata - received goes first and has green color.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bad currently: when green > red

after swap: when red > green

Expand All @@ -1486,15 +1495,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