Next: , Up: Metrics


8.12.1 Metric Events

MetricEvent objects represent individual items to monitor. There are three sub-classes implemented:

MetricCountEvent
Records incremental increase or decrease of some value, or an absolute measure of some value.
          from buildbot.process.metrics import MetricCountEvent
          
          # We got a new widget!
          MetricCountEvent.log('num_widgets', 1)
          
          # We have exactly 10 widgets
          MetricCountEvent.log('num_widgets', 10, absolute=True)

MetricTimeEvent
Measures how long things take. By default the average of the last 10 times will be reported.
          from buildbot.process.metrics import MetricTimeEvent
          
          # function took 0.001s
          MetricTimeEvent.log('time_function', 0.001)

MetricAlarmEvent
Indicates the health of various metrics.
          from buildbot.process.metrics import MetricAlarmEvent, ALARM_OK
          
          # num_slaves looks ok
          MetricAlarmEvent.log('num_slaves', level=ALARM_OK)