Sha256: 1469b61af608a638dfe1e1ad3af3311c33be373f9456df51bb62141ebd344c16

Contents?: true

Size: 684 Bytes

Versions: 10

Compression:

Stored size: 684 Bytes

Contents

module Rack::Insight
  class SphinxPanel < Panel
    require "rack/insight/panels/sphinx_panel/stats"

    def request_start(env, start)
      @stats = Stats.new
    end

    def request_finish(env, status, headers, body, timing)
      store(env, @stats)
      @stats = nil
    end

    def after_detect(method_call, timing, args, message)
      @stats.record_call(timing.duration, args, method_call)
    end

    def heading_for_request(number)
      stats = retrieve(number).first
      "Sphinx: %.2fms (#{stats.queries.size} calls)" % stats.time
    end

    def content_for_request(number)
      render_template "panels/sphinx", :stats => retrieve(number).first
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
rack-insight-0.6.4 lib/rack/insight/panels/sphinx_panel.rb
rack-insight-0.6.3 lib/rack/insight/panels/sphinx_panel.rb
rack-insight-0.6.2 lib/rack/insight/panels/sphinx_panel.rb
rack-insight-0.5.30 lib/rack/insight/panels/sphinx_panel.rb
rack-insight-0.5.29 lib/rack/insight/panels/sphinx_panel.rb
rack-insight-0.5.28 lib/rack/insight/panels/sphinx_panel.rb
rack-insight-0.5.27 lib/rack/insight/panels/sphinx_panel.rb
rack-insight-0.5.26 lib/rack/insight/panels/sphinx_panel.rb
rack-insight-0.5.25 lib/rack/insight/panels/sphinx_panel.rb
rack-insight-0.5.24 lib/rack/insight/panels/sphinx_panel.rb