-
Notifications
You must be signed in to change notification settings - Fork 898
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
Vim performance state time interval #22606
Vim performance state time interval #22606
Conversation
self.capture_interval = 3600 | ||
self.capture_interval = 1.hour.to_i |
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.
If it's hardcoded, why even store it?
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.
Oh it's a column? - Wild we have this at all.
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 fine with this for now - future feature just remove the column.
app/models/vim_performance_state.rb
Outdated
# @param obj object holding vps records | ||
# @param timestamp [Time|String] hourly timestamp, prefer Time | ||
# @returns [Range] time range | ||
def self.get_time_interval(obj, timestamp) |
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.
obj isn't even used now - can we remove it?
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 method is only called for hourly.
I think it was written to support all VimPerformanceState
.
But we only store vim performance state values for hours so it is probably moot.
changing
this is returning the time range for a vps, moved it to that code
VPS use a hard coded 1.hour range for the hourly captures. This avoids looking up a record just to come up with the same conclusion
VimPErformanceStates are only stored for hourly. And this is only called for hourly values So passing the object is not needed. If we change that and need to pass the object in the future, I'm sorry
02a3f01
to
134ca05
Compare
update:
|
Checked commits kbrock/manageiq@610473d~...cd86162 with ruby 2.6.10, rubocop 1.28.2, haml-lint 0.35.0, and yamllint |
Moved Helper#get_time_interval to the concept that it represented.
second commit: it also was retrieving a hardcoded value, so avoided the lookup