Ejemplo n.º 1
0
                'OS_POLLING_INTERVAL', 900)))
    os_retries = config.get('OS_RETRIES', int(os.getenv('OS_RETRIES', 1)))
    os_cpu_overcomit_ratio = config.get(
        'OS_CPU_OC_RATIO', float(
            os.getenv(
                'OS_CPU_OC_RATIO', 1)))
    os_ram_overcomit_ratio = config.get(
        'OS_RAM_OC_RATIO', float(
            os.getenv(
                'OS_RAM_OC_RATIO', 1)))

    osclient = OSClient(
        os_keystone_url,
        os_password,
        os_tenant_name,
        os_username,
        os_user_domain,
        os_region,
        os_timeout,
        os_retries)
    oscache = OSCache(os_polling_interval, os_region)
    collectors.append(oscache)

    check_os_api = CheckOSApi(oscache, osclient)
    collectors.append(check_os_api)
    neutron_agent_stats = NeutronAgentStats(oscache, osclient)
    collectors.append(neutron_agent_stats)
    cinder_service_stats = CinderServiceStats(oscache, osclient)
    collectors.append(cinder_service_stats)
    nova_service_stats = NovaServiceStats(oscache, osclient)
    collectors.append(nova_service_stats)
Ejemplo n.º 2
0
        os.getenv('OS_APPLICATION_CREDENTIAL_SECRET'))
    os_interface = config.get('OS_INTERFACE',
                              os.getenv('OS_INTERFACE', 'public'))
    os_region = config.get('OS_REGION_NAME', os.getenv('OS_REGION_NAME'))
    os_timeout = config.get('TIMEOUT_SECONDS',
                            int(os.getenv('TIMEOUT_SECONDS', 10)))
    os_polling_interval = config.get(
        'OS_POLLING_INTERVAL', int(os.getenv('OS_POLLING_INTERVAL', 900)))
    os_retries = config.get('OS_RETRIES', int(os.getenv('OS_RETRIES', 1)))
    os_cpu_overcomit_ratio = config.get('OS_CPU_OC_RATIO',
                                        float(os.getenv('OS_CPU_OC_RATIO', 1)))
    os_ram_overcomit_ratio = config.get('OS_RAM_OC_RATIO',
                                        float(os.getenv('OS_RAM_OC_RATIO', 1)))

    osclient = OSClient(os_keystone_url, os_application_credential_id,
                        os_application_credential_secret, os_interface,
                        os_region, os_timeout, os_retries)
    oscache = OSCache(os_polling_interval, os_region)
    collectors.append(oscache)

    check_os_api = CheckOSApi(oscache, osclient)
    collectors.append(check_os_api)
    neutron_agent_stats = NeutronAgentStats(oscache, osclient)
    collectors.append(neutron_agent_stats)
    cinder_service_stats = CinderServiceStats(oscache, osclient)
    collectors.append(cinder_service_stats)
    nova_service_stats = NovaServiceStats(oscache, osclient)
    collectors.append(nova_service_stats)
    hypervisor_stats = HypervisorStats(oscache, osclient,
                                       os_cpu_overcomit_ratio,
                                       os_ram_overcomit_ratio)