-
Notifications
You must be signed in to change notification settings - Fork 12
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
Issue #92: Update monitoring with notification throttling #93
Conversation
The default behavior is now to send one notification upon the first limit trip and no further notifications for any consecutive limit trips. The number of consecutive limit-tripping packets required to trigger a notification can be changed from the default of 1 in the |
59bfb11
to
2f0fbe0
Compare
Added a script that tests that the new notifications options work as expected. |
ait/gui/__init__.py
Outdated
@@ -389,8 +389,15 @@ def telem_handler(session): | |||
for k, v in tlm.getDefaultDict().iteritems(): | |||
packet_dict[v.uid] = v | |||
|
|||
notif_thrshld = ait.config.get('notifications.options.threshold') |
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.
Let's go ahead and set sane defaults here. Otherwise the behavior could end up being a bit off. For instance, as is the notif_thrshld
variable ends up set as None
if my config doesn't have a value for notifications.options.threshold
and I enable monitoring.
You can do this with a one line for both of these values
notif_thrshld = ait.config.get('notifications.options.threshold', 1)
notif_freq = ait.config.get('notifications.options.frequency', float('inf'))
I'm +1 besides the above comment. Please make sure to open a ticket so that the relevant config options get added to the core |
Pull request for example values added to |
…otifications Implements new limit trip notification 'threshold' config. Notification only sent once per any number of consecutive limit trips, and only after limit trip 'threshold' (required number of consecutive tripping packets) has been met.
…otifications Implements new limit trip notification 'frequency' config by triggering notifications every 'frequency' consecutive limit-tripping packet, not taking 'threshold' into account.
…g default notif config options
Resolves #92
Eventually this should probably be a configurable parameter