Sha256: 500a326fceb5a31dcf14c3bb2dc60ca7c30ac85291f234fcddabeb03771da4b3

Contents?: true

Size: 1.51 KB

Versions: 14

Compression:

Stored size: 1.51 KB

Contents

module RequestLogAnalyzer::Aggregator

  autoload :Echo,             'request_log_analyzer/aggregator/echo'
  autoload :Summarizer,       'request_log_analyzer/aggregator/summarizer'
  autoload :DatabaseInserter, 'request_log_analyzer/aggregator/database_inserter'

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

    attr_reader :options, :source

    # Intializes a new RequestLogAnalyzer::Aggregator::Base instance
    # It will include the specific file format module.
    def initialize(source, options = {})
      @source = source
      @options = options
    end

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

    # The aggregate function is called for every request.
    # Implement the aggregating functionality in this method
    def aggregate(request)
    end

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

    # The warning method is called if the parser eits a warning.
    def warning(type, message, lineno)
    end

    # The report function is called at the end. Implement any result reporting
    # in this function.
    def report(output)
    end

    # The source_change function gets called when handling a source is started or finished.
    def source_change(change, filename)
    end

  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
request-log-analyzer-1.10.1 lib/request_log_analyzer/aggregator.rb
request-log-analyzer-1.10.0 lib/request_log_analyzer/aggregator.rb
request-log-analyzer-1.9.10 lib/request_log_analyzer/aggregator.rb
request-log-analyzer-1.9.9 lib/request_log_analyzer/aggregator.rb
request-log-analyzer-1.9.8 lib/request_log_analyzer/aggregator.rb
request-log-analyzer-1.9.7 lib/request_log_analyzer/aggregator.rb
request-log-analyzer-1.9.6 lib/request_log_analyzer/aggregator.rb
request-log-analyzer-1.9.5 lib/request_log_analyzer/aggregator.rb
request-log-analyzer-1.9.4 lib/request_log_analyzer/aggregator.rb
request-log-analyzer-1.9.3 lib/request_log_analyzer/aggregator.rb
request-log-analyzer-1.9.2 lib/request_log_analyzer/aggregator.rb
request-log-analyzer-1.9.1 lib/request_log_analyzer/aggregator.rb
request-log-analyzer-1.9.0 lib/request_log_analyzer/aggregator.rb
request-log-analyzer-1.8.1 lib/request_log_analyzer/aggregator.rb