Skip to content

Commit

Permalink
Adjust last bytes
Browse files Browse the repository at this point in the history
  • Loading branch information
itsderek23 committed Mar 26, 2010
1 parent 07efbee commit 021dc3e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion log_watcher/log_watcher.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def build_report
# finds new content from +last_bytes+ to the end of the file, then just extracts from the recorded
# +read_length+. This ignores new lines that are added after finding the +current_length+. Those lines
# will be read on the next run.
count = `tail -c +#{last_bytes} #{@log_file_path} | head -c #{read_length} | grep "#{@term}" -#{option(:grep_options).to_s.gsub('-','')}c`.strip.to_f
count = `tail -c +#{last_bytes+1} #{@log_file_path} | head -c #{read_length} | grep "#{@term}" -#{option(:grep_options).to_s.gsub('-','')}c`.strip.to_f
# convert to a rate / min
count = count / ((Time.now - @last_run)/60)
else
Expand Down

0 comments on commit 021dc3e

Please sign in to comment.