Kouhei Sutou
null+****@clear*****
Mon Nov 20 15:27:05 JST 2017
Kouhei Sutou 2017-11-20 15:27:05 +0900 (Mon, 20 Nov 2017) New Revision: 270a2795c904cbe9acefc1f506c21d32dbc1fdea https://github.com/groonga/groonga-query-log/commit/270a2795c904cbe9acefc1f506c21d32dbc1fdea Message: analyzer html: support N records Modified files: lib/groonga/query-log/analyzer/reporter/html.rb Modified: lib/groonga/query-log/analyzer/reporter/html.rb (+27 -13) =================================================================== --- lib/groonga/query-log/analyzer/reporter/html.rb 2017-11-20 15:26:36 +0900 (9dcdf52) +++ lib/groonga/query-log/analyzer/reporter/html.rb 2017-11-20 15:27:05 +0900 (1c91f88) @@ -1,6 +1,4 @@ -# -*- coding: utf-8 -*- -# -# Copyright (C) 2011-2012 Kouhei Sutou <kou �� clear-code.com> +# Copyright (C) 2011-2017 Kouhei Sutou <kou �� clear-code.com> # Copyright (C) 2012 Haruka Yoshihara <yoshihara �� clear-code.com> # # This library is free software; you can redistribute it and/or @@ -81,16 +79,31 @@ module Groonga </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> + <table> + <thead> + <tr> + <th>Nth</th> + <th>Elapsed(sec)</th> + <th>Name</th> + <th>N records</th> + <th>Context</th> + </tr> + </thead> + <tbody> +<% statistic.each_operation.with_index do |operation, i| %> + <tr> + <td class="n"><%= h(i + 1) %></td> + <td class="elapsed"> + <%= format_elapsed(operation[:relative_elapsed_in_seconds], + :slow? => operation[:slow?]) %> + </td> + <td class="name"><%= h(operation[:name]) %></td> + <td class="n-records"><%= h(operation[:n_records]) %></td> + <td class="context"><%= h(operation[:context]) %></td> + </tr> <% end %> - </ol> + </tbody> + </table> </div> EOH write(statistic_html) @@ -145,7 +158,8 @@ div.statistics td.elapsed, td.ratio, -td.n +td.n, +td.n-records { text-align: right; } -------------- next part -------------- HTML����������������������������... URL: https://lists.osdn.me/mailman/archives/groonga-commit/attachments/20171120/0452efc5/attachment-0001.htm