Module: Varnish::Utils::Timer

Defined in:
lib/varnish/utils/timer.rb

Instance Method Summary collapse

Instance Method Details

#timer_countObject



10
11
12
13
14
15
16
17
# File 'lib/varnish/utils/timer.rb', line 10

def timer_count
  @time = Time.now if @count == 0
  @count += 1
  if (@count % @interval) == 0
    puts "Got #{@count} calls in #{(Time.now - @time).to_f}s"
    @time = Time.now
  end
end

#timer_initObject



4
5
6
7
8
# File 'lib/varnish/utils/timer.rb', line 4

def timer_init
  @count = 0
  @time = 0
  @interval = 40000
end