[Groonga-commit] groonga/groonga [master] [query-log][analyzer] remove a needless variable.

Back to archive index

null+****@clear***** null+****@clear*****
2011年 6月 3日 (金) 14:09:12 JST


Kouhei Sutou	2011-06-03 05:09:12 +0000 (Fri, 03 Jun 2011)

  New Revision: 5a454fe54b8da551311dbbcf72ce89df4e430ad8

  Log:
    [query-log][analyzer] remove a needless variable.

  Modified files:
    tools/groonga-query-log-analyzer.rb

  Modified: tools/groonga-query-log-analyzer.rb (+2 -4)
===================================================================
--- tools/groonga-query-log-analyzer.rb    2011-06-03 05:01:37 +0000 (f1b7d63)
+++ tools/groonga-query-log-analyzer.rb    2011-06-03 05:09:12 +0000 (b49c754)
@@ -407,16 +407,14 @@ class GroongaQueryLogAnaylzer
     include Enumerable
 
     attr_reader :output
-    attr_accessor :n_entries, :slow_threshold
+    attr_accessor :slow_threshold
     def initialize(statistics)
       @statistics = statistics
-      @n_entries = 10
       @slow_threshold = 0.05
       @output = $stdout
     end
 
     def apply_options(options)
-      self.n_entries = options[:n_entries] || @n_entries
       self.slow_threshold = options[:slow_threshold] || @slow_threshold
       self.output = options[:output] || @output
     end
@@ -561,7 +559,7 @@ class GroongaQueryLogAnaylzer
     def report
       setup_output do |output|
         setup_color(output) do
-          digit = Math.log10(n_entries).truncate + 1
+          digit = Math.log10(@statistics.size).truncate + 1
           each_with_index do |statistic, i|
             output.puts "%*d) %s" % [digit, i + 1, format_heading(statistic)]
             report_parameters(output, statistic)




Groonga-commit メーリングリストの案内
Back to archive index