class Songkick::Transport::Reporting::Report

Public Class Methods

new() click to toggle source
# File lib/songkick/transport/reporting.rb, line 42
def initialize
  @requests = []
end

Public Instance Methods

execute() { || ... } click to toggle source
# File lib/songkick/transport/reporting.rb, line 46
def execute
  Thread.current[:songkick_transport_report] = self
  yield
ensure
  Thread.current[:songkick_transport_report] = nil
end
to_html(endpoints_to_names) click to toggle source

endpoints_to_names is a hash like:

{"dc1-live-service1:9324" => "media-service"}
# File lib/songkick/transport/reporting.rb, line 60
def to_html(endpoints_to_names)
  source = File.read(File.expand_path("../html_report.html.erb", __FILE__))
  template = ERB.new(source)
  template.result(binding)
end
total_duration() click to toggle source
# File lib/songkick/transport/reporting.rb, line 53
def total_duration
  inject(0) { |s,r| s + r.duration }
end