right_agent 0.5.1 → 0.5.10

Sign up to get free protection for your applications and to get access to all the features.
Files changed (36) hide show
  1. data/lib/right_agent.rb +3 -13
  2. data/lib/right_agent/actors/agent_manager.rb +78 -4
  3. data/lib/right_agent/agent.rb +81 -4
  4. data/lib/right_agent/agent_config.rb +17 -1
  5. data/lib/right_agent/agent_tags_manager.rb +2 -2
  6. data/lib/right_agent/broker_client.rb +32 -34
  7. data/lib/right_agent/command/agent_manager_commands.rb +16 -0
  8. data/lib/right_agent/command/command_constants.rb +0 -9
  9. data/lib/right_agent/dispatcher.rb +6 -3
  10. data/lib/right_agent/ha_broker_client.rb +63 -14
  11. data/lib/right_agent/log.rb +1 -1
  12. data/lib/right_agent/minimal.rb +43 -0
  13. data/lib/right_agent/monkey_patches/amqp_patch.rb +91 -182
  14. data/lib/right_agent/packets.rb +10 -5
  15. data/lib/right_agent/platform.rb +8 -0
  16. data/lib/right_agent/platform/darwin.rb +14 -0
  17. data/lib/right_agent/platform/linux.rb +23 -0
  18. data/lib/right_agent/platform/windows.rb +31 -0
  19. data/lib/right_agent/scripts/agent_controller.rb +16 -8
  20. data/lib/right_agent/scripts/agent_deployer.rb +6 -0
  21. data/lib/right_agent/scripts/log_level_manager.rb +4 -5
  22. data/lib/right_agent/scripts/stats_manager.rb +9 -1
  23. data/lib/right_agent/sender.rb +623 -371
  24. data/lib/right_agent/stats_helper.rb +15 -1
  25. data/lib/right_agent/tracer.rb +1 -1
  26. data/right_agent.gemspec +14 -15
  27. data/spec/agent_config_spec.rb +9 -0
  28. data/spec/agent_spec.rb +154 -18
  29. data/spec/broker_client_spec.rb +171 -170
  30. data/spec/dispatcher_spec.rb +24 -8
  31. data/spec/ha_broker_client_spec.rb +55 -33
  32. data/spec/monkey_patches/amqp_patch_spec.rb +12 -0
  33. data/spec/packets_spec.rb +2 -0
  34. data/spec/sender_spec.rb +140 -69
  35. data/spec/stats_helper_spec.rb +5 -0
  36. metadata +54 -53
@@ -301,6 +301,7 @@ describe RightScale::StatsHelper do
301
301
  {"alias" => "b2", "identity" => "rs-broker-localhost-5674", "status" => "failed",
302
302
  "disconnect last" => nil, "disconnects" => nil,
303
303
  "failure last" => {"elapsed" => 1000}, "failures" => 3, "retries" => 2}],
304
+ "heartbeat" => nil,
304
305
  "exceptions" => {}}
305
306
  end
306
307
 
@@ -437,12 +438,14 @@ describe RightScale::StatsHelper do
437
438
  " b1: rs-broker-localhost-5673 disconnected, disconnects: 2 (16 min 40 sec ago), failures: none\n" +
438
439
  " b2: rs-broker-localhost-5674 failed, disconnects: none, failures: 3 (16 min 40 sec ago w/ 2 retries)\n" +
439
440
  " exceptions : none\n" +
441
+ " heartbeat : none\n" +
440
442
  " returns : none\n"
441
443
  end
442
444
 
443
445
  it "should display broker exceptions and returns" do
444
446
  @exceptions.track("testing", Exception.new("Test error"))
445
447
  @brokers["exceptions"] = @exceptions.stats
448
+ @brokers["heartbeat"] = 60
446
449
  activity = RightScale::StatsHelper::ActivityStats.new
447
450
  activity.update("no queue")
448
451
  activity.finish(@now - 10)
