-
Notifications
You must be signed in to change notification settings - Fork 899
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
Azure: Event support #7439
Azure: Event support #7439
Conversation
e0e3dd4
to
2ecf321
Compare
Azure::Armrest::Insights::EventService.new(conf) | ||
end | ||
|
||
def each |
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 each
is not used anywhere. I removed it from the aws eventstream :)
@blomquisg @Fryguy please review |
@blomquisg @Fryguy - ready for review |
while @collecting_events | ||
|
||
# Grab only events for the last minute if this is the first poll | ||
startup_interval = (Time.current - 1.minute).httpdate |
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.
this is only used for the first iteration of the loop.
how about inlining it or extracting a method?
you might even consider extracting the whole filter logic into their own methods and leave each_batch
only concerned with yielding events
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.
@durandom - Yea, doing this made the code that bit more readable I think.
Time.zone.parse(events.last.event_timestamp).to_f + 0.001 | ||
end | ||
|
||
def print_timestamp(time) |
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.
nitpick: can you rename this method to format_timestamp
? When I read it, I thought it was going to output the timestamp somewhere. :)
A couple nitpicks. Otherwise, LGTM @Fryguy can you look at the config updates? @gmcculloug can you look at the event handling updates? |
@lfu Please review the event handling and suggest policy event actions where needed. |
# We do not care for 'Begin' events, only the 'End' events which indicate | ||
# the action the event relates to was completed successfully. | ||
event_type = parse_event_type(event) | ||
filtered_events.include?(event_type) || event_type.end_with?("BeginRequest") |
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'm not sure why we wouldn't collect Begin events...in other providers we try to collect everything.
@@ -130,6 +130,7 @@ event_groups: | |||
- orchestration.autoscaling.error | |||
- servergroup.update | |||
- servergroup.addmemeber | |||
- virtualMachines_write_EndRequest |
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.
These changes should not be in this file...they should be in settings.yml
@bronaghs Looks really good! Most of my comments were style and structure, so relatively minor. |
thanks @Fryguy ! |
<pr_mergeability_checker />This pull request is not mergeable. Please rebase and repush. |
@blomquisg @Fryguy @durandom @chessbyte |
The event switchboard modeling looks good. |
Checked commits bronaghs/manageiq@5f81bc2~...bdfff05 with ruby 2.2.3, rubocop 0.37.2, and haml-lint 0.16.1 app/models/manageiq/providers/azure/cloud_manager/event_catcher/stream.rb
spec/models/manageiq/providers/azure/cloud_manager/event_catcher/runner_spec.rb
|
looks good to me, nice job @bronaghs 👍 only as a side note for future specs, if you run this...
...it should read like documentation. That also helps reading the specs in order to get a clue on how the code is supposed to work and to fix broken specs. It also helps structuring the specs in a nice clean way. |
What the heck @durandom?! Holding out on the cool tricks! :) |
Event support for Azure.
A couple of points to note:
Corresponding Trello card:
https://trello.com/c/QnXCQPZj/50-3-azure-events-event-mappings