These are chat archives for ManageIQ/manageiq/performance

Dec 2015
Keenan Brock
Dec 08 2015 15:14
@jrafanie is this a good contender for memoist? (think we also have a kind of memoist with a timeout that we have invented ourselves too...)
  def self.openstack_hosts_exists?
    ems = ManageIQ::Providers::Openstack::InfraManager.all
    Host.where(:ems_id => ems).exists?

  def self.non_openstack_hosts_exists?
    ems = ManageIQ::Providers::Openstack::InfraManager.all
    Host.where.not(:ems_id => ems).exists?
note - ems is translated to a subquery
first query is run for every page (for non open stack installs) and both are run for openstack installse
query ends up being trivial:
SELECT  1 AS one
FROM "hosts"
WHERE ("hosts"."ems_id" NOT IN (
    SELECT "ext_management_systems"."id"
    FROM "ext_management_systems"
    WHERE "ext_management_systems"."type"
        IN ('ManageIQ::Providers::Openstack::InfraManager'))) LIMIT 1
Joe Rafaniello
Dec 08 2015 15:25
@kbrock I'll take alook in a few minutes, looking at bot memory usage
Keenan Brock
Dec 08 2015 15:25
Keenan Brock
Dec 08 2015 17:12
@akrzos I'm sucking in 10k hosts from "performance" over internet
you said it takes just a few minutes?
Dennis Metzger
Dec 08 2015 17:41
depends on your definition of “few"
Alex Krzos
Dec 08 2015 18:13
@kbrock depends 5.4 or 5.5