[Groonga-commit] groonga/groonga at e01ed17 [master] Show average size

Back to archive index

Kouhei Sutou null+****@clear*****
Sat Mar 19 14:53:55 JST 2016


Kouhei Sutou	2016-03-19 14:53:55 +0900 (Sat, 19 Mar 2016)

  New Revision: e01ed17ba36c7c1dcaf6bb87be671a947458626f
  https://github.com/groonga/groonga/commit/e01ed17ba36c7c1dcaf6bb87be671a947458626f

  Message:
    Show average size

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

  Modified: tools/groonga-memory-usage-analyzer.rb (+6 -1)
===================================================================
--- tools/groonga-memory-usage-analyzer.rb    2016-03-19 14:50:42 +0900 (5c23264)
+++ tools/groonga-memory-usage-analyzer.rb    2016-03-19 14:53:55 +0900 (4419891)
@@ -23,6 +23,10 @@ class LocationGroup
       sum + memory.size
     end
   end
+
+  def average_size
+    total_size / @memories.size.to_f
+  end
 end
 
 class Statistics
@@ -78,8 +82,9 @@ def format_size(size)
 end
 
 statistics.sort_by_size.reverse[0, 10].each do |group|
-  puts("%10s: %s(%d)" % [
+  puts("%10s(%10s): %s(%d)" % [
          format_size(group.total_size),
+         format_size(group.average_size),
          group.location,
          group.memories.size,
        ])
-------------- next part --------------
HTML����������������������������...
Download 



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