-
Notifications
You must be signed in to change notification settings - Fork 251
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
Add SIGQUIT summary support similar to ping #185
Conversation
src/fping.c
Outdated
@@ -252,6 +252,8 @@ int socket6 = -1; | |||
int hints_ai_family = AF_UNSPEC; | |||
#endif | |||
|
|||
volatile int status_snapshot = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think "volatile" is wrong here. It is a qualifier reserved for embedded programs where the variable's value can change without the compiler knowing (memory-mapped IO, etc.).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Values changed in signal handlers also fall in that class - the variable may be changed outside of the normal flow of execution that the compiler expects. Signal handlers are processed asynchronously from the main flow of execution.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are right, I learned something :) But then, shouldn't it be of type sig_atomic_t ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense to be cross-platform correct (I think sig_atomic_t == int o most platforms, but TIL something too :) ) I'll update the PR and add it to this commit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok updated to use sig_atomic_t
.
Think I got the whole squash commit thing right...
Fix xmt stats in Netdata output
This reverts commit 3b3877f.
Thanks! |
ping supports printing out an intermediate summary of results and resuming via
SIGQUIT
(ctrl-\
). fping currently prints out summary statistics only for hosts responding. This allows a summary to be output of all hosts without terminating the run.Sample output: