linux_proc_mem 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/linux_proc_mem.rb +2 -0
- data/lib/linux_proc_mem/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 85db3531d2fe29cb7947ec571fdb1bde8dba9c6f
|
4
|
+
data.tar.gz: e7a4bb4eb0b2ed6344d462a5dd6452edcfd26cd4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c709ce5f697045f0147b971a2eb4b6b6b6650bc6b070fd81a68cafb027c2fcf44439ebde75921d772f25728da36688ffffc7048222ec3961b3b983bf013dca59
|
7
|
+
data.tar.gz: 4bb53deb4f70b28a617bc3240e8a9c8f5e8d6a5f777b3c08ea401240eed7b18866f8484925f379d2307625deff3e15cf14b5016c45c34ae838cb2d36166bec6f
|
data/lib/linux_proc_mem.rb
CHANGED
@@ -8,6 +8,8 @@ module LinuxProcMem
|
|
8
8
|
file = Pathname.new("/proc/#{pid}/smaps")
|
9
9
|
raise "File #{file} not found!" unless File.exists?(file.to_s)
|
10
10
|
GetProcessMem.new.linux_memory(file) + child_pids(pid).inject(0) { |sum, cpid| sum += get_child_bytes(cpid) }
|
11
|
+
rescue
|
12
|
+
0.0
|
11
13
|
end
|
12
14
|
|
13
15
|
def child_pids(pid)
|