Class: GroongaQueryLog::Command::Analyzer::Reporter
- Inherits:
-
Object
- Object
- GroongaQueryLog::Command::Analyzer::Reporter
- Includes:
- Enumerable
- Defined in:
- lib/groonga-query-log/command/analyzer/reporter.rb
Direct Known Subclasses
CSVReporter, ConsoleReporter, HTMLReporter, JSONReporter, JSONStreamReporter
Instance Attribute Summary collapse
-
#output ⇒ Object
Returns the value of attribute output.
-
#slow_operation_threshold ⇒ Object
Returns the value of attribute slow_operation_threshold.
-
#slow_response_threshold ⇒ Object
Returns the value of attribute slow_response_threshold.
Instance Method Summary collapse
- #each ⇒ Object
-
#initialize(statistics, options = {}) ⇒ Reporter
constructor
A new instance of Reporter.
- #report ⇒ Object
- #report_statistics ⇒ Object
Constructor Details
#initialize(statistics, options = {}) ⇒ Reporter
Returns a new instance of Reporter.
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/groonga-query-log/command/analyzer/reporter.rb', line 28 def initialize(statistics, ={}) @statistics = statistics @options = self.output = @options[:output] || $stdout @report_summary = @options[:report_summary] @report_summary = true if @report_summary.nil? @report_command_line = @options[:report_command_line] @report_command_line = true if @report_command_line.nil? @slow_operation_threshold = @options[:slow_operation_threshold] || Statistic::DEFAULT_SLOW_OPERATION_THRESHOLD @slow_response_threshold = @options[:slow_response_threshold] || Statistic::DEFAULT_SLOW_RESPONSE_THRESHOLD end |
Instance Attribute Details
#output ⇒ Object
Returns the value of attribute output.
26 27 28 |
# File 'lib/groonga-query-log/command/analyzer/reporter.rb', line 26 def output @output end |
#slow_operation_threshold ⇒ Object
Returns the value of attribute slow_operation_threshold.
27 28 29 |
# File 'lib/groonga-query-log/command/analyzer/reporter.rb', line 27 def slow_operation_threshold @slow_operation_threshold end |
#slow_response_threshold ⇒ Object
Returns the value of attribute slow_response_threshold.
27 28 29 |
# File 'lib/groonga-query-log/command/analyzer/reporter.rb', line 27 def slow_response_threshold @slow_response_threshold end |
Instance Method Details
#each ⇒ Object
49 50 51 52 53 |
# File 'lib/groonga-query-log/command/analyzer/reporter.rb', line 49 def each @statistics.each do |statistic| yield statistic end end |
#report ⇒ Object
55 56 57 58 59 60 |
# File 'lib/groonga-query-log/command/analyzer/reporter.rb', line 55 def report setup do report_summary if @report_summary report_statistics end end |
#report_statistics ⇒ Object
62 63 64 65 66 |
# File 'lib/groonga-query-log/command/analyzer/reporter.rb', line 62 def report_statistics each do |statistic| report_statistic(statistic) end end |