server_metrics 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
@@ -106,6 +106,7 @@ class ServerMetrics::Processes
|
|
106
106
|
# for reinstantiating from a hash
|
107
107
|
# why not just use marshall? this is a lot more manageable written to the Scout agent's history file.
|
108
108
|
def self.from_hash(hash)
|
109
|
+
p=new(hash[:options])
|
109
110
|
p.instance_variable_set('@last_run', hash[:last_run])
|
110
111
|
p.instance_variable_set('@last_process_list', hash[:last_process_list])
|
111
112
|
p
|
data/test/test_basics.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
require File.expand_path("test_helper",File.dirname(__FILE__))
|
2
2
|
|
3
|
-
class
|
3
|
+
class TestBasics < Test::Unit::TestCase
|
4
4
|
|
5
5
|
def test_colectors_defined
|
6
6
|
assert_nothing_raised do
|
@@ -90,6 +90,7 @@ class TestWithFixtures < Test::Unit::TestCase
|
|
90
90
|
def test_processes_from_hash
|
91
91
|
last_run=Time.now-60
|
92
92
|
p=ServerMetrics::Processes.from_hash(:last_run=>last_run,:last_process_list=>"bogus value")
|
93
|
+
assert p.is_a?(ServerMetrics::Processes)
|
93
94
|
assert_equal last_run, p.instance_variable_get("@last_run")
|
94
95
|
assert_equal "bogus value", p.instance_variable_get("@last_process_list")
|
95
96
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: server_metrics
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -171,7 +171,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
171
171
|
version: '0'
|
172
172
|
segments:
|
173
173
|
- 0
|
174
|
-
hash:
|
174
|
+
hash: 2520847385531363153
|
175
175
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
176
176
|
none: false
|
177
177
|
requirements:
|
@@ -180,7 +180,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
180
180
|
version: '0'
|
181
181
|
segments:
|
182
182
|
- 0
|
183
|
-
hash:
|
183
|
+
hash: 2520847385531363153
|
184
184
|
requirements: []
|
185
185
|
rubyforge_project:
|
186
186
|
rubygems_version: 1.8.25
|