Class: RequestLogAnalyzer::Aggregator::Base
- Inherits:
-
Object
- Object
- RequestLogAnalyzer::Aggregator::Base
- 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
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#source ⇒ Object
readonly
Returns the value of attribute source.
Instance Method Summary collapse
-
#aggregate(request) ⇒ Object
The aggregate function is called for every request.
-
#finalize ⇒ Object
The finalize function is called after all sources are parsed and no more requests will be passed to the aggregator.
-
#initialize(source, options = {}) ⇒ Base
constructor
Intializes a new RequestLogAnalyzer::Aggregator::Base instance It will include the specific file format module.
-
#prepare ⇒ Object
The prepare function is called just before parsing starts.
-
#report(output) ⇒ Object
The report function is called at the end.
-
#source_change(change, filename) ⇒ Object
The source_change function gets called when handling a source is started or finished.
-
#warning(type, message, lineno) ⇒ Object
The warning method is called if the parser eits a warning.
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, = {}) @source = source @options = end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
11 12 13 |
# File 'lib/request_log_analyzer/aggregator.rb', line 11 def @options end |
#source ⇒ Object (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 |
#finalize ⇒ Object
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 |
#prepare ⇒ Object
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, , lineno) end |