本文整理汇总了Python中monasca_agent.collector.checks.AgentCheck.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python AgentCheck.__init__方法的具体用法?Python AgentCheck.__init__怎么用?Python AgentCheck.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类monasca_agent.collector.checks.AgentCheck
的用法示例。
在下文中一共展示了AgentCheck.__init__方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from monasca_agent.collector.checks import AgentCheck [as 别名]
# 或者: from monasca_agent.collector.checks.AgentCheck import __init__ [as 别名]
def __init__(self, name, init_config, agent_config, instances=None):
AgentCheck.__init__(self, name, init_config, agent_config, instances)
if instances is not None and len(instances) > 1:
raise Exception('cAdvisor host check only supports one configured'
' instance.')
self.connection_timeout = int(init_config.get('connection_timeout',
DEFAULT_TIMEOUT))
self.cadvisor_url = None
self.cadvisor_machine_url = None
self.total_mem = 0
self.num_cores = 0
示例2: __init__
# 需要导入模块: from monasca_agent.collector.checks import AgentCheck [as 别名]
# 或者: from monasca_agent.collector.checks.AgentCheck import __init__ [as 别名]
def __init__(self, name, init_config, agent_config):
AgentCheck.__init__(self, name, init_config, agent_config)
# Load any custom metrics from conf.d/sqlserver.yaml
for row in init_config.get('custom_metrics', []):
if row['type'] not in VALID_METRIC_TYPES:
self.log.error('%s has an invalid metric type: %s' % (row['name'], row['type']))
self.METRICS.append((row['name'], row['type'], row['counter_name'],
row.get('instance_name', ''), row.get('tag_by', None)))
# Cache connections
self.connections = {}
示例3: __init__
# 需要导入模块: from monasca_agent.collector.checks import AgentCheck [as 别名]
# 或者: from monasca_agent.collector.checks.AgentCheck import __init__ [as 别名]
def __init__(self, name, init_config, agent_config, instances=None):
AgentCheck.__init__(self, name, init_config, agent_config, instances=[{}])
self.instance_cache_file = "{0}/{1}".format(self.init_config.get('cache_dir'),
'libvirt_instances.json')
self.metric_cache_file = "{0}/{1}".format(self.init_config.get('cache_dir'),
'libvirt_metrics.json')
self.use_bits = self.init_config.get('network_use_bits')
if self.init_config.get('disk_collection_period'):
self._disk_collection_period = int(self.init_config.get('disk_collection_period'))
self._last_disk_collect_time = datetime.fromordinal(1)
else:
self._disk_collection_period = 0
self._skip_disk_collection = False
示例4: __init__
# 需要导入模块: from monasca_agent.collector.checks import AgentCheck [as 别名]
# 或者: from monasca_agent.collector.checks.AgentCheck import __init__ [as 别名]
def __init__(self, name, init_config, agent_config, instances=None):
AgentCheck.__init__(self, name, init_config, agent_config, instances=[{}])
self.instance_cache_file = "{0}/{1}".format(self.init_config.get('cache_dir'),
'libvirt_instances.json')
self.metric_cache_file = "{0}/{1}".format(self.init_config.get('cache_dir'),
'libvirt_metrics.json')
self.use_bits = self.init_config.get('network_use_bits')
self._collect_intervals = {}
self._set_collection_intervals('disk', 'disk_collection_period')
self._set_collection_intervals('vnic', 'vnic_collection_period')
pool_size = self.init_config.get('max_ping_concurrency', 8)
self.pool = Pool(pool_size)
示例5: __init__
# 需要导入模块: from monasca_agent.collector.checks import AgentCheck [as 别名]
# 或者: from monasca_agent.collector.checks.AgentCheck import __init__ [as 别名]
def __init__(self, name, init_config, agent_config, instances=None):
AgentCheck.__init__(self, name, init_config,
agent_config, instances=[{}])
cache_dir = self.init_config.get('cache_dir')
self.enable_vm = self.init_config.get('enable_vm')
self.enable_ecn = self.init_config.get('enable_ecn')
self.s_factor = self.init_config.get('s_factor')
self.collect_period = self.init_config.get('collect_period')
self.cong_cache_file = os.path.join(cache_dir,
'congestion_status.json')
self.session = keystone.get_session(**self.init_config)
self.chain_exist = False
self.rule_exist = False
self._check_chain()
self.checked = []
if self.enable_ecn:
self._activate_ecn()
示例6: __init__
# 需要导入模块: from monasca_agent.collector.checks import AgentCheck [as 别名]
# 或者: from monasca_agent.collector.checks.AgentCheck import __init__ [as 别名]
def __init__(self, name, init_config, agent_config, instances=None):
AgentCheck.__init__(self, name, init_config,
agent_config, instances=[{}])
cache_dir = self.init_config.get('cache_dir')
self.ctr_cache_file = os.path.join(cache_dir, 'ovs_metrics.json')
self.port_cache_file = os.path.join(cache_dir, 'ovs_ports.json')
self.use_bits = self.init_config.get('network_use_bits')
self.check_router_ha = self.init_config.get('check_router_ha')
self.ovs_cmd = OVS_CMD % self.init_config.get('ovs_cmd')
include_re = self.init_config.get('included_interface_re', None)
self.use_absolute_metrics = self.init_config.get('use_absolute_metrics')
if include_re is None:
include_re = 'qg.*'
else:
include_re = include_re + '|' + 'qg.*'
self.include_iface_re = re.compile(include_re)
示例7: __init__
# 需要导入模块: from monasca_agent.collector.checks import AgentCheck [as 别名]
# 或者: from monasca_agent.collector.checks.AgentCheck import __init__ [as 别名]
def __init__(self, name, init_config, agent_config):
AgentCheck.__init__(self, name, init_config, agent_config)
self.instance_cache_file = "{0}/{1}".format(self.init_config.get('cache_dir'),
'libvirt_instances.yaml')
self.metric_cache_file = "{0}/{1}".format(self.init_config.get('cache_dir'),
'libvirt_metrics.yaml')
示例8: __init__
# 需要导入模块: from monasca_agent.collector.checks import AgentCheck [as 别名]
# 或者: from monasca_agent.collector.checks.AgentCheck import __init__ [as 别名]
def __init__(self, name, init_config, agent_config):
AgentCheck.__init__(self, name, init_config, agent_config)
# Host status needs to persist across all checks
self.cluster_status = {}
示例9: __init__
# 需要导入模块: from monasca_agent.collector.checks import AgentCheck [as 别名]
# 或者: from monasca_agent.collector.checks.AgentCheck import __init__ [as 别名]
def __init__(self, name, init_config, agent_config):
AgentCheck.__init__(self, name, init_config, agent_config)
self.wmi_conns = {}
示例10: __init__
# 需要导入模块: from monasca_agent.collector.checks import AgentCheck [as 别名]
# 或者: from monasca_agent.collector.checks.AgentCheck import __init__ [as 别名]
def __init__(self, name, init_config, agent_config):
AgentCheck.__init__(self, name, init_config, agent_config)
self.high_watermarks = {}
示例11: __init__
# 需要导入模块: from monasca_agent.collector.checks import AgentCheck [as 别名]
# 或者: from monasca_agent.collector.checks.AgentCheck import __init__ [as 别名]
def __init__(self, name, init_config, agent_config):
AgentCheck.__init__(self, name, init_config, agent_config)
self._last_state_by_server = {}
示例12: __init__
# 需要导入模块: from monasca_agent.collector.checks import AgentCheck [as 别名]
# 或者: from monasca_agent.collector.checks.AgentCheck import __init__ [as 别名]
def __init__(self, name, init_config, agent_config):
AgentCheck.__init__(self, name, init_config, agent_config, instances=[{}])
self.max_objects = init_config.get("vcenter_max_objects", 100000)
示例13: __init__
# 需要导入模块: from monasca_agent.collector.checks import AgentCheck [as 别名]
# 或者: from monasca_agent.collector.checks.AgentCheck import __init__ [as 别名]
def __init__(self, name, init_config, agent_config):
AgentCheck.__init__(self, name, init_config, agent_config)
# Host status needs to persist across all checks
self.host_status = defaultdict(lambda: defaultdict(lambda: None))
示例14: __init__
# 需要导入模块: from monasca_agent.collector.checks import AgentCheck [as 别名]
# 或者: from monasca_agent.collector.checks.AgentCheck import __init__ [as 别名]
def __init__(self, name, init_config, agent_config, instances=None):
AgentCheck.__init__(self, name, init_config, agent_config, instances)
self.assumed_url = {}
示例15: __init__
# 需要导入模块: from monasca_agent.collector.checks import AgentCheck [as 别名]
# 或者: from monasca_agent.collector.checks.AgentCheck import __init__ [as 别名]
def __init__(self, name, init_config, agent_config):
AgentCheck.__init__(self, name, init_config, agent_config)
self.dbs = {}
self.versions = {}