memeasure 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 87fbd88b395ccb2573a258aef9b53193320c1f77
4
- data.tar.gz: cbacf8093a34cf58c68f24bd0c1264bca7506f88
3
+ metadata.gz: ea66147c669047a9e552ee39175b0ed96247e614
4
+ data.tar.gz: ef9958a51e880ca2df4692ba002d79d3d2e0d807
5
5
  SHA512:
6
- metadata.gz: 6ea16a1c61bb39ca2e69801ac9cb99d543cd15de53fbedbffdf2eccc6141261792b5373d8806eb7e53a9efebde10f917eece1a7d1ac0b3c142ebfa14eaf285b1
7
- data.tar.gz: 38b8524057efd303778a3f40dee1eb192576d4d4bf57bbbfdb9e6acdfd622847b19ce895607752cf7827068537ed2e54873a34fcd8d86814c5a48971330e7f60
6
+ metadata.gz: 8c4193c13e3efcd18318e3bc9de60e80a93d78c4c096fe38837bc71ab12bd4ba9e63a787893122d9b1e238bc30616c74338c345d7400c5be3b73a49669c8a457
7
+ data.tar.gz: f4528199903941bbd3ce5e9bf79a4d86cb939b112f701322ccdcc1ab2d0d4af662c3d1b643d23416bca6ec1d494c86754049433faced0c179377f4d1fa76ebae
data/README.md ADDED
@@ -0,0 +1,42 @@
1
+ ## A Simple Memory Profiler
2
+
3
+ Taken directly from **Ruby Performance Optimization**
4
+
5
+ ### Install Instructions
6
+ 1. include `gem 'memeasure'`
7
+ 2. `bundle install`
8
+
9
+ ### Usage Instructions
10
+
11
+ Say you have the following code:
12
+ ```ruby
13
+
14
+ class Person
15
+ def name
16
+ 1000.times { "x" * 1024 * 1024 * 10 } # A 10 MB string
17
+ end
18
+ end
19
+ ```
20
+
21
+ And you want to see how much memory it takes to run your Person#name method. You'd simply have to
22
+ pass your code as a block to `Measure.run`
23
+
24
+ ```ruby
25
+ require 'memeasure'
26
+
27
+ class Person
28
+
29
+ def name
30
+ Measure.run do
31
+ 1000.times { "x" * 1024 * 1024 * 10 }
32
+ end
33
+ end
34
+ end
35
+
36
+ ```
37
+
38
+ Jumping into a rails/irb console, loading this file, and running `Person.new.name` will generate the output in a similar format to:
39
+
40
+ ```
41
+ {"2.2.0": {"gc": "enable", "time": 2.1, "gc_count": 10, "memory": "525 MB"}}
42
+ ```
@@ -1,4 +1,4 @@
1
- class Measure
1
+ module MeMeasure
2
2
  extend self
3
3
 
4
4
  def run(options = {gc: :enable})
data/lib/memeasure.rb ADDED
@@ -0,0 +1,5 @@
1
+ require 'memeasure/measure'
2
+
3
+ module MeMeasure
4
+ VERSION = '0.0.3'
5
+ end
Binary file
data/memeasure.gemspec ADDED
@@ -0,0 +1,15 @@
1
+ $LOAD_PATH << File.expand_path("../lib", __FILE__)
2
+ require 'memeasure'
3
+
4
+ Gem::Specification.new do |s|
5
+ s.name = 'memeasure'
6
+ s.version = MeMeasure::VERSION
7
+ s.date = '2015-12-30'
8
+ s.summary = "Basic ruby memory profiling tool"
9
+ s.description = "A bare bones memory measurement tool for ruby / rails"
10
+ s.authors = ["Dain Hall"]
11
+ s.email = 'dainovu3@gmail.com'
12
+ s.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
13
+ s.homepage = 'http://rubygems.org/gems/memeasure'
14
+ s.license = 'MIT'
15
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: memeasure
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dain Hall
@@ -16,7 +16,11 @@ executables: []
16
16
  extensions: []
17
17
  extra_rdoc_files: []
18
18
  files:
19
- - lib/measure.rb
19
+ - README.md
20
+ - lib/memeasure.rb
21
+ - lib/memeasure/measure.rb
22
+ - memeasure-0.0.2.gem
23
+ - memeasure.gemspec
20
24
  homepage: http://rubygems.org/gems/memeasure
21
25
  licenses:
22
26
  - MIT