Class: Groonga::QueryLog::Analyzer::HTMLReporter
- Inherits:
-
Reporter
- Object
- Reporter
- Groonga::QueryLog::Analyzer::HTMLReporter
show all
- Includes:
- ERB::Util
- Defined in:
- lib/groonga/query-log/analyzer/reporter/html.rb
Instance Attribute Summary
Attributes inherited from Reporter
#output
Instance Method Summary
collapse
Methods inherited from Reporter
#apply_options, #each, #initialize, #report
Instance Method Details
#finish ⇒ Object
33
34
35
|
# File 'lib/groonga/query-log/analyzer/reporter/html.rb', line 33
def finish
write()
end
|
#report_statistic(statistic) ⇒ Object
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
|
# File 'lib/groonga/query-log/analyzer/reporter/html.rb', line 55
def report_statistic(statistic)
command = statistic.command
statistic_html = erb(<<-EOH, __LINE__ + 1, binding)
<div class="statistic-heading">
<h3>Command</h3>
<div class="metrics">
[<%= format_time(statistic.start_time) %>
-
<%= format_time(statistic.last_time) %>
(<%= format_elapsed(statistic.elapsed_in_seconds,
:slow? => statistic.slow?) %>)]
(<%= span({:class => "return-code"}, h(statistic.return_code)) %>)
</div>
<%= div({:class => "raw-command"}, h(statistic.raw_command)) %>
</div>
<div class="statistic-parameters">
<h3>Parameters</h3>
<dl>
<dt>name</dt>
<dd><%= h(command.name) %></dd>
<% command.arguments.each do |key, value| %>
<dt><%= h(key) %></dt>
<dd><%= h(value) %></dd>
<% end %>
</dl>
</div>
<div class="statistic-operations">
<h3>Operations</h3>
<ol>
<% statistic.each_operation do |operation| %>
<li>
<%= format_elapsed(operation[:relative_elapsed_in_seconds],
:slow? => operation[:slow?]) %>:
<%= span({:class => "name"}, h(operation[:name])) %>:
<%= span({:class => "context"}, h(operation[:context])) %>
</li>
<% end %>
</ol>
</div>
EOH
write(statistic_html)
end
|
#report_statistics ⇒ Object
49
50
51
52
53
|
# File 'lib/groonga/query-log/analyzer/reporter/html.rb', line 49
def report_statistics
write()
super
write()
end
|
#report_summary ⇒ Object
37
38
39
40
41
42
43
44
45
46
47
|
# File 'lib/groonga/query-log/analyzer/reporter/html.rb', line 37
def report_summary
summary_html = erb(<<-EOH, __LINE__ + 1, binding)
<h2>Summary</h2>
<div class="summary">
<%= analyze_parameters %>
<%= metrics %>
<%= slow_operations %>
</div>
EOH
write(summary_html)
end
|
#start ⇒ Object
29
30
31
|
# File 'lib/groonga/query-log/analyzer/reporter/html.rb', line 29
def start
write()
end
|