Class: Simulator::TailEff

Inherits:
Object
  • Object
show all
Includes:
Base
Defined in:
lib/logpoop/simulator/tail_eff.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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_sizeObject

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

#logfileObject

Returns the value of attribute logfile.



9
10
11
# File 'lib/logpoop/simulator/tail_eff.rb', line 9

def logfile
  @logfile
end

#speedObject

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_itObject



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