class MetricFu::Reporter

Public Class Methods

new(formatters = nil) click to toggle source
# File lib/metric_fu/reporter.rb, line 3
def initialize(formatters = nil)
  @formatters = Array(formatters)
end

Public Instance Methods

display_results() click to toggle source
# File lib/metric_fu/reporter.rb, line 25
def display_results
  notify :display_results
end
finish() click to toggle source
# File lib/metric_fu/reporter.rb, line 11
def finish
  notify :finish
end
finish_metric(metric) click to toggle source
# File lib/metric_fu/reporter.rb, line 20
def finish_metric(metric)
  mf_log "** ENDING METRIC #{metric}"
  notify :finish_metric, metric
end
start() click to toggle source
# File lib/metric_fu/reporter.rb, line 7
def start
  notify :start
end
start_metric(metric) click to toggle source
# File lib/metric_fu/reporter.rb, line 15
def start_metric(metric)
  mf_log "** STARTING METRIC #{metric}"
  notify :start_metric, metric
end

Protected Instance Methods

notify(event, *args) click to toggle source
# File lib/metric_fu/reporter.rb, line 31
def notify(event, *args)
  @formatters.each do |formatter|
    formatter.send(event, *args) if formatter.respond_to?(event)
  end
end