Sha256: b236a87b2497a4fc8a6a312a8040b4a4911497d25d0461db8c5b5323f08ea108

Contents?: true

Size: 387 Bytes

Versions: 16

Compression:

Stored size: 387 Bytes

Contents

class ProconBypassMan::Procon::PerformanceMeasurement::LastBypassAt
  include Singleton

  attr_accessor :mutex, :last_bypass_at

  def initialize
    self.mutex = Mutex.new
    self.last_bypass_at = Time.now
  end

  def self.touch(&block)
    instance.mutex.synchronize do
      block.call(Time.now - instance.last_bypass_at)
      instance.last_bypass_at = Time.now
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
procon_bypass_man-0.3.12 lib/procon_bypass_man/procon/performance_measurement/last_bypass_at.rb
procon_bypass_man-0.3.11 lib/procon_bypass_man/procon/performance_measurement/last_bypass_at.rb
procon_bypass_man-0.3.10 lib/procon_bypass_man/procon/performance_measurement/last_bypass_at.rb
procon_bypass_man-0.3.9 lib/procon_bypass_man/procon/performance_measurement/last_bypass_at.rb
procon_bypass_man-0.3.8.1 lib/procon_bypass_man/procon/performance_measurement/last_bypass_at.rb
procon_bypass_man-0.3.8 lib/procon_bypass_man/procon/performance_measurement/last_bypass_at.rb
procon_bypass_man-0.3.7 lib/procon_bypass_man/procon/performance_measurement/last_bypass_at.rb
procon_bypass_man-0.3.6 lib/procon_bypass_man/procon/performance_measurement/last_bypass_at.rb
procon_bypass_man-0.3.5 lib/procon_bypass_man/procon/performance_measurement/last_bypass_at.rb
procon_bypass_man-0.3.4 lib/procon_bypass_man/procon/performance_measurement/last_bypass_at.rb
procon_bypass_man-0.3.3.1 lib/procon_bypass_man/procon/performance_measurement/last_bypass_at.rb
procon_bypass_man-0.3.3 lib/procon_bypass_man/procon/performance_measurement/last_bypass_at.rb
procon_bypass_man-0.3.2 lib/procon_bypass_man/procon/performance_measurement/last_bypass_at.rb
procon_bypass_man-0.3.1 lib/procon_bypass_man/procon/performance_measurement/last_bypass_at.rb
procon_bypass_man-0.3.0 lib/procon_bypass_man/procon/performance_measurement/last_bypass_at.rb
procon_bypass_man-0.2.3 lib/procon_bypass_man/procon/performance_measurement/last_bypass_at.rb