class Rackprof::RequestNotify

Public Instance Methods

notify(&block) click to toggle source
# File lib/rackprof/request_notify.rb, line 8
def notify(&block)
  ret = []

  profile = StackProf.run(mode: :cpu) do
    ret = block.call
  end

  if count_observers > 0
    io = StringIO.new
    #StackProf::Report.new(profile).print_graphviz(nil, io)
    StackProf::Report.new(profile).print_text(false, 20, io)

    changed
    notify_observers(io.string)
  end

  ret
end