Class: Tarbit::Statistic
- Inherits:
-
Object
- Object
- Tarbit::Statistic
- Defined in:
- lib/tarbit/statistic.rb
Instance Method Summary collapse
-
#initialize(server, interval) ⇒ Statistic
constructor
A new instance of Statistic.
- #watch ⇒ Object
Constructor Details
#initialize(server, interval) ⇒ Statistic
Returns a new instance of Statistic.
7 8 9 10 11 |
# File 'lib/tarbit/statistic.rb', line 7 def initialize(server, interval) @server = server @interval = interval @history = [] end |
Instance Method Details
#watch ⇒ Object
13 14 15 16 17 18 19 20 |
# File 'lib/tarbit/statistic.rb', line 13 def watch Async do |task| while true task.sleep @interval write_line_chart end end end |