def _get_counter(instance, c_data): return util.make_counter_from_instance( instance, name='disk.read.requests', type=counter.TYPE_CUMULATIVE, unit='request', volume=c_data.r_requests, )
def _get_counter(instance, c_data): return util.make_counter_from_instance( instance, name='disk.write.bytes', type=counter.TYPE_CUMULATIVE, unit='B', volume=c_data.w_bytes, )
def get_samples(manager, cache, instance): yield util.make_counter_from_instance( instance, name='instance', type=sample.TYPE_GAUGE, unit='instance', volume=1, )
def _get_counter(instance, c_data): return util.make_counter_from_instance( instance, name='disk.read.bytes', type=sample.TYPE_CUMULATIVE, unit='B', volume=c_data.r_bytes, )
def get_counters(manager, cache, instance): yield util.make_counter_from_instance( instance, name='instance', type=counter.TYPE_GAUGE, unit='instance', volume=1, )
def _get_counter(instance, c_data): return util.make_counter_from_instance( instance, name='disk.read.requests', type=sample.TYPE_CUMULATIVE, unit='request', volume=c_data.r_requests, )
def _get_counter(instance, c_data): return util.make_counter_from_instance( instance, name='disk.write.bytes', type=sample.TYPE_CUMULATIVE, unit='B', volume=c_data.w_bytes, )
def get_samples(self, manager, cache, instance): self.instances.append((manager, instance)) test_data_2 = util.make_counter_from_instance( instance, name='test2', type=sample.TYPE_CUMULATIVE, unit='units-go-here', volume=1, ) return [self.test_data_1, test_data_2]
def get_counters(manager, cache, instance): yield util.make_counter_from_instance( instance, # Use the "meter name + variable" syntax name='instance:%s' % instance.flavor['name'], type=counter.TYPE_GAUGE, unit='instance', volume=1, )
def get_samples(manager, cache, instance): yield util.make_counter_from_instance( instance, # Use the "meter name + variable" syntax name='instance:%s' % instance.flavor['name'], type=sample.TYPE_GAUGE, unit='instance', volume=1, )
def get_samples(self, manager, cache, instance): LOG.info('checking instance %s', instance.id) instance_name = util.instance_name(instance) try: cpu_info = manager.inspector.inspect_cpus(instance_name) LOG.info("CPUTIME USAGE: %s %d", instance.__dict__, cpu_info.time) cpu_num = {'cpu_number': cpu_info.number} yield util.make_counter_from_instance( instance, name='cpu', type=sample.TYPE_CUMULATIVE, unit='ns', volume=cpu_info.time, additional_metadata=cpu_num, ) except Exception as err: LOG.error('could not get CPU time for %s: %s', instance.id, err) LOG.exception(err)