Class: Tarbit::StatisticWatcher

Inherits:
Object
  • Object
show all
Defined in:
lib/tarbit/statistic_watcher.rb

Instance Method Summary collapse

Constructor Details

#initialize(server, interval = 600) ⇒ StatisticWatcher

Returns a new instance of StatisticWatcher.



8
9
10
11
12
# File 'lib/tarbit/statistic_watcher.rb', line 8

def initialize(server, interval = 600)
  @server = server
  @interval = interval.to_i
  @history = []
end

Instance Method Details

#watchObject



14
15
16
17
18
19
20
21
# File 'lib/tarbit/statistic_watcher.rb', line 14

def watch
  Async do |task|
    while true
      task.sleep @interval
      create_point_in_time
    end
  end
end