Method: RequestLogAnalyzer::Tracker::HourlySpread#update

Defined in:
lib/request_log_analyzer/tracker/hourly_spread.rb

#update(request) ⇒ Object

Check if the timestamp in the request and store it. request The request.



44
45
46
47
48
49
# File 'lib/request_log_analyzer/tracker/hourly_spread.rb', line 44

def update(request)
  timestamp = request.first(options[:field])
  @hour_frequencies[timestamp.to_s[8..9].to_i] +=1
  @first = timestamp if timestamp < @first
  @last  = timestamp if timestamp > @last
end