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.



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

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

Instance Attribute Details

#optionsObject (readonly)

Returns the value of attribute options.



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

def options
  @options
end

#sourceObject (readonly)

Returns the value of attribute source.



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

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



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

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



32
33
# File 'lib/request_log_analyzer/aggregator.rb', line 32

def finalize
end

#prepareObject

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



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

def prepare
end

#report(output) ⇒ Object

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



41
42
# File 'lib/request_log_analyzer/aggregator.rb', line 41

def report(output)
end

#source_change(change, filename) ⇒ Object

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



45
46
# File 'lib/request_log_analyzer/aggregator.rb', line 45

def source_change(change, filename)
end

#warning(type, message, lineno) ⇒ Object

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



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

def warning(type, message, lineno)
end