rbbt-util 5.37.1 → 5.37.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
  SHA256:
3
- metadata.gz: ff7fd35bf9c27bd85ceaddfa0993975120af965521ea1f709dbc0d8538bdb3e0
4
- data.tar.gz: 9e5afd5c4141885b496f279a267287fe394728eb889bbacfd61d38dcb22033d4
3
+ metadata.gz: 07fa1d0cd31a7eb51d942fdd50e97b1a9740d7412a945e9669fb9261d6bb482c
4
+ data.tar.gz: 3a3ab79e1b42919711c57f9d4c264b910f1f96ecac250062186e525ae5482c2b
5
5
  SHA512:
6
- metadata.gz: 33f970e1a1203838755c4202f918750ac6addcca4c2ab2fc365037096e4547e176f53ace330ac322bd16140071a04824b8c4aeb3d28353ec4522cc06d4bf16fc
7
- data.tar.gz: '09793d590a287c89037679e53123a6031b63ba54923b8fb46cf1c4440a85f1702617dc8d53b652b9895e2b7e4a48b927e083982325d102d9bdd8616ca507b26b'
6
+ metadata.gz: 4969b37961d809840e7d047cb6e05d90e6dda0561784afe864e1ab7a10da93e827a1fc6be292960ce8463986ed44fcdf87a95cd0009df498f62cce12e90a4b89
7
+ data.tar.gz: eaf19c896b1317bcf5ca3aa479f6af1a404ba7fb2f17896afd1ea74f3f3410bbf5f3c2608f91c27524748c55911c6e68edf776ebc14abe36ac184a2814314433
@@ -397,7 +397,13 @@ def self.add_libdir(dir=nil)
397
397
  end
398
398
  end
399
399
  def self.memory_use(pid=nil)
400
- `ps -o rss -p #{pid || $$}`.strip.split.last.to_i
400
+ pid ||= $$
401
+ begin
402
+ CMD.cmd("grep 'VmRSS:' /proc/#{pid}/status").read.scan(/\d+/).first.to_i
403
+ rescue ProcessFailed
404
+ raise "Process with #{pid} not found"
405
+ end
406
+ #`ps -o rss -p #{pid || $$}`.strip.split.last.to_i
401
407
  end
402
408
 
403
409
 
@@ -2,7 +2,11 @@ require File.join(File.expand_path(File.dirname(__FILE__)), '../../..', 'test_he
2
2
  require 'rbbt/util/misc/development'
3
3
 
4
4
  class TestMiscDevelopment < Test::Unit::TestCase
5
- def test_ssh
5
+ def test_mem
6
+ assert Integer === Misc.memory_use
7
+ end
8
+
9
+ def ___test_ssh
6
10
  Misc.ssh_run 'mn1' do
7
11
  puts "hola"
8
12
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rbbt-util
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.37.1
4
+ version: 5.37.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Miguel Vazquez
@@ -136,6 +136,20 @@ dependencies:
136
136
  - - ">="
137
137
  - !ruby/object:Gem::Version
138
138
  version: '0'
139
+ - !ruby/object:Gem::Dependency
140
+ name: nokogiri
141
+ requirement: !ruby/object:Gem::Requirement
142
+ requirements:
143
+ - - ">="
144
+ - !ruby/object:Gem::Version
145
+ version: '0'
146
+ type: :runtime
147
+ prerelease: false
148
+ version_requirements: !ruby/object:Gem::Requirement
149
+ requirements:
150
+ - - ">="
151
+ - !ruby/object:Gem::Version
152
+ version: '0'
139
153
  description: Utilities for handling tsv files, caches, etc
140
154
  email: miguel.vazquez.g@bsc.es
141
155
  executables: