cloud_monitor_agent 0.0.1 → 0.0.2
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.
- checksums.yaml +4 -4
- data/Gemfile +1 -0
- data/cloud_monitor_agent.gemspec +0 -1
- data/lib/version.rb +1 -1
- data/spec/cloud_monitor_spec.rb +16 -15
- metadata +1 -15
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2b4136e1502eb9d07ba91c02e86e3f57c76757cd
|
4
|
+
data.tar.gz: d1062b2a771b2d7324e9c83cc04a465af00799d1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 976b148254c1b36a5d3bb199a40431ec317c54e549eb708546197759eddbeeb4914d40da01c6c752cd8318dcf141cbe70804de0fec6dcde35befd85efb6ddede
|
7
|
+
data.tar.gz: 6369345bf59de90749a76a91736ab25577ccd41c56108feef94f99d08dbcfc37ea3a81b380d37c7e38f8f2a9b217300600c8316b0aa93f372a3178d5f240ff9a
|
data/Gemfile
CHANGED
data/cloud_monitor_agent.gemspec
CHANGED
data/lib/version.rb
CHANGED
data/spec/cloud_monitor_spec.rb
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
require 'rspec'
|
2
2
|
require 'spec_helper'
|
3
|
+
require './lib/cloud_monitor_agent'
|
3
4
|
|
4
5
|
describe 'IncludeLibrary' do
|
5
6
|
it 'should include the library' do
|
@@ -13,7 +14,7 @@ describe 'Should Initilize API' do
|
|
13
14
|
a = CloudMonitorAgent.new("http://localhost:9292/api/v1/push_info", "6a44b2afb6d719a321567a56a37171d5", 60)
|
14
15
|
a.api_url.class.should be(String)
|
15
16
|
a.api_url.should_not be_nil
|
16
|
-
a.api_url.
|
17
|
+
a.api_url.should eq("http://localhost:9292/api/v1/push_info")
|
17
18
|
end
|
18
19
|
end
|
19
20
|
|
@@ -22,16 +23,16 @@ describe 'Should Initilize Token' do
|
|
22
23
|
a = CloudMonitorAgent.new("http://localhost:9292/api/v1/push_info", "6a44b2afb6d719a321567a56a37171d5", 60)
|
23
24
|
a.token.class.should be(String)
|
24
25
|
a.token.should_not be_nil
|
25
|
-
a.token.
|
26
|
+
a.token.should eq("6a44b2afb6d719a321567a56a37171d5")
|
26
27
|
end
|
27
28
|
end
|
28
29
|
|
29
30
|
describe 'Should Initilize delay time' do
|
30
31
|
it "should send data after proper delay" do
|
31
32
|
a = CloudMonitorAgent.new("http://localhost:9292/api/v1/push_info", "6a44b2afb6d719a321567a56a37171d5", 60)
|
32
|
-
a.delay.class.should be(
|
33
|
+
a.delay.class.should be(Fixnum)
|
33
34
|
a.delay.should_not be_nil
|
34
|
-
a.
|
35
|
+
a.delay.should eq(60)
|
35
36
|
end
|
36
37
|
end
|
37
38
|
|
@@ -39,26 +40,26 @@ describe 'Payload Verification' do
|
|
39
40
|
it "should contain proper token on payload" do
|
40
41
|
a = CloudMonitorAgent.new("http://localhost:9292/api/v1/push_info", "6a44b2afb6d719a321567a56a37171d5", 60)
|
41
42
|
payload = a.getPayload
|
42
|
-
payload
|
43
|
-
payload
|
44
|
-
payload
|
43
|
+
payload[:token].class.should be(String)
|
44
|
+
payload[:token].should_not be_nil
|
45
|
+
payload[:token].should eq("6a44b2afb6d719a321567a56a37171d5")
|
45
46
|
end
|
46
47
|
|
47
48
|
it "should be the percentage of cpu used" do
|
48
49
|
a = CloudMonitorAgent.new("http://localhost:9292/api/v1/push_info", "6a44b2afb6d719a321567a56a37171d5", 60)
|
49
50
|
payload = a.getPayload
|
50
|
-
payload.
|
51
|
-
payload.
|
52
|
-
payload.
|
53
|
-
payload.
|
51
|
+
payload[:cpu_used].class.should be(Float)
|
52
|
+
payload[:cpu_used].should_not be_nil
|
53
|
+
payload[:cpu_used].should be <= 100
|
54
|
+
payload[:cpu_used].should be >= 0
|
54
55
|
end
|
55
56
|
|
56
57
|
it "should be the percentage of GB of disk used" do
|
57
58
|
a = CloudMonitorAgent.new("http://localhost:9292/api/v1/push_info", "6a44b2afb6d719a321567a56a37171d5", 60)
|
58
59
|
payload = a.getPayload
|
59
|
-
payload.
|
60
|
-
payload.
|
61
|
-
payload.
|
62
|
-
payload.
|
60
|
+
payload[:disk_used].class.should be(Float)
|
61
|
+
payload[:disk_used].should_not be_nil
|
62
|
+
payload[:disk_used].should be <= 100
|
63
|
+
payload[:disk_used].should be >= 0
|
63
64
|
end
|
64
65
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cloud_monitor_agent
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- G SubbaRao
|
@@ -52,20 +52,6 @@ dependencies:
|
|
52
52
|
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0'
|
55
|
-
- !ruby/object:Gem::Dependency
|
56
|
-
name: rspec
|
57
|
-
requirement: !ruby/object:Gem::Requirement
|
58
|
-
requirements:
|
59
|
-
- - ">="
|
60
|
-
- !ruby/object:Gem::Version
|
61
|
-
version: '0'
|
62
|
-
type: :development
|
63
|
-
prerelease: false
|
64
|
-
version_requirements: !ruby/object:Gem::Requirement
|
65
|
-
requirements:
|
66
|
-
- - ">="
|
67
|
-
- !ruby/object:Gem::Version
|
68
|
-
version: '0'
|
69
55
|
description: A Ruby Gem with methods to send statistics such as CPU, Disk, TCP/UDP
|
70
56
|
Connections, Load, Bandwidth, Disk I/O, and Memory to remote address
|
71
57
|
email:
|