class Rack::Bug::MustachePanel

Also, it’s fun.
generating data you need.
It can be used to track down slow partials and ensure you’re only
rendering.
Mustache views as well as all the variables accessed during view
MustachePanel is a Rack::Bug panel which tracks the time spent rendering

def self.reset

Clear out our page load-specific variables.
def self.reset
  Thread.current["rack.bug.mustache.times"] = {}
  Thread.current["rack.bug.mustache.vars"] = {}
end

def self.times

The view render times for this page load
def self.times
  Thread.current["rack.bug.mustache.times"] ||= {}
end

def self.variables

The variables used on this page load
def self.variables
  Thread.current["rack.bug.mustache.vars"] ||= {}
end

def content

The content of our Rack::Bug panel
def content
  View.render
ensure
  self.class.reset
end

def heading

The string used for our tab in Rack::Bug's navigation bar
def heading
  "{{%.2fms}}" % self.class.times.values.inject(0.0) do |sum, obj|
    sum + obj
  end
end

def name

The name of this Rack::Bug panel
def name
  "mustache"
end