process_memory 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile ADDED
@@ -0,0 +1,3 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gemspec
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2012 Dimko
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,9 @@
1
+ ProcessMemory
2
+ -------------
3
+
4
+ This gem extends `Process` module with `memory` method, which returns memory usage in kilobytes, without swap.
5
+
6
+ ```ruby
7
+ Process.memory
8
+ # => 112884
9
+ ```
@@ -0,0 +1 @@
1
+ require 'bundler/gem_tasks'
data/init.rb ADDED
@@ -0,0 +1 @@
1
+ require 'process_memory'
@@ -0,0 +1,8 @@
1
+ module Process
2
+ ##
3
+ # Returns process memory usage without swap in kilobytes
4
+ #
5
+ def self.memory
6
+ `ps -o rss= -p #{pid}`.to_i
7
+ end
8
+ end
@@ -0,0 +1,16 @@
1
+ # encoding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+
5
+ Gem::Specification.new do |gem|
6
+ gem.name = 'process_memory'
7
+ gem.version = '0.0.1'
8
+ gem.authors = ['Dimko']
9
+ gem.email = ['deemox@gmail.com']
10
+ gem.description = "Adds memory usage info to standart ruby's process module"
11
+ gem.summary = "Helps you to track down memory leaks"
12
+ gem.homepage = 'https://github.com/dimko/process_memory'
13
+
14
+ gem.files = ['Gemfile', 'init.rb', 'lib/process_memory.rb', 'LICENSE.txt', 'process_memory.gemspec', 'Rakefile', 'README.md']
15
+ gem.require_paths = ['lib']
16
+ end
metadata ADDED
@@ -0,0 +1,52 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: process_memory
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Dimko
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2012-09-26 00:00:00.000000000 Z
13
+ dependencies: []
14
+ description: Adds memory usage info to standart ruby's process module
15
+ email:
16
+ - deemox@gmail.com
17
+ executables: []
18
+ extensions: []
19
+ extra_rdoc_files: []
20
+ files:
21
+ - Gemfile
22
+ - init.rb
23
+ - lib/process_memory.rb
24
+ - LICENSE.txt
25
+ - process_memory.gemspec
26
+ - Rakefile
27
+ - README.md
28
+ homepage: https://github.com/dimko/process_memory
29
+ licenses: []
30
+ post_install_message:
31
+ rdoc_options: []
32
+ require_paths:
33
+ - lib
34
+ required_ruby_version: !ruby/object:Gem::Requirement
35
+ none: false
36
+ requirements:
37
+ - - ! '>='
38
+ - !ruby/object:Gem::Version
39
+ version: '0'
40
+ required_rubygems_version: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ! '>='
44
+ - !ruby/object:Gem::Version
45
+ version: '0'
46
+ requirements: []
47
+ rubyforge_project:
48
+ rubygems_version: 1.8.24
49
+ signing_key:
50
+ specification_version: 3
51
+ summary: Helps you to track down memory leaks
52
+ test_files: []