-
Notifications
You must be signed in to change notification settings - Fork 125
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
Add the date of when inventory was collected #340
Conversation
This fixes the |
@@ -0,0 +1,5 @@ | |||
class AddLastCollectedDateToEms < ActiveRecord::Migration[5.0] | |||
def change | |||
add_column :ext_management_systems, :last_collected_date, :datetime |
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.
Discussion note, _date was used here for consistency with other date columns...would have like this to be called _at otherwise.
Naming wise |
Yeah I like tying this to the last_refresh_date attribute, only issue I have with High level I'd like this to represent the timestamp for how old the inventory data is that we saved rather than when the save finished. |
Isn't naming fun? I think the process of collecting or refreshing the inventory "clouds" the meaning of the current suggestions... what a user really wants to know is what inventory we have: inventory_captured_at Throw in _last if you want, such as: |
I do like |
do we care about the word capture or refresh?
|
naming is hard |
5302668
to
e9746f0
Compare
Okay |
note, the old filename and class reference the original idea. I'm ok with it... but in case it bothered you...
|
We have a column tracking when the EMS was last successfully saved (#last_refresh_date). This tells us when save_inventory last finished, but a lot of code wants to know when the inventory which was saved was collected. An example of this is "I just added a disk to a VM at time T0, I want to know when this change is represented in VMDB" You can wait until last_refresh_date >= T0, but it is possible that this was in the queue for a long time and the inventory was actually collected at T-1 and just saved at T1. If we had a column that stored when the inventory was collected then no matter how long the refresh sat in the queue we would know for a fact that the EMS includes our changes. Currently this is done by getting a task_id back with the refresh queue item, but e.g. VMware streaming refresh doesn't use the normal queue for refreshes so this method won't work.
e9746f0
to
5dda780
Compare
Good catch updated |
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, what say you @Fryguy... we did a thing with naming
Checked commit agrare@5dda780 with ruby 2.3.3, rubocop 0.52.1, haml-lint 0.20.0, and yamllint 1.10.0 |
@Fryguy what do you think of the name? |
He'll have an opinion after I merge it 😉 😉 😉 ... will give a few more hours and then pull the trigger |
We have a column tracking when the EMS was last successfully saved
(#last_refresh_date). This tells us when save_inventory last finished,
but a lot of code wants to know when the inventory which was saved was
collected.
An example of this is "I just added a disk to a VM at time T1, I want to
know when this change is represented in VMDB"
You can wait until last_refresh_date >= T1, but it is possible that
save_inventory took a long time and the inventory was actually
collected at T0 and just saved at T2.
If we had a column that stored when the inventory was collected then no
matter how long the refresh sat in the queue we would know for a fact
that the EMS includes our changes.
Currently this is done by getting a task_id back with the refresh queue
item, but e.g. VMware streaming refresh doesn't use the normal queue for
refreshes so this method won't work.