-
Notifications
You must be signed in to change notification settings - Fork 356
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
Default to a 0 evaluation frequency in dwh alerts #678
Conversation
@miq-bot add_label bug, providers/containers |
@moolitayer Cannot apply the following label because they are not recognized: providers/containers |
@simon3z please review, this has no dependencies |
@@ -486,7 +491,7 @@ def alert_build_pulldowns | |||
4.minutes.to_i => _("4 Minutes"), 5.minutes.to_i => _("5 Minutes"), 10.minutes.to_i => _("10 Minutes"), | |||
15.minutes.to_i => _("15 Minutes"), 30.minutes.to_i => _("30 Minutes"), 1.hour.to_i => _("1 Hour"), | |||
2.hours.to_i => _("2 Hours"), 3.hours.to_i => _("3 Hours"), 4.hours.to_i => _("4 Hours"), | |||
6.hours.to_i => _("6 Hours"), 12.hours.to_i => _("12 Hours"), 1.day.to_i => _("1 Day") | |||
6.hours.to_i => _("6 Hours"), 12.hours.to_i => _("12 Hours"), 1.day.to_i => _("1 Day"), 0.minutes.to_i => _("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.
@gtanzillo is it ok to add a 0 notification frequency for existing alerts types?
also note it won't be the default
@moolitayer does it deserve a better naming in the UI rather than "0"? Can we think of something more descriptive? (I don't know maybe "Immediate"?) |
@simon3z I'm not sure what's most usable here. I added a screen shot, the values are Another option I can think of is |
@moolitayer what about other alerts? Is this option available only for DWH? @moolitayer for DWH what are the options you display? If "0" is the only one that makes sense, is it the only one available? |
I asked about that but I guess it is better to only have this options for dwh. Updated the PR.
Updated. Note since our main use case is API I initial created ManageIQ/manageiq#14318 to block non zero alerts in the model |
2eec229
to
67bc09e
Compare
@moolitayer are all these validations enforced for Rest-API as well? (I suppose they should be at model-level for that) |
@simon3z since our main use case is API I initial created ManageIQ/manageiq#14318 to block non zero alerts in the model |
@moolitayer not sure what "Always Notify" means, could it be better saying "Notify Always"? |
So back to 0 then? |
@moolitayer I wanted to come up with a better naming... what is this doing? This is evaluating the alerts as soon as received... so maybe something along the lines of "Upon Receipt", "When Received", "Immediate", etc. Maybe someone from UX can help us (provided that we explain what this is about). |
Notification frequency does not describe what this value means unless i'm misreading it. If an alert's generating event happened and it has not yet been this time since last evaluation[1], it is not evaluated (MiqAlertStatus will not be created, actions will not fire, etc). see https://github.com/ManageIQ/manageiq/blob/master/app/models/miq_alert.rb#L161 Something parallel in ovirt engine's event log is named flood rate. While this name is what it is the best I can think of is @simon3z cc [1] for the same target object ofcurse |
@moolitayer since it seems that it's not really configurable (frequency is externally defined in the hawkular triggers) then we should probably hide the option altogether. |
@simon3z nice, done |
67bc09e
to
9507e9b
Compare
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.
LGTM 👍
cc @gtanzillo
@miq-bot assign gtanzillo
9507e9b
to
157a73a
Compare
Rubocop fix |
157a73a
to
623fe75
Compare
623fe75
to
4a4e8bf
Compare
Checked commit moolitayer@4a4e8bf with ruby 2.2.6, rubocop 0.47.1, and haml-lint 0.20.0 |
@moolitayer 'gtanzillo' is an invalid assignee, ignoring... |
attempting to assign again per comment @miq-bot assign gtanzillo @gtanzillo Please take a look |
@moolitayer 'gtanzillo' is an invalid assignee, ignoring... |
if (@edit[:new][:expression][:eval_method] && @edit[:new][:expression][:eval_method] == "hourly_performance") || | ||
@edit[:new][:exp_event] == "_hourly_timer_" | ||
1.hour.to_i | ||
elsif @edit[:new][:expression][:eval_method] && @edit[:new][:expression][:eval_method] == "dwh_generic" |
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.
@moolitayer Are you able to check :always_evaluate
here instead? This way the Ui code can also be generic.
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.
The UI code does not send or knows about :always_evaluate, that is only on the server side
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.
@gtanzillo PTAL
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.
@gtanzillo Please take another look.
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.
Understood @moolitayer
- if @edit | ||
.col-md-8 | ||
- if @edit[:new][:expression][:eval_method] == "hourly_performance" | ||
- repeat = @sb[:alert][:hourly_repeat_times] | ||
- elsif @edit[:new][:expression][:eval_method] == "dwh_generic" |
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.
Same here - would be better if you can check :always_evaluate
here.
if (@edit[:new][:expression][:eval_method] && @edit[:new][:expression][:eval_method] == "hourly_performance") || | ||
@edit[:new][:exp_event] == "_hourly_timer_" | ||
1.hour.to_i | ||
elsif @edit[:new][:expression][:eval_method] && @edit[:new][:expression][:eval_method] == "dwh_generic" |
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.
Understood @moolitayer
@dclarizio please review |
See ManageIQ/manageiq#14318 for explanation why a 0 notification frequency makes sense here