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.
9 10 11 12 |
# File 'lib/request_log_analyzer/aggregator.rb', line 9 def initialize(source, = {}) @source = source = end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
5 6 7 |
# File 'lib/request_log_analyzer/aggregator.rb', line 5 def end |
#source ⇒ Object (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 |
#finalize ⇒ Object
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 |
#prepare ⇒ Object
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, , _lineno) end |