Class: RequestLogAnalyzer::Aggregator::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/request_log_analyzer/aggregator.rb

Overview

The base class of an aggregator. This class provides the interface to which every aggregator should comply (by simply subclassing this class).

Direct Known Subclasses

DatabaseInserter, Echo, Summarizer

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(source, options = {}) ⇒ Base

Intializes a new RequestLogAnalyzer::Aggregator::Base instance It will include the specific file format module.



9
10
11
12
# File 'lib/request_log_analyzer/aggregator.rb', line 9

def initialize(source, options = {})
  @source = source
  @options = options
end

Instance Attribute Details

#optionsObject (readonly)

Returns the value of attribute options.



5
6
7
# File 'lib/request_log_analyzer/aggregator.rb', line 5

def options
  @options
end

#sourceObject (readonly)

Returns the value of attribute source.



5
6
7
# File 'lib/request_log_analyzer/aggregator.rb', line 5

def source
  @source
end

Instance Method Details

#aggregate(_request) ⇒ Object

The aggregate function is called for every request. Implement the aggregating functionality in this method



21
22
# File 'lib/request_log_analyzer/aggregator.rb', line 21

def aggregate(_request)
end

#finalizeObject

The finalize function is called after all sources are parsed and no more requests will be passed to the aggregator



26
27
# File 'lib/request_log_analyzer/aggregator.rb', line 26

def finalize
end

#prepareObject

The prepare function is called just before parsing starts. This function can be used to initialie variables, etc.



16
17
# File 'lib/request_log_analyzer/aggregator.rb', line 16

def prepare
end

#report(_output) ⇒ Object

The report function is called at the end. Implement any result reporting in this function.



35
36
# File 'lib/request_log_analyzer/aggregator.rb', line 35

def report(_output)
end

#source_change(_change, _filename) ⇒ Object

The source_change function gets called when handling a source is started or finished.



39
40
# File 'lib/request_log_analyzer/aggregator.rb', line 39

def source_change(_change, _filename)
end

#warning(_type, _message, _lineno) ⇒ Object

The warning method is called if the parser eits a warning.



30
31
# File 'lib/request_log_analyzer/aggregator.rb', line 30

def warning(_type, _message, _lineno)
end