get_process_mem 0.2.5 → 0.2.6

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
  SHA256:
3
- metadata.gz: 1d0fb74ff83b646fc0abdbbad624257304311fa98ea5204cce96d12957572432
4
- data.tar.gz: 8a51db8a8638d7d160b6a34d924244d4a28056168f3aea4341abf9d6fe890576
3
+ metadata.gz: 9bb77afa418ea02d1e7d7416d88fc9706de5c581c84aa22d3199c405e406404e
4
+ data.tar.gz: 1ee05474ce71701a823828452ee0d657422f790aafc8a0cdd7b2259843af4f0f
5
5
  SHA512:
6
- metadata.gz: e3291519f57f2b44c5d8794098c5b87331bb49599f43ea1d06bc269560759e0e9ef0bb2318a4f1d261a4709634024cd00d0bb73bca559ff23440fb194cb25964
7
- data.tar.gz: 4c16b205f3a20b0f1a7a2110bb3ee370918107f2a4e509a044f9ab0dc01cf8285a3042c5cc656c65a6bd50d6e5f5d68c5bd2e980915d42632bf0fbed3faccfa3
6
+ metadata.gz: d70576115a29294f6e0bf456f5992b9f1aa208d1c0855ccf15492c93824ac602c8911bca6b819723d4f2a1faeb25828afe453ff5c1f3bb3715e632eae7b339e7
7
+ data.tar.gz: cd0c1482f61ef34933cbe87afcbf281debd359b6f37e476dc765196b791c61fa768aab5f9a5f0eb98df0026ac174d3036633bce4135e5e7c650ff40f23d259a3
@@ -1,5 +1,9 @@
1
1
  ## Master - unreleased
2
2
 
3
+ ## 0.2.6
4
+
5
+ - Support returning memory from different PIDs on mac (https://github.com/schneems/get_process_mem/pull/41)
6
+
3
7
  ## 0.2.5
4
8
 
5
9
  - Use new sys-proctable interface (https://github.com/schneems/get_process_mem/pull/36)
@@ -58,7 +58,7 @@ class GetProcessMem
58
58
 
59
59
  def bytes
60
60
  memory = linux_status_memory if linux?
61
- memory ||= darwin_memory if RUNS_ON_DARWIN
61
+ memory ||= darwin_memory if RUNS_ON_DARWIN && Process.pid == pid
62
62
  memory ||= ps_memory
63
63
  end
64
64
 
@@ -1,3 +1,3 @@
1
1
  class GetProcessMem
2
- VERSION = "0.2.5"
2
+ VERSION = "0.2.6"
3
3
  end
@@ -1,11 +1,20 @@
1
1
  require 'test_helper'
2
2
 
3
3
  class GetProcessMemTest < Test::Unit::TestCase
4
-
5
4
  def setup
6
5
  @mem = GetProcessMem.new
7
6
  end
8
7
 
8
+ def test_different_pid_returns_different_memory
9
+ pid = Process.spawn("tail -f Gemfile")
10
+
11
+ other_mem = GetProcessMem.new(pid)
12
+ assert @mem.kb > other_mem.kb
13
+ ensure
14
+ Process.kill('TERM', pid) if pid
15
+ Process.wait(pid) if pid
16
+ end
17
+
9
18
  def test_seems_to_work
10
19
  assert @mem.kb > 0
11
20
  assert @mem.mb > 0
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: get_process_mem
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.5
4
+ version: 0.2.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Richard Schneeman
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-11-05 00:00:00.000000000 Z
11
+ date: 2020-08-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ffi
@@ -93,7 +93,7 @@ homepage: https://github.com/schneems/get_process_mem
93
93
  licenses:
94
94
  - MIT
95
95
  metadata: {}
96
- post_install_message:
96
+ post_install_message:
97
97
  rdoc_options: []
98
98
  require_paths:
99
99
  - lib
@@ -108,8 +108,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
108
108
  - !ruby/object:Gem::Version
109
109
  version: '0'
110
110
  requirements: []
111
- rubygems_version: 3.0.3
112
- signing_key:
111
+ rubygems_version: 3.1.2
112
+ signing_key:
113
113
  specification_version: 4
114
114
  summary: Use GetProcessMem to find out the amount of RAM used by any process
115
115
  test_files: