[Groonga-commit] groonga/groonga at 7493345 [master] Show min and max

Back to archive index

Kouhei Sutou null+****@clear*****
Sat Mar 19 14:56:16 JST 2016


Kouhei Sutou	2016-03-19 14:56:16 +0900 (Sat, 19 Mar 2016)

  New Revision: 74933458dc3d9b42284520e0ff54d1580ac536ef
  https://github.com/groonga/groonga/commit/74933458dc3d9b42284520e0ff54d1580ac536ef

  Message:
    Show min and max

  Modified files:
    tools/groonga-memory-usage-analyzer.rb

  Modified: tools/groonga-memory-usage-analyzer.rb (+19 -1)
===================================================================
--- tools/groonga-memory-usage-analyzer.rb    2016-03-19 14:53:55 +0900 (4419891)
+++ tools/groonga-memory-usage-analyzer.rb    2016-03-19 14:56:16 +0900 (d8f982c)
@@ -27,6 +27,14 @@ class LocationGroup
   def average_size
     total_size / @memories.size.to_f
   end
+
+  def max_size
+    @memories.collect(&:size).max
+  end
+
+  def min_size
+    @memories.collect(&:size).min
+  end
 end
 
 class Statistics
@@ -81,10 +89,20 @@ def format_size(size)
   end
 end
 
+puts("%10s(%10s:%10s:%10s): %s(%s)" % [
+       "Total",
+       "Average",
+       "Max",
+       "Min",
+       "Location",
+       "N allocations",
+     ])
 statistics.sort_by_size.reverse[0, 10].each do |group|
-  puts("%10s(%10s): %s(%d)" % [
+  puts("%10s(%10s:%10s:%10s): %s(%d)" % [
          format_size(group.total_size),
          format_size(group.average_size),
+         format_size(group.max_size),
+         format_size(group.min_size),
          group.location,
          group.memories.size,
        ])
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-commit mailing list
Back to archive index