memory_profiler 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/memory_profiler/results.rb +11 -11
- data/lib/memory_profiler/top_n.rb +3 -1
- data/lib/memory_profiler/version.rb +1 -1
- data/test/test_results.rb +2 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 137993daf571e91e9226e91bfac2f5fc8de00e24
|
4
|
+
data.tar.gz: dd960b34c925167e99d3f99f9e16729210fbd511
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fe442012610dc38045c586f7a732bfdde5b60471a98196a836d3cd9730f48b5d52ef6f4b6bb493aa4f98de2e64f8773b61093e85355b4d90ae37915dd0c4d8a5
|
7
|
+
data.tar.gz: 778ff7260499849b6580e6c8a0c4864507af34d7417ad3bcf7c09b9b071ddf2ab45156e6a6c1caf74b61d40d7fd3b81d63013030a53236c9dc7c95d4ede8b7c9
|
@@ -60,29 +60,29 @@ module MemoryProfiler
|
|
60
60
|
self
|
61
61
|
end
|
62
62
|
|
63
|
-
def pretty_print
|
64
|
-
puts "Total allocated #{total_allocated}"
|
65
|
-
puts "Total retained #{total_retained}"
|
66
|
-
puts
|
63
|
+
def pretty_print(io = STDOUT)
|
64
|
+
io.puts "Total allocated #{total_allocated}"
|
65
|
+
io.puts "Total retained #{total_retained}"
|
66
|
+
io.puts
|
67
67
|
["allocated","retained"]
|
68
68
|
.product(["memory", "objects"])
|
69
69
|
.product(["gem", "file", "location"])
|
70
70
|
.each do |(type, metric), name|
|
71
|
-
dump "#{type} #{metric} by #{name}", self.send("#{type}_#{metric}_by_#{name}")
|
71
|
+
dump "#{type} #{metric} by #{name}", self.send("#{type}_#{metric}_by_#{name}"), io
|
72
72
|
end
|
73
73
|
end
|
74
74
|
|
75
|
-
def dump(description, data)
|
76
|
-
puts description
|
77
|
-
puts "-----------------------------------"
|
75
|
+
def dump(description, data, io)
|
76
|
+
io.puts description
|
77
|
+
io.puts "-----------------------------------"
|
78
78
|
if data
|
79
79
|
data.each do |item|
|
80
|
-
puts "#{item[:data]} x #{item[:count]}"
|
80
|
+
io.puts "#{item[:data]} x #{item[:count]}"
|
81
81
|
end
|
82
82
|
else
|
83
|
-
puts "NO DATA"
|
83
|
+
io.puts "NO DATA"
|
84
84
|
end
|
85
|
-
puts
|
85
|
+
io.puts
|
86
86
|
end
|
87
87
|
end
|
88
88
|
end
|
data/test/test_results.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: memory_profiler
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sam Saffron
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-09-
|
11
|
+
date: 2013-09-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -128,7 +128,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
128
128
|
version: '0'
|
129
129
|
requirements: []
|
130
130
|
rubyforge_project:
|
131
|
-
rubygems_version: 2.
|
131
|
+
rubygems_version: 2.0.7
|
132
132
|
signing_key:
|
133
133
|
specification_version: 4
|
134
134
|
summary: Memory profiling routines for Ruby Head
|