Module: FiverunsTuneupMerb::Instrumentation::Merb::Controller::Ext

Defined in:
lib/fiveruns_tuneup_merb/instrumentation.rb

Instance Method Summary collapse

Instance Method Details

#_call_filters(filters) ⇒ Object



83
84
85
86
87
88
89
90
91
# File 'lib/fiveruns_tuneup_merb/instrumentation.rb', line 83

def _call_filters(filters)
  if filters.empty?
    super
  else
    Fiveruns::Tuneup.step("Filters (#{filters.size})", :controller, 
      "Filters Called" => FiverunsTuneupMerb::Instrumentation.format_filters(filters)
    ) { super }
  end
end

#bodyObject



63
64
65
66
67
68
69
70
71
72
# File 'lib/fiveruns_tuneup_merb/instrumentation.rb', line 63

def body
  if content_type == :html && request.tuneup
    ::Merb.logger.debug "TuneUp: Saving run and inserting panel into the response"
    run = Fiveruns::Tuneup::Run.new(request.uri, request.tuneup)
    run.save
    Fiveruns::Tuneup.insert_panel(super, run, FiverunsTuneupMerb.can_share?)
  else
    super
  end
end

#partial(template, *args) ⇒ Object



79
80
81
# File 'lib/fiveruns_tuneup_merb/instrumentation.rb', line 79

def partial(template, *args)
  Fiveruns::Tuneup.step("Partial #{template.inspect}", :view) { super }
end

#render(thing = nil, *args) ⇒ Object



74
75
76
77
# File 'lib/fiveruns_tuneup_merb/instrumentation.rb', line 74

def render(thing = nil, *args)
  name = thing ? thing.inspect : nil 
  Fiveruns::Tuneup.step("Render #{name}", :view) { super }
end