def lifecycle
      # Create a new metric to hold the task and conditions.
      m = Metric.new(self)

      # Let the config file define some conditions on the metric.
      yield(m)

      # Populate the condition -> metric directory.
      m.conditions.each do |c|
        self.directory[c] = m
      end

      # Record the metric.
      self.metrics[nil] << m
    end
def lifecycle
      # Create a new metric to hold the task and conditions.
      m = Metric.new(self)

      # Let the config file define some conditions on the metric.
      yield(m)

      # Populate the condition -> metric directory.
      m.conditions.each do |c|
        self.directory[c] = m
      end

      # Record the metric.
      self.metrics[nil] << m
    end
Public: Define a lifecycle handler. Conditions that belong to a
 lifecycle are active as long as the process is being monitored.

 Returns nothing.