solaris-kstat 0.2.3 → 1.0.0
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.
- data/CHANGES +5 -0
- data/README +23 -23
- data/ext/extconf.rb +3 -4
- data/ext/solaris/rkstat.c +1 -1
- data/ext/solaris/rkstat.h +1 -1
- data/test/tc_kstat.rb +1 -1
- metadata +44 -37
data/CHANGES
CHANGED
data/README
CHANGED
@@ -15,46 +15,46 @@
|
|
15
15
|
rake install_gem
|
16
16
|
|
17
17
|
== Synopsis
|
18
|
-
require
|
19
|
-
require
|
18
|
+
require 'solaris/kstat'
|
19
|
+
require 'pp'
|
20
20
|
include Solaris
|
21
21
|
|
22
|
-
k = Kstat.new(
|
22
|
+
k = Kstat.new('cpu_info', 0, 'cpu_info0')
|
23
23
|
pp k
|
24
24
|
|
25
|
-
{
|
25
|
+
{'cpu_info'=>
|
26
26
|
{0=>
|
27
|
-
{
|
28
|
-
{
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
27
|
+
{'cpu_info0'=>
|
28
|
+
{'chip_id'=>0,
|
29
|
+
'fpu_type'=>'sparcv9',
|
30
|
+
'device_ID'=>0,
|
31
|
+
'cpu_type'=>'sparcv9',
|
32
|
+
'implementation'=>'Unknown',
|
33
|
+
'clock_MHz'=>502,
|
34
|
+
'state_begin'=>1105974702,
|
35
|
+
'state'=>'on-line'}}}}
|
36
36
|
|
37
37
|
== Class Methods
|
38
38
|
Kstat.new(module=nil, instance=-1, name=nil)
|
39
|
-
Creates and returns a Kstat object.
|
40
|
-
chain.
|
39
|
+
Creates and returns a Kstat object. This does not traverse the kstat
|
40
|
+
chain. The Kstat#record method uses the values passed to actually
|
41
41
|
retrieve data.
|
42
42
|
|
43
|
-
You may specify a module, an instance and a name.
|
43
|
+
You may specify a module, an instance and a name. The module defaults to
|
44
44
|
nil (all modules), the instance defaults to -1 (all instances) and the
|
45
45
|
name defaults to nil (all names).
|
46
46
|
|
47
47
|
== Instance Methods
|
48
48
|
Kstat#record
|
49
|
-
Returns a nested hash based on the values passed to the constructor.
|
49
|
+
Returns a nested hash based on the values passed to the constructor. How
|
50
50
|
deeply that hash is nested depends on the values passed to the constructor.
|
51
51
|
The more specific your criterion, the less data you will receive.
|
52
52
|
|
53
53
|
== Error Classes
|
54
54
|
Kstat::Error < StandardError
|
55
|
-
Raised if anything goes wrong.
|
56
|
-
pass bad arguments to the constructor
|
57
|
-
exist, etc
|
55
|
+
Raised if anything goes wrong. Typically this will only occur if you
|
56
|
+
pass bad arguments to the constructor e.g. a module name that doesn't
|
57
|
+
exist, etc.
|
58
58
|
|
59
59
|
== Unsupported names
|
60
60
|
The following names will not return any meaningful value:
|
@@ -64,13 +64,13 @@ Kstat::Error < StandardError
|
|
64
64
|
* sfmmu_percpu_stat
|
65
65
|
|
66
66
|
== Known Bugs
|
67
|
-
You will receive a couple warnings during the build process.
|
67
|
+
You will receive a couple warnings during the build process. You
|
68
68
|
can ignore these.
|
69
69
|
|
70
70
|
== Designer's Notes
|
71
71
|
I have noticed that results from the cpu_stat module differ from the output
|
72
72
|
of the 'kstat' command line tool. I am convinced that my code is correct and
|
73
|
-
that there is a bug in the Solaris::Kstat Perl module.
|
73
|
+
that there is a bug in the Solaris::Kstat Perl module. Unfortunately, the
|
74
74
|
source for the version of the Solaris::Kstat Perl module that works on
|
75
75
|
Solaris 8 and later is not available (the version on CPAN only works on
|
76
76
|
Solaris 6 and 7).
|
@@ -87,7 +87,7 @@ Kstat::Error < StandardError
|
|
87
87
|
Ruby's
|
88
88
|
|
89
89
|
== Copyright
|
90
|
-
(C) 2003-
|
90
|
+
(C) 2003-2008 Daniel J. Berger
|
91
91
|
All Rights Reserved
|
92
92
|
|
93
93
|
== Warranty
|
data/ext/extconf.rb
CHANGED
@@ -3,14 +3,13 @@ require 'fileutils'
|
|
3
3
|
|
4
4
|
dir_config('kstat')
|
5
5
|
|
6
|
-
FileUtils.cp('solaris/rkstat.c', '.')
|
7
|
-
FileUtils.cp('solaris/rkstat.h', '.')
|
8
|
-
|
9
6
|
# This package requires Solaris 2.8 or later
|
10
7
|
unless have_header('kstat.h')
|
11
8
|
STDERR.puts "The kstat.h header file was not found. Exiting."
|
12
9
|
exit
|
13
10
|
end
|
14
11
|
|
12
|
+
$INCFLAGS += " -Isolaris"
|
13
|
+
|
15
14
|
have_library('kstat')
|
16
|
-
create_makefile('solaris/kstat')
|
15
|
+
create_makefile('solaris/kstat', 'solaris')
|
data/ext/solaris/rkstat.c
CHANGED
@@ -199,7 +199,7 @@ void Init_kstat(){
|
|
199
199
|
/* Unique name within module */
|
200
200
|
rb_define_attr(cKstat, "name", 1, 1);
|
201
201
|
|
202
|
-
/* 0.
|
202
|
+
/* 1.0.0: The version of this library, returned as a String */
|
203
203
|
rb_define_const(cKstat, "VERSION", rb_str_new2(SOLARIS_KSTAT_VERSION));
|
204
204
|
}
|
205
205
|
|
data/ext/solaris/rkstat.h
CHANGED
data/test/tc_kstat.rb
CHANGED
metadata
CHANGED
@@ -1,33 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
|
-
rubygems_version: 0.9.4
|
3
|
-
specification_version: 1
|
4
2
|
name: solaris-kstat
|
5
3
|
version: !ruby/object:Gem::Version
|
6
|
-
version: 0.
|
7
|
-
date: 2007-07-24 00:00:00 -06:00
|
8
|
-
summary: Interface for the Solaris kstat library
|
9
|
-
require_paths:
|
10
|
-
- lib
|
11
|
-
email: djberg96@gmail.com
|
12
|
-
homepage: http://www.rubyforge.org/projects/solarisutils
|
13
|
-
rubyforge_project: solarisutils
|
14
|
-
description: Interface for the Solaris kstat library
|
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:
|
4
|
+
version: 1.0.0
|
25
5
|
platform: ruby
|
26
|
-
signing_key:
|
27
|
-
cert_chain:
|
28
|
-
post_install_message:
|
29
6
|
authors:
|
30
7
|
- Daniel J. Berger
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
|
12
|
+
date: 2008-02-04 00:00:00 -07:00
|
13
|
+
default_executable:
|
14
|
+
dependencies: []
|
15
|
+
|
16
|
+
description: Interface for the Solaris kstat library
|
17
|
+
email: djberg96@gmail.com
|
18
|
+
executables: []
|
19
|
+
|
20
|
+
extensions:
|
21
|
+
- ext/extconf.rb
|
22
|
+
extra_rdoc_files:
|
23
|
+
- README
|
24
|
+
- CHANGES
|
25
|
+
- MANIFEST
|
26
|
+
- ext/solaris/rkstat.c
|
31
27
|
files:
|
32
28
|
- ext/extconf.rb
|
33
29
|
- ext/solaris
|
@@ -38,20 +34,31 @@ files:
|
|
38
34
|
- README
|
39
35
|
- CHANGES
|
40
36
|
- MANIFEST
|
41
|
-
|
42
|
-
|
37
|
+
has_rdoc: true
|
38
|
+
homepage: http://www.rubyforge.org/projects/solarisutils
|
39
|
+
post_install_message:
|
43
40
|
rdoc_options: []
|
44
41
|
|
45
|
-
|
46
|
-
-
|
47
|
-
|
48
|
-
|
49
|
-
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
42
|
+
require_paths:
|
43
|
+
- lib
|
44
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
45
|
+
requirements:
|
46
|
+
- - ">="
|
47
|
+
- !ruby/object:Gem::Version
|
48
|
+
version: 1.8.0
|
49
|
+
version:
|
50
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: "0"
|
55
|
+
version:
|
54
56
|
requirements: []
|
55
57
|
|
56
|
-
|
57
|
-
|
58
|
+
rubyforge_project: solarisutils
|
59
|
+
rubygems_version: 1.0.1
|
60
|
+
signing_key:
|
61
|
+
specification_version: 2
|
62
|
+
summary: Interface for the Solaris kstat library
|
63
|
+
test_files:
|
64
|
+
- test/tc_kstat.rb
|