Example #1
0
 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,
     )
Example #2
0
 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,
     )
Example #3
0
 def get_samples(manager, cache, instance):
     yield util.make_counter_from_instance(
         instance,
         name='instance',
         type=sample.TYPE_GAUGE,
         unit='instance',
         volume=1,
     )
Example #4
0
 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,
     )
Example #5
0
 def get_counters(manager, cache, instance):
     yield util.make_counter_from_instance(
         instance,
         name='instance',
         type=counter.TYPE_GAUGE,
         unit='instance',
         volume=1,
     )
Example #6
0
 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,
     )
Example #7
0
 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,
     )
Example #8
0
 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]
Example #9
0
 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,
     )
Example #10
0
 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,
     )
Example #11
0
 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)
Example #12
0
 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)