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

Default to a 0 evaluation frequency in dwh alerts #678

Merged
merged 1 commit into from
Apr 6, 2017

Conversation

moolitayer
Copy link

@moolitayer moolitayer commented Mar 14, 2017

See ManageIQ/manageiq#14318 for explanation why a 0 notification frequency makes sense here

manageiq control

@moolitayer
Copy link
Author

@miq-bot add_label bug, providers/containers

@miq-bot
Copy link
Member

miq-bot commented Mar 14, 2017

@moolitayer Cannot apply the following label because they are not recognized: providers/containers

@miq-bot miq-bot added the bug label Mar 14, 2017
@moolitayer moolitayer changed the title Default to a 0 evaluation frequncy in dwh alerts Default to a 0 evaluation frequency in dwh alerts Mar 14, 2017
@moolitayer moolitayer closed this Mar 14, 2017
@moolitayer moolitayer reopened this Mar 14, 2017
@moolitayer
Copy link
Author

@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")
Copy link
Author

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
Copy link
Author

@cben @zgalor please review

@simon3z
Copy link
Contributor

simon3z commented Mar 20, 2017

@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"?)
What about other alerts? Is this option available only for DWH?

@moolitayer
Copy link
Author

@simon3z I'm not sure what's most usable here. I added a screen shot, the values are
Notification Frequency: 0, Notification Frequency: 1 Minute ...

Another option I can think of is Notification Frequency: Always Evaluate

@simon3z
Copy link
Contributor

simon3z commented Mar 21, 2017

@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?

@moolitayer
Copy link
Author

@moolitayer what about other alerts? Is this option available only for DWH?

I asked about that but I guess it is better to only have this options for dwh. Updated the PR.

@moolitayer for DWH what are the options you display? If "0" is the only one that makes sense, is it the only one available?

Updated. Note since our main use case is API I initial created ManageIQ/manageiq#14318 to block non zero alerts in the model

@simon3z
Copy link
Contributor

simon3z commented Mar 21, 2017

@moolitayer are all these validations enforced for Rest-API as well? (I suppose they should be at model-level for that)

@moolitayer
Copy link
Author

@simon3z since our main use case is API I initial created ManageIQ/manageiq#14318 to block non zero alerts in the model

@simon3z
Copy link
Contributor

simon3z commented Mar 21, 2017

@moolitayer not sure what "Always Notify" means, could it be better saying "Notify Always"?
Also, Always/In some cases/Never is not an interval frequency so it doesn't seem to belong there.

@moolitayer
Copy link
Author

Also, Always/In some cases/Never is not an interval frequency so it doesn't seem to belong there

So back to 0 then?

@simon3z
Copy link
Contributor

simon3z commented Mar 21, 2017

Also, Always/In some cases/Never is not an interval frequency so it doesn't seem to belong there

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).

@moolitayer
Copy link
Author

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 [Always Notify, Always Evaluate, 0, -1]

@simon3z cc

[1] for the same target object ofcurse

@simon3z
Copy link
Contributor

simon3z commented Mar 22, 2017

@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.

@moolitayer
Copy link
Author

@simon3z nice, done

Copy link
Contributor

@simon3z simon3z left a 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

@moolitayer
Copy link
Author

Rubocop fix

@miq-bot
Copy link
Member

miq-bot commented Mar 26, 2017

Checked commit moolitayer@4a4e8bf with ruby 2.2.6, rubocop 0.47.1, and haml-lint 0.20.0
2 files checked, 0 offenses detected
Everything looks good. ⭐

@miq-bot
Copy link
Member

miq-bot commented Mar 27, 2017

@moolitayer 'gtanzillo' is an invalid assignee, ignoring...

@moolitayer
Copy link
Author

attempting to assign again per comment

@miq-bot assign gtanzillo

@gtanzillo Please take a look

@miq-bot
Copy link
Member

miq-bot commented Mar 27, 2017

@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"
Copy link
Member

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.

Copy link
Author

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

Copy link
Author

Choose a reason for hiding this comment

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

@gtanzillo PTAL

Copy link
Author

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.

Copy link
Member

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"
Copy link
Member

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"
Copy link
Member

Choose a reason for hiding this comment

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

Understood @moolitayer

@moolitayer
Copy link
Author

@dclarizio please review

@dclarizio dclarizio assigned dclarizio and unassigned simon3z Apr 6, 2017
@dclarizio dclarizio merged commit 2f6d6af into ManageIQ:master Apr 6, 2017
@dclarizio dclarizio added this to the Sprint 58 Ending Apr 10, 2017 milestone Apr 6, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants