sys-proctable 0.7.6-powerpc-darwin
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGES +233 -0
- data/MANIFEST +41 -0
- data/README +140 -0
- data/doc/freebsd.txt +90 -0
- data/doc/hpux.txt +77 -0
- data/doc/linux.txt +85 -0
- data/doc/solaris.txt +99 -0
- data/doc/top.txt +53 -0
- data/doc/windows.txt +122 -0
- data/ext/darwin/darwin.c +240 -0
- data/ext/extconf.rb +98 -0
- data/ext/version.h +2 -0
- data/lib/sys/top.rb +23 -0
- data/test/tc_all.rb +59 -0
- data/test/tc_freebsd.rb +45 -0
- data/test/tc_hpux.rb +49 -0
- data/test/tc_kvm_bsd.rb +31 -0
- data/test/tc_linux.rb +45 -0
- data/test/tc_sunos.rb +52 -0
- data/test/tc_top.rb +26 -0
- data/test/tc_windows.rb +40 -0
- data/test/test_memleak.rb +54 -0
- metadata +71 -0
data/test/tc_windows.rb
ADDED
@@ -0,0 +1,40 @@
|
|
1
|
+
##################################################
|
2
|
+
# tc_windows.rb
|
3
|
+
#
|
4
|
+
# Test suite for sys-proctable for MS Windows
|
5
|
+
##################################################
|
6
|
+
require 'sys/proctable'
|
7
|
+
require 'test/unit'
|
8
|
+
require 'test/tc_all'
|
9
|
+
|
10
|
+
class TC_ProcTable_MSWindows < Test::Unit::TestCase
|
11
|
+
def setup
|
12
|
+
@fields = %w/
|
13
|
+
caption cmdline comm creation_class_name creation_date
|
14
|
+
cs_creation_class_name cs_name description executable_path
|
15
|
+
execution_state handle handle_count install_date kernel_mode_time
|
16
|
+
maximum_working_set_size minimum_working_set_size name
|
17
|
+
os_creation_class_name os_name other_operation_count
|
18
|
+
other_transfer_count page_faults page_file_usage
|
19
|
+
peak_virtual_size ppid peak_working_set_size priority
|
20
|
+
private_page_count pid quota_non_paged_pool_usage
|
21
|
+
quota_paged_pool_usage quota_peak_non_paged_pool_usage
|
22
|
+
quota_non_paged_pool_usage read_operation_count read_transfer_count
|
23
|
+
session_id termination_date thread_count user_mode_time virtual_size
|
24
|
+
windows_version working_set_size write_operation_count write_transfer_count
|
25
|
+
/
|
26
|
+
@pt = ProcTable.ps.first
|
27
|
+
end
|
28
|
+
|
29
|
+
def test_field_members
|
30
|
+
msg = "Struct members don't match expected fields"
|
31
|
+
assert_equal(@fields.length, @pt.length, "Bad length")
|
32
|
+
assert_equal(@fields, ProcTable.fields, "Bad fields")
|
33
|
+
assert_equal(@fields, @pt.members, msg)
|
34
|
+
end
|
35
|
+
|
36
|
+
def teardown
|
37
|
+
@pt = nil
|
38
|
+
@fields = nil
|
39
|
+
end
|
40
|
+
end
|
@@ -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,71 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
rubygems_version: 0.9.4
|
3
|
+
specification_version: 1
|
4
|
+
name: sys-proctable
|
5
|
+
version: !ruby/object:Gem::Version
|
6
|
+
version: 0.7.6
|
7
|
+
date: 2007-07-11 00:00:00 -06: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.0
|
24
|
+
version:
|
25
|
+
platform: powerpc-darwin
|
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
|
+
- ext/darwin/darwin.c
|
52
|
+
- ext/extconf.rb
|
53
|
+
- ext/version.h
|
54
|
+
test_files: []
|
55
|
+
|
56
|
+
rdoc_options: []
|
57
|
+
|
58
|
+
extra_rdoc_files:
|
59
|
+
- CHANGES
|
60
|
+
- README
|
61
|
+
- MANIFEST
|
62
|
+
- doc/top.txt
|
63
|
+
- ext/darwin/darwin.c
|
64
|
+
executables: []
|
65
|
+
|
66
|
+
extensions:
|
67
|
+
- ext/extconf.rb
|
68
|
+
requirements: []
|
69
|
+
|
70
|
+
dependencies: []
|
71
|
+
|