vendor/bundle/ruby/2.3.0/gems/sqreen-1.10.5/lib/sqreen/metrics_store.rb
# Definition contains a name,period and aggregate at least
# @param definition [Hash] a metric definition
# @param klass [Object] Override metric class (used in testing)
Definition contains a name,period and aggregate at least
Definition contains a name period and aggregate at least
def create_metric(definition, mklass = nil)
      name = definition[NAME_KEY]
      kind = definition[KIND_KEY]
      klass = valid_metric(kind, name)
      metric = mklass || klass.new
      @metrics[name] = [
        metric,
        definition[PERIOD_KEY],
        nil 
      ]
      metric
    end
def create_metric ( definition , mklass = nil ) name = definition [ NAME_KEY ] kind = definition [ KIND_KEY ] klass = valid_metric ( kind , name ) metric = mklass || klass . new @metrics [ name ] = [ metric , definition [ PERIOD_KEY ] , nil ] metric end
Definition contains a name,period and aggregate at least
Definition contains a name period and aggregate at least
# Start
definition
a metric definition
a metric definition
mklass
<not_specific>
klass
<not_specific>
Override metric class (used in testing)
Override metric class ( used in testing )