Class: Groonga::QueryLog::Analyzer::Reporter
- Inherits:
-
Object
- Object
- Groonga::QueryLog::Analyzer::Reporter
show all
- Includes:
- Enumerable
- Defined in:
- lib/groonga/query-log/analyzer/reporter.rb
Instance Attribute Summary collapse
Instance Method Summary
collapse
Constructor Details
#initialize(statistics) ⇒ Reporter
Returns a new instance of Reporter.
27
28
29
30
31
|
# File 'lib/groonga/query-log/analyzer/reporter.rb', line 27
def initialize(statistics)
@statistics = statistics
@report_summary = true
@output = $stdout
end
|
Instance Attribute Details
#output ⇒ Object
Returns the value of attribute output.
26
27
28
|
# File 'lib/groonga/query-log/analyzer/reporter.rb', line 26
def output
@output
end
|
Instance Method Details
#apply_options(options) ⇒ Object
33
34
35
36
37
38
|
# File 'lib/groonga/query-log/analyzer/reporter.rb', line 33
def apply_options(options)
self.output = options[:output] || @output
unless options[:report_summary].nil?
@report_summary = options[:report_summary]
end
end
|
#each ⇒ Object
45
46
47
48
49
|
# File 'lib/groonga/query-log/analyzer/reporter.rb', line 45
def each
@statistics.each do |statistic|
yield statistic
end
end
|
#report ⇒ Object
51
52
53
54
55
56
|
# File 'lib/groonga/query-log/analyzer/reporter.rb', line 51
def report
setup do
report_summary if @report_summary
report_statistics
end
end
|
#report_statistics ⇒ Object
58
59
60
61
62
|
# File 'lib/groonga/query-log/analyzer/reporter.rb', line 58
def report_statistics
each do |statistic|
report_statistic(statistic)
end
end
|