class TimeProgressMeter

Public Class Methods

new() click to toggle source
Calls superclass method ProgressMeter::new
# File lib/progress.rb, line 29
def initialize
    # 'period' is how many entries we wait between printing output.  So if 'period' is 10 000,
    # we'll print output every 10 000 lines.
    @_period = 10000
    super
end

Public Instance Methods

output_progress(entry) click to toggle source

Outputs the number of entries that have been parsed so far (every once in a while).

‘entry’ should be the latest log entry to be parsed, in hash form.

# File lib/progress.rb, line 39
def output_progress(entry)
    @_entry_count += 1
    if @_entry_count % @_period == 0
        puts "Processed through %s" % [entry.fetch(:time)]
    end
end