@@ -457,6 +460,7 @@ describe RightScale::StatsHelper do
457
460
  " exceptions : testing total: 1, most recent:\n" +
458
461
  " (1) Mon Jan 12 05:46:40 Exception: Test error\n" +
459
462
  " \n" +
463
+ " heartbeat : 60 sec\n" +
460
464
  " returns : no queue consumers: 67%, no queue: 33%, total: 3, \n" +
461
465
  " last: no queue consumers (10 sec ago), rate: 0/sec\n"
462
466
  end
@@ -616,6 +620,7 @@ describe RightScale::StatsHelper do
616
620
  " b1: rs-broker-localhost-5673 disconnected, disconnects: 2 (16 min 40 sec ago), failures: none\n" +
617
621
  " b2: rs-broker-localhost-5674 failed, disconnects: none, failures: 3 (16 min 40 sec ago w/ 2 retries)\n" +
618
622
  " exceptions : none\n" +
623
+ " heartbeat : none\n" +
619
624
  " returns : none\n" +
620
625
  "stuff : activity % : testing: 100%, total: 1\n" +
621
626
  " activity last : testing: 10 sec ago\n" +
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: right_agent
3
3
  version: !ruby/object:Gem::Version
4
- hash: 9
4
+ hash: 31
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 5
9
- - 1
10
- version: 0.5.1
9
+ - 10
10
+ version: 0.5.10
11
11
  platform: ruby
12
12
  authors:
13
13
  - Lee Kirchhoff
@@ -17,68 +17,57 @@ autorequire:
17
17
  bindir: bin
18
18
  cert_chain: []
19
19
 
20
- date: 2011-09-26 00:00:00 -07:00
20
+ date: 2011-11-03 00:00:00 -07:00
21
21
  default_executable:
22
22
  dependencies:
23
23
  - !ruby/object:Gem::Dependency
24
- type: :runtime
25
- prerelease: false
26
- name: right_support
27
- version_requirements: &id001 !ruby/object:Gem::Requirement
24
+ requirement: &id001 !ruby/object:Gem::Requirement
28
25
  none: false
29
26
  requirements:
30
- - - ">="
27
+ - - ~>
31
28
  - !ruby/object:Gem::Version
32
- hash: 3
29
+ hash: 15
33
30
  segments:
31
+ - 1
34
32
  - 0
35
- version: "0"
36
- requirement: *id001
37
- - !ruby/object:Gem::Dependency
38
- type: :runtime
33
+ version: "1.0"
34
+ name: right_support
39
35
  prerelease: false
40
- name: amqp
41
- version_requirements: &id002 !ruby/object:Gem::Requirement
36
+ type: :runtime
37
+ version_requirements: *id001
38
+ - !ruby/object:Gem::Dependency
39
+ requirement: &id002 !ruby/object:Gem::Requirement
42
40
  none: false
43
41
  requirements:
44
42
  - - "="
45
43
  - !ruby/object:Gem::Version
46
- hash: 9
44
+ hash: 1
47
45
  segments:
48
46
  - 0
49
- - 6
50
47
  - 7
51
- version: 0.6.7
52
- requirement: *id002
53
- - !ruby/object:Gem::Dependency
54
- type: :runtime
48
+ - 1
49
+ version: 0.7.1
50
+ name: amqp
55
51
  prerelease: false
56
- name: json
57
- version_requirements: &id003 !ruby/object:Gem::Requirement
52
+ type: :runtime
53
+ version_requirements: *id002
54
+ - !ruby/object:Gem::Dependency
55
+ requirement: &id003 !ruby/object:Gem::Requirement
58
56
  none: false
59
57
  requirements:
60
- - - ">="
61
- - !ruby/object:Gem::Version
62
- hash: 15
63
- segments:
64
- - 1
65
- - 4
66
- - 4
67
- version: 1.4.4
68
- - - <=
58
+ - - ~>
69
59
  - !ruby/object:Gem::Version
70
- hash: 11
60
+ hash: 7
71
61
  segments:
72
62
  - 1
73
63
  - 4
74
- - 6
75
- version: 1.4.6
76
- requirement: *id003
77
- - !ruby/object:Gem::Dependency
78
- type: :runtime
64
+ version: "1.4"
65
+ name: json
79
66
  prerelease: false
80
- name: eventmachine
81
- version_requirements: &id004 !ruby/object:Gem::Requirement
67
+ type: :runtime
68
+ version_requirements: *id003
69
+ - !ruby/object:Gem::Dependency
70
+ requirement: &id004 !ruby/object:Gem::Requirement
82
71
  none: false
83
72
  requirements:
84
73
  - - ~>
@@ -89,12 +78,12 @@ dependencies:
89
78
  - 12
90
79
  - 10
91
80
  version: 0.12.10
92
- requirement: *id004
93
- - !ruby/object:Gem::Dependency
94
- type: :runtime
81
+ name: eventmachine
95
82
  prerelease: false
96
- name: right_popen
97
- version_requirements: &id005 !ruby/object:Gem::Requirement
83
+ type: :runtime
84
+ version_requirements: *id004
85
+ - !ruby/object:Gem::Dependency
86
+ requirement: &id005 !ruby/object:Gem::Requirement
98
87
  none: false
99
88
  requirements:
100
89
  - - ~>
@@ -105,12 +94,12 @@ dependencies:
105
94
  - 0
106
95
  - 11
107
96
  version: 1.0.11
108
- requirement: *id005
109
- - !ruby/object:Gem::Dependency
110
- type: :runtime
97
+ name: right_popen
111
98
  prerelease: false
112
- name: msgpack
113
- version_requirements: &id006 !ruby/object:Gem::Requirement
99
+ type: :runtime
100
+ version_requirements: *id005
101
+ - !ruby/object:Gem::Dependency
102
+ requirement: &id006 !ruby/object:Gem::Requirement
114
103
  none: false
115
104
  requirements:
116
105
  - - "="
@@ -121,8 +110,19 @@ dependencies:
121
110
  - 4
122
111
  - 4
123
112
  version: 0.4.4
124
- requirement: *id006
125
- description: " RightAgent provides a foundation for running an agent on a server to interface\n in a secure fashion with other agents in the RightScale system. A RightAgent\n uses RabbitMQ as the message bus and the RightScale mapper as the routing node.\n Servers running a RightAgent establish a queue on startup for receiving packets\n routed to it via the mapper. The packets are structured to invoke services in\n the agent represented by actors and methods. The RightAgent may respond to these\n requests with a result packet that the mapper then routes to the originator.\n Similarly a RightAgent can also make requests of other RightAgents in the\n"
113
+ name: msgpack
114
+ prerelease: false
115
+ type: :runtime
116
+ version_requirements: *id006
117
+ description: |
118
+ RightAgent provides a foundation for running an agent on a server to interface
119
+ in a secure fashion with other agents in the RightScale system. A RightAgent
120
+ uses RabbitMQ as the message bus and the RightScale mapper as the routing node.
121
+ Servers running a RightAgent establish a queue on startup for receiving packets
122
+ routed to it via the mapper. The packets are structured to invoke services in
123
+ the agent represented by actors and methods. The RightAgent may respond to these
124
+ requests with a result packet that the mapper then routes to the originator.
125
+
126
126
  email: lee@rightscale.com
127
127
  executables: []
128
128
 
@@ -178,6 +178,7 @@ files:
178
178
  - lib/right_agent/ha_broker_client.rb
179
179
  - lib/right_agent/idempotent_request.rb
180
180
  - lib/right_agent/log.rb
181
+ - lib/right_agent/minimal.rb
181
182
  - lib/right_agent/monkey_patches.rb
182
183
  - lib/right_agent/monkey_patches/amqp_patch.rb
183
184
  - lib/right_agent/monkey_patches/ruby_patch.rb