Sha256: 417c7df9bd6a47db20b256bce0e81991a7506a8f7e9e774e316804adb58b042f
Contents?: true
Size: 596 Bytes
Versions: 4
Compression:
Stored size: 596 Bytes
Contents
require 'chillout/creations_container' module Chillout class CustomMetric def initialize(creations_container = nil) @creations_container = creations_container end def track(name) creations_container.increment!(name) end private def creations_container if container_not_initialized? Thread.current[:creations] ||= CreationsContainer.new @creations_container = Thread.current[:creations] else @creations_container end end def container_not_initialized? @creations_container.nil? end end end
Version data entries
4 entries across 4 versions & 1 rubygems
Version | Path |
---|---|
chillout-0.8.3 | lib/chillout/custom_metric.rb |
chillout-0.8.2 | lib/chillout/custom_metric.rb |
chillout-0.8.1 | lib/chillout/custom_metric.rb |
chillout-0.8.0 | lib/chillout/custom_metric.rb |