Class: SelectRailsLog::Printer::StatisticsPrinter

Inherits:
BasePrinter show all
Defined in:
lib/select_rails_log/printer/statistics_printer.rb

Constant Summary collapse

STAT_TOTAL_DURATION =
"Total"
DEFAULT_TARGETS =
[
  STAT_TOTAL_DURATION,
  PERFORMANCE_ACTIVE_RECORD,
  PERFORMANCE_VIEWS,
  PERFORMANCE_ALLOCATIONS
].freeze
PERCENTILES =
[25, 50, 75, 90, 95, 99].freeze

Constants included from Constants

Constants::ACTION, Constants::CLIENT, Constants::COMPLETED, Constants::CONTROLLER, Constants::DEBUG, Constants::DEFAULT_OUTPUT, Constants::DURATION, Constants::HTTP_METHOD, Constants::HTTP_STATUS, Constants::ID, Constants::INTERVAL, Constants::LOGS, Constants::MESSAGE, Constants::PARAMETERS, Constants::PATH, Constants::PERFORMANCE, Constants::PERFORMANCE_ACTIVE_RECORD, Constants::PERFORMANCE_ALLOCATIONS, Constants::PERFORMANCE_VIEWS, Constants::PID, Constants::RAW_LOGS, Constants::REQUEST_ID, Constants::SEVERITY, Constants::STARTED, Constants::TIME

Instance Attribute Summary

Attributes inherited from Extension

#options

Instance Method Summary collapse

Methods inherited from BasePrinter

#output_directory?, #output_stdout?, #print, #runnable?

Methods inherited from Extension

option_initializers, #runnable?

Constructor Details

#initializeStatisticsPrinter

Returns a new instance of StatisticsPrinter.



27
28
29
30
31
32
# File 'lib/select_rails_log/printer/statistics_printer.rb', line 27

def initialize(*)
  super

  @stats_data = {}
  @stats_targets = options[:stats_targets] || DEFAULT_TARGETS
end

Instance Method Details

#closeObject



34
35
36
37
# File 'lib/select_rails_log/printer/statistics_printer.rb', line 34

def close
  print_statistics
  super
end