Class: RequestLogAnalyzer::FileFormat::Rails::Request

Inherits:
Request
  • Object
show all
Defined in:
lib/request_log_analyzer/file_format/rails.rb

Overview

Define a custom Request class for the Rails file format to speed up timestamp handling and to ensure that a format is always set.

Instance Attribute Summary

Attributes inherited from Request

#attributes, #file_format, #lines

Instance Method Summary collapse

Methods inherited from Request

#<<, #add_line_hash, #add_parsed_line, #completed?, create, #empty?, #every, #first, #first_lineno, #has_line_type?, #initialize, #last_lineno, #timestamp, #validate

Methods included from Request::Converters

#convert_decimal, #convert_duration, #convert_eval, #convert_float, #convert_int, #convert_integer, #convert_string, #convert_sym, #convert_symbol, #convert_traffic, #convert_value

Constructor Details

This class inherits a constructor from RequestLogAnalyzer::Request

Instance Method Details

#convert_timestamp(value, definition) ⇒ Object

Do not use DateTime.parse



93
94
95
# File 'lib/request_log_analyzer/file_format/rails.rb', line 93

def convert_timestamp(value, definition)
  value.gsub(/[^0-9]/, '')[0...14].to_i
end