Class: Tarbit::StatisticWatcher
- Inherits:
-
Object
- Object
- Tarbit::StatisticWatcher
- Defined in:
- lib/tarbit/statistic_watcher.rb
Instance Method Summary collapse
-
#initialize(server, interval) ⇒ StatisticWatcher
constructor
A new instance of StatisticWatcher.
- #watch ⇒ Object
Constructor Details
#initialize(server, interval) ⇒ StatisticWatcher
Returns a new instance of StatisticWatcher.
8 9 10 11 12 13 |
# File 'lib/tarbit/statistic_watcher.rb', line 8 def initialize(server, interval) @server = server @interval = interval.nil? ? 600 : interval.to_i @history = [] Async.logger.info "SatisticWatcher - Starting watcher with interval #{@interval}" end |
Instance Method Details
#watch ⇒ Object
15 16 17 18 19 20 21 22 |
# File 'lib/tarbit/statistic_watcher.rb', line 15 def watch Async do |task| while true task.sleep @interval create_point_in_time end end end |