Class: VCAP::ThreadSafeRollingMetric

Inherits:
RollingMetric show all
Defined in:
lib/vcap/rolling_metric.rb

Instance Method Summary collapse

Methods inherited from RollingMetric

#to_json

Constructor Details

#initialize(*args) ⇒ ThreadSafeRollingMetric

Returns a new instance of ThreadSafeRollingMetric.



59
60
61
62
# File 'lib/vcap/rolling_metric.rb', line 59

def initialize(*args)
  super(*args)
  @lock = Monitor.new
end

Instance Method Details

#<<(*args) ⇒ Object



64
65
66
# File 'lib/vcap/rolling_metric.rb', line 64

def <<(*args)
  @lock.synchronize { super(*args) }
end

#value(*args) ⇒ Object



68
69
70
# File 'lib/vcap/rolling_metric.rb', line 68

def value(*args)
  @lock.synchronize { super(*args) }
end