Module: MetricSense::ClassMethods

Extended by:
Forwardable
Included in:
MetricSense
Defined in:
lib/metricsense.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#collectorObject (readonly)

Returns the value of attribute collector.



125
126
127
# File 'lib/metricsense.rb', line 125

def collector
  @collector
end

Instance Method Details

#config(conf) ⇒ Object



120
121
122
123
# File 'lib/metricsense.rb', line 120

def config(conf)
  @collector = Collector.new(conf)
  self
end

#contextObject



131
132
133
# File 'lib/metricsense.rb', line 131

def context
  Thread.current[MetricSense.to_s] ||= Context.new(@collector)
end

#measure(tag, values = {}) ⇒ Object



127
128
129
# File 'lib/metricsense.rb', line 127

def measure(tag, values={})
  @collector.measure Event.new(tag).value(values) if @collector
end