Class: Simulator::TailEff
- Inherits:
-
Object
- Object
- Simulator::TailEff
- Includes:
- Base
- Defined in:
- lib/logpoop/simulator/tail_eff.rb
Instance Attribute Summary collapse
-
#burst_size ⇒ Object
The number of groups of lines that will be logged at a given speed before a new speed is calculated.
-
#logfile ⇒ Object
Returns the value of attribute logfile.
-
#speed ⇒ Object
The maximum speed of the tailer.
Instance Method Summary collapse
- #fake_it ⇒ Object
-
#initialize(out, logfile, speed = nil, burst_size = nil) ⇒ TailEff
constructor
A new instance of TailEff.
Methods included from Base
#clear_screen, included, #simulate, #stop
Constructor Details
#initialize(out, logfile, speed = nil, burst_size = nil) ⇒ TailEff
Returns a new instance of TailEff.
24 25 26 27 28 29 |
# File 'lib/logpoop/simulator/tail_eff.rb', line 24 def initialize(out, logfile, speed=nil, burst_size=nil) self.out = out self.logfile = logfile self.speed = speed self.burst_size = burst_size end |
Instance Attribute Details
#burst_size ⇒ Object
The number of groups of lines that will be logged at a given speed before a new speed is calculated
20 21 22 |
# File 'lib/logpoop/simulator/tail_eff.rb', line 20 def burst_size @burst_size end |
#logfile ⇒ Object
Returns the value of attribute logfile.
9 10 11 |
# File 'lib/logpoop/simulator/tail_eff.rb', line 9 def logfile @logfile end |
#speed ⇒ Object
The maximum speed of the tailer. The speed will be sampled randomly in a range from 1/2 second to 1/speed seconds. higher = faster
14 15 16 |
# File 'lib/logpoop/simulator/tail_eff.rb', line 14 def speed @speed end |
Instance Method Details
#fake_it ⇒ Object
31 32 33 34 35 36 |
# File 'lib/logpoop/simulator/tail_eff.rb', line 31 def fake_it while !@stop do print_lines end clear_screen(self.out) end |