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

Lazy load endpoints. #188

Merged
merged 2 commits into from
Feb 24, 2017
Merged

Conversation

josejulio
Copy link
Member

Lazy loading the endpoints. This will keep our users for having to do stuff like ManageIQ/manageiq#13814

@cfcosta could you please review ?

// cc @pilhuhn

Copy link
Contributor

@cfcosta cfcosta left a comment

Choose a reason for hiding this comment

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

LGTM, there are some improvements that can be done but they might be out of scope of this PR.

@@ -47,13 +31,37 @@ def method_missing(name, *args, &block)
delegate_client.__send__(method, *args, &block)
end

def inventory
@inventory ||= Inventory::InventoryClient.create(entrypoint: "#{@state[:entrypoint]}/hawkular/inventory",
Copy link
Contributor

Choose a reason for hiding this comment

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

Why does Metrics has a different class name? Can we change the others to be like it? I like it better than to have Inventory::Inventory and Alerts::Alerts.

Copy link
Contributor

Choose a reason for hiding this comment

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

Also the initialization is different on Inventory but not on the others.

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm not sure, but at this point i don't want to break stuff like this: https://github.com/ManageIQ/manageiq/pull/13814/files#diff-7873cbd67d037fe54151ac4d277ccdd4R44

Copy link
Contributor

Choose a reason for hiding this comment

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

You can have this at the end of the file and keep it compatible:

Inventory::InventoryClient = Inventory::Client

Copy link
Member Author

Choose a reason for hiding this comment

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

Will open a separate PR to uniform it.

@coveralls
Copy link

coveralls commented Feb 24, 2017

Coverage Status

Coverage increased (+0.008%) to 96.302% when pulling 4a2e14c on josejulio:lazy_load_endpoints into 7c4cf65 on hawkular:master.

@josejulio
Copy link
Member Author

@rubenvp8510 could you please merge?

@rubenvp8510 rubenvp8510 merged commit 2f9906a into hawkular:master Feb 24, 2017
@rubenvp8510 rubenvp8510 modified the milestone: 2.9.0 Mar 1, 2017
@josejulio josejulio deleted the lazy_load_endpoints branch November 30, 2017 22:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants