class RequestLogAnalyzer::Aggregator::Base
The base class of an aggregator. This class provides the interface to which every aggregator should comply (by simply subclassing this class).
Attributes
Public Class Methods
Intializes a new RequestLogAnalyzer::Aggregator::Base
instance It will include the specific file format module.
# File lib/request_log_analyzer/aggregator.rb 9 def initialize(source, options = {}) 10 @source = source 11 @options = options 12 end
Public Instance Methods
The aggregate function is called for every request. Implement the aggregating functionality in this method
# File lib/request_log_analyzer/aggregator.rb 21 def aggregate(_request) 22 end
The finalize function is called after all sources are parsed and no more requests will be passed to the aggregator
# File lib/request_log_analyzer/aggregator.rb 26 def finalize 27 end
The prepare function is called just before parsing starts. This function can be used to initialie variables, etc.
# File lib/request_log_analyzer/aggregator.rb 16 def prepare 17 end
The report function is called at the end. Implement any result reporting in this function.
# File lib/request_log_analyzer/aggregator.rb 35 def report(_output) 36 end
The source_change
function gets called when handling a source is started or finished.
# File lib/request_log_analyzer/aggregator.rb 39 def source_change(_change, _filename) 40 end
The warning method is called if the parser eits a warning.
# File lib/request_log_analyzer/aggregator.rb 30 def warning(_type, _message, _lineno) 31 end