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

API Endpoint Provider ProxyConfig List #2201

Merged
merged 4 commits into from
Oct 13, 2020

Conversation

Martouta
Copy link
Contributor

@Martouta Martouta commented Oct 13, 2020

Last part of THREESCALE-4528
Depends on the other PRs of the issue.

APIcast needs to fetch all proxy configs of a provider and doing so by fetching first all its services (just for its IDs) and then doing an API request to proxy configs for each service is just a too slow approach.

@Martouta Martouta self-assigned this Oct 13, 2020
@Martouta Martouta added the do not review This PR is currently not reviewable label Oct 13, 2020
@Martouta Martouta force-pushed the THREESCALE-4528-proxy_config-API-performance branch 12 times, most recently from 5b3b1d1 to ee5f8f1 Compare October 13, 2020 08:41
@Martouta Martouta removed the do not review This PR is currently not reviewable label Oct 13, 2020
@Martouta Martouta changed the title [WIP] [DO NOT REVIEW] API Endpoint Provider ProxyConfig List [WIP] API Endpoint Provider ProxyConfig List Oct 13, 2020
@Martouta Martouta added feature A new feature of the product on hold Waiting for or blocked by something else. ruby Pull requests that update Ruby code labels Oct 13, 2020
@Martouta Martouta force-pushed the THREESCALE-4528-proxy_config-API-performance branch 3 times, most recently from 332093b to 12716f8 Compare October 13, 2020 10:04
@Martouta Martouta removed the on hold Waiting for or blocked by something else. label Oct 13, 2020
@Martouta Martouta force-pushed the THREESCALE-4528-proxy_config-API-performance branch from 12716f8 to 192cfb2 Compare October 13, 2020 11:46
@Martouta
Copy link
Contributor Author

Martouta commented Oct 13, 2020

To help me test:

@tenants = Account.tenants.last(2).to_a

def make_pcs(service, number)
  proxy = service.proxy
  return if proxy.proxy_configs.count >= number
  number.times do
    proxy.proxy_configs.create!(environment: ProxyConfig::ENVIRONMENTS.sample, content: ({ proxy: { hosts: ['example.com']}}.to_json))
  end
end

@tenants.each do |t|
  t.services.each do |s|
    begin
      ServiceCreator.new(service: s).call(private_endpoint: BackendApi.default_api_backend)
    rescue ThreeScale::Core::APIClient::ConnectionError, ThreeScale::Core::APIClient::JSONError
    end
    make_pcs(s, 30)
  end
end

@Martouta Martouta temporarily deployed to preview01 October 13, 2020 13:02 Inactive
Better for adding/changing endpoints in a similar way to the other endpoints of proxy configs.
@Martouta Martouta force-pushed the THREESCALE-4528-proxy_config-API-performance branch from 192cfb2 to 7d5e1fd Compare October 13, 2020 16:06
macejmic
macejmic previously approved these changes Oct 13, 2020
@Martouta Martouta marked this pull request as ready for review October 13, 2020 16:44
@Martouta Martouta changed the title [WIP] API Endpoint Provider ProxyConfig List API Endpoint Provider ProxyConfig List Oct 13, 2020
@Martouta Martouta added the Priority: Blocker This PR is a blocker. Everyone should review and help to close it ASAP. label Oct 13, 2020
@Martouta Martouta merged commit 4112d7d into master Oct 13, 2020
@Martouta Martouta deleted the THREESCALE-4528-proxy_config-API-performance branch October 13, 2020 20:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature A new feature of the product Priority: Blocker This PR is a blocker. Everyone should review and help to close it ASAP. ruby Pull requests that update Ruby code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants