sys-proctable 0.7.4-mswin32

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,54 @@
1
+ ##########################################################
2
+ # test_memleak.rb
3
+ #
4
+ # Test script to check for memory leaks. For now, it is
5
+ # only supported on Linux.
6
+ ##########################################################
7
+ unless PLATFORM =~ /linux/i
8
+ puts "This program is currently only supported on Linux"
9
+ puts "Exiting program"
10
+ exit!
11
+ end
12
+
13
+ base = File.basename(Dir.pwd)
14
+ if base == "test" || base =~ /^sys-proctable.*/
15
+ require "fileutils"
16
+ Dir.chdir("..") if base == "test"
17
+ $LOAD_PATH.unshift(Dir.pwd)
18
+ File.delete("sys/proctable.so") rescue nil
19
+ Dir.mkdir("sys") rescue nil
20
+ FileUtils.cp("ext/proctable.so", "sys")
21
+ end
22
+
23
+
24
+ require "sys/proctable"
25
+ include Sys
26
+
27
+ pid = Process.pid
28
+ fd_file = "/proc/#{pid}/fd/*"
29
+
30
+ initial_fd = 0 # initial number of file descriptors
31
+ found = false
32
+
33
+ puts "ProcTable VERSION: " + ProcTable::VERSION
34
+
35
+ 0.upto(50){ |n|
36
+ ProcTable.ps
37
+ if 0 == n
38
+ initial_fd = Dir[fd_file].length + 1 # one fd margin of error
39
+ puts "Initial file descriptors in use: #{initial_fd - 1}"
40
+ else
41
+ current_fd = Dir[fd_file].length
42
+ if current_fd > initial_fd
43
+ puts "Possible memory leak. FD count now up to #{current_fd}"
44
+ found = true
45
+ end
46
+ end
47
+ }
48
+
49
+ if found
50
+ puts "You appear to have a file descriptor issue"
51
+ puts "After 50 iterations you had #{n} file descriptors open"
52
+ else
53
+ puts "No apparent fd leaks"
54
+ end
metadata ADDED
@@ -0,0 +1,69 @@
1
+ --- !ruby/object:Gem::Specification
2
+ rubygems_version: 0.9.0
3
+ specification_version: 1
4
+ name: sys-proctable
5
+ version: !ruby/object:Gem::Version
6
+ version: 0.7.4
7
+ date: 2006-11-21 00:00:00 -07:00
8
+ summary: An interface for providing process table information
9
+ require_paths:
10
+ - lib
11
+ email: djberg96@gmail.com
12
+ homepage: http://www.rubyforge.org/projects/sysutils
13
+ rubyforge_project: sysutils
14
+ description: An interface for providing process table information
15
+ autorequire:
16
+ default_executable:
17
+ bindir: bin
18
+ has_rdoc: true
19
+ required_ruby_version: !ruby/object:Gem::Version::Requirement
20
+ requirements:
21
+ - - ">="
22
+ - !ruby/object:Gem::Version
23
+ version: 1.8.2
24
+ version:
25
+ platform: mswin32
26
+ signing_key:
27
+ cert_chain:
28
+ post_install_message:
29
+ authors:
30
+ - Daniel J. Berger
31
+ files:
32
+ - doc/freebsd.txt
33
+ - doc/hpux.txt
34
+ - doc/linux.txt
35
+ - doc/solaris.txt
36
+ - doc/top.txt
37
+ - doc/windows.txt
38
+ - test/tc_all.rb
39
+ - test/tc_freebsd.rb
40
+ - test/tc_hpux.rb
41
+ - test/tc_kvm_bsd.rb
42
+ - test/tc_linux.rb
43
+ - test/tc_sunos.rb
44
+ - test/tc_top.rb
45
+ - test/tc_windows.rb
46
+ - test/test_memleak.rb
47
+ - lib/sys/top.rb
48
+ - CHANGES
49
+ - README
50
+ - MANIFEST
51
+ - lib/sys/proctable.rb
52
+ test_files:
53
+ - test/tc_windows.rb
54
+ rdoc_options: []
55
+
56
+ extra_rdoc_files:
57
+ - CHANGES
58
+ - README
59
+ - MANIFEST
60
+ - doc/top.txt
61
+ - doc/windows.txt
62
+ executables: []
63
+
64
+ extensions: []
65
+
66
+ requirements: []
67
+
68
+ dependencies: []
69
+