right_support 2.7.0 → 2.8.0
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +1 -1
- data/Gemfile.lock +23 -21
- data/Rakefile +6 -1
- data/VERSION +1 -1
- data/lib/right_support/net/request_balancer.rb +2 -2
- data/lib/right_support/stats/activity.rb +103 -44
- data/lib/right_support/stats/exceptions.rb +54 -17
- data/lib/right_support/stats/helpers.rb +108 -125
- data/right_support.gemspec +8 -12
- data/spec/stats/activity_spec.rb +234 -122
- data/spec/stats/exceptions_spec.rb +172 -66
- data/spec/stats/helpers_spec.rb +57 -0
- metadata +25 -25
data/spec/stats/helpers_spec.rb
CHANGED
@@ -159,6 +159,12 @@ describe RightSupport::Stats do
|
|
159
159
|
end
|
160
160
|
|
161
161
|
context "wrap" do
|
162
|
+
it "removes extra white space before wrapping" do
|
163
|
+
string = "This is a test of wrapping\nwhen there is extra white space.\n\n"
|
164
|
+
RightSupport::Stats.wrap(string, [40, 50], " " * 10, /\s/).should ==
|
165
|
+
"This is a test of wrapping when there \n is extra white space."
|
166
|
+
end
|
167
|
+
|
162
168
|
it "wraps string by breaking it into lines at the specified separator" do
|
163
169
|
string = "Now is the time for all good men to come to the aid of their people."
|
164
170
|
indent = " " * 4
|
@@ -213,6 +219,10 @@ describe RightSupport::Stats do
|
|
213
219
|
"`cascade_serializers')"
|
214
220
|
result.split("\n").select { |l| l.chomp.size > 80 }.should be_empty
|
215
221
|
end
|
222
|
+
|
223
|
+
it "can handle very large number of separations without blowing up" do
|
224
|
+
RightSupport::Stats.wrap("/ " * 5000, 50, " " * 10, /\s|\//).count("\n").should == 249
|
225
|
+
end
|
216
226
|
end
|
217
227
|
|
218
228
|
context "sort_key" do
|
@@ -381,6 +391,53 @@ describe RightSupport::Stats do
|
|
381
391
|
"----(1) Mon Jan 12 #{@hr}:46:40 Exception: This is a very long exception message that \n" +
|
382
392
|
"---- should be wrapped so that it stays within the maximum line length"
|
383
393
|
end
|
394
|
+
|
395
|
+
it "removes embedded backtrace" do
|
396
|
+
exceptions = {
|
397
|
+
"receive" => {
|
398
|
+
"total" => 2,
|
399
|
+
"recent" => [{
|
400
|
+
"type" => "RightScale::Serializer::SerializationError",
|
401
|
+
"count" => 2,
|
402
|
+
"when" => 1376259979,
|
403
|
+
"where" => "/opt/rightscale/right_link/common/lib/common/serializer.rb:133:in `cascade_serializers'",
|
404
|
+
"message" => "Could not load packet using [RightScale::SecureSerializer] " +
|
405
|
+
"(Failed to load with RightScale::SecureSerializer (TypeError:\n " +
|
406
|
+
"can't convert nil into String in\n /opt/rightscale/right_link/common/lib/common/security/signature.rb:56:in " +
|
407
|
+
"`initialize'\n /opt/rightscale/right_link/common/lib/common/security/signature.rb:56:in " +
|
408
|
+
"`new'\n /opt/\nrightscale/right_link/common/lib/common/security/signature.rb:56:in " +
|
409
|
+
"`from_data'\n /opt/rightscale/right_link/common/lib/common/security/secure_serializer.rb:115:in " +
|
410
|
+
"`load'\n /opt/rightscale/right_link/common/lib/\ncommon/serializer.rb:125:in `__send__'\n " +
|
411
|
+
"/opt/rightscale/right_link/common/lib/common/serializer.rb:125:in `cascade_serializers'\n " +
|
412
|
+
"/opt/rightscale/right_link/common/lib/common/serializer.rb:122:in `map'\n " +
|
413
|
+
"/opt/\nrightscale/right_link/common/lib/common/serializer.rb:122:in `cascade_serializers'\n " +
|
414
|
+
"/opt/rightscale/right_link/common/lib/common/serializer.rb:96:in `load'\n " +
|
415
|
+
"/opt/rightscale/right_link/common/lib/common/broker_\nclient.rb:609:in `receive'\n " +
|
416
|
+
"/opt/rightscale/right_link/common/lib/common/broker_client.rb:243:in `subscribe'\n " +
|
417
|
+
"/opt/rightscale/sandbox/lib/ruby/gems/1.8/gems/amqp-0.6.7/lib/mq/queue.rb:391:in `call'\n " +
|
418
|
+
"/opt/rig\nhtscale/sandbox/lib/ruby/gems/1.8/gems/amqp-0.6.7/lib/mq/queue.rb:391:in `receive'\n " +
|
419
|
+
"/opt/rightscale/right_link/common/lib/common/amqp.rb:68:in `process_frame'\n " +
|
420
|
+
"/opt/rightscale/sandbox/lib/ruby/gems/1.8/gems/am\nqp-0.6.7/lib/amqp/client.rb:9:in `orig_process_frame'\n " +
|
421
|
+
"/opt/rightscale/right_link/common/lib/common/amqp.rb:268:in `process_frame'\n " +
|
422
|
+
"/opt/rightscale/sandbox/lib/ruby/gems/1.8/gems/amqp-0.6.7/lib/amqp/client.rb:\n117:in `orig_receive_data'\n " +
|
423
|
+
"/opt/rightscale/right_link/common/lib/common/amqp.rb:252:in `receive_data'\n " +
|
424
|
+
"/opt/rightscale/sandbox/lib/ruby/gems/1.8/gems/eventmachine-0.12.11.5/lib/eventmachine.rb:194:in `run_mac\n" +
|
425
|
+
"hine'\n /opt/rightscale/sandbox/lib/ruby/gems/1.8/gems/eventmachine-0.12.11.5/lib/eventmachine.rb:194:in `run'\n " +
|
426
|
+
"/opt/rightscale/right_link/scripts/lib/agent_controller.rb:346:in `start_agent'\n " +
|
427
|
+
"/opt/rightscale\n/right_link/scripts/lib/agent_controller.rb:260:in `run_cmd'\n " +
|
428
|
+
"/opt/rightscale/right_link/scripts/lib/agent_controller.rb:144:in `control'\n " +
|
429
|
+
"/opt/rightscale/right_link/scripts/lib/agent_controller.rb:102:in `run\n'\n " +
|
430
|
+
"/opt/rightscale/right_link/scripts/rnac.rb:37)) IN " +
|
431
|
+
"/opt/rightscale/right_link/common/lib/common/serializer.rb:133:in `cascade_serializers'"}]}}
|
432
|
+
RightSupport::Stats.exceptions_str(exceptions, "").should ==
|
433
|
+
"receive total: 2, most recent:\n" +
|
434
|
+
"(2) Sun Aug 11 15:26:19 RightScale::Serializer::SerializationError: Could not \n" +
|
435
|
+
" load packet using [RightScale::SecureSerializer] (Failed to load with \n" +
|
436
|
+
" RightScale::SecureSerializer (TypeError: can't convert nil into String in /opt/\n" +
|
437
|
+
" rightscale/right_link/common/lib/common/security/signature.rb:56:in \n" +
|
438
|
+
" `initialize'... IN /opt/rightscale/right_link/common/lib/common/serializer.\n" +
|
439
|
+
" rb:133:in `cascade_serializers'"
|
440
|
+
end
|
384
441
|
end
|
385
442
|
|
386
443
|
context "hash_str" do
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: right_support
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 47
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 2
|
8
|
-
-
|
8
|
+
- 8
|
9
9
|
- 0
|
10
|
-
version: 2.
|
10
|
+
version: 2.8.0
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Tony Spataro
|
@@ -20,10 +20,11 @@ autorequire:
|
|
20
20
|
bindir: bin
|
21
21
|
cert_chain: []
|
22
22
|
|
23
|
-
date: 2013-
|
23
|
+
date: 2013-08-28 00:00:00 -07:00
|
24
24
|
default_executable:
|
25
25
|
dependencies:
|
26
26
|
- !ruby/object:Gem::Dependency
|
27
|
+
type: :development
|
27
28
|
requirement: &id001 !ruby/object:Gem::Requirement
|
28
29
|
none: false
|
29
30
|
requirements:
|
@@ -34,11 +35,11 @@ dependencies:
|
|
34
35
|
- 0
|
35
36
|
- 9
|
36
37
|
version: "0.9"
|
37
|
-
type: :development
|
38
|
-
name: rake
|
39
38
|
version_requirements: *id001
|
39
|
+
name: rake
|
40
40
|
prerelease: false
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
|
+
type: :development
|
42
43
|
requirement: &id002 !ruby/object:Gem::Requirement
|
43
44
|
none: false
|
44
45
|
requirements:
|
@@ -50,11 +51,11 @@ dependencies:
|
|
50
51
|
- 8
|
51
52
|
- 3
|
52
53
|
version: 1.8.3
|
53
|
-
type: :development
|
54
|
-
name: jeweler
|
55
54
|
version_requirements: *id002
|
55
|
+
name: jeweler
|
56
56
|
prerelease: false
|
57
57
|
- !ruby/object:Gem::Dependency
|
58
|
+
type: :development
|
58
59
|
requirement: &id003 !ruby/object:Gem::Requirement
|
59
60
|
none: false
|
60
61
|
requirements:
|
@@ -65,11 +66,11 @@ dependencies:
|
|
65
66
|
- 1
|
66
67
|
- 0
|
67
68
|
version: "1.0"
|
68
|
-
type: :development
|
69
|
-
name: right_develop
|
70
69
|
version_requirements: *id003
|
70
|
+
name: right_develop
|
71
71
|
prerelease: false
|
72
72
|
- !ruby/object:Gem::Dependency
|
73
|
+
type: :development
|
73
74
|
requirement: &id004 !ruby/object:Gem::Requirement
|
74
75
|
none: false
|
75
76
|
requirements:
|
@@ -80,11 +81,11 @@ dependencies:
|
|
80
81
|
- 0
|
81
82
|
- 10
|
82
83
|
version: "0.10"
|
83
|
-
type: :development
|
84
|
-
name: ruby-debug
|
85
84
|
version_requirements: *id004
|
85
|
+
name: ruby-debug
|
86
86
|
prerelease: false
|
87
87
|
- !ruby/object:Gem::Dependency
|
88
|
+
type: :development
|
88
89
|
requirement: &id005 !ruby/object:Gem::Requirement
|
89
90
|
none: false
|
90
91
|
requirements:
|
@@ -96,11 +97,11 @@ dependencies:
|
|
96
97
|
- 11
|
97
98
|
- 6
|
98
99
|
version: 0.11.6
|
99
|
-
type: :development
|
100
|
-
name: ruby-debug19
|
101
100
|
version_requirements: *id005
|
101
|
+
name: ruby-debug19
|
102
102
|
prerelease: false
|
103
103
|
- !ruby/object:Gem::Dependency
|
104
|
+
type: :development
|
104
105
|
requirement: &id006 !ruby/object:Gem::Requirement
|
105
106
|
none: false
|
106
107
|
requirements:
|
@@ -112,26 +113,26 @@ dependencies:
|
|
112
113
|
- 4
|
113
114
|
- 2
|
114
115
|
version: 2.4.2
|
115
|
-
type: :development
|
116
|
-
name: rdoc
|
117
116
|
version_requirements: *id006
|
117
|
+
name: rdoc
|
118
118
|
prerelease: false
|
119
119
|
- !ruby/object:Gem::Dependency
|
120
|
+
type: :development
|
120
121
|
requirement: &id007 !ruby/object:Gem::Requirement
|
121
122
|
none: false
|
122
123
|
requirements:
|
123
124
|
- - ~>
|
124
125
|
- !ruby/object:Gem::Version
|
125
|
-
hash:
|
126
|
+
hash: 15
|
126
127
|
segments:
|
128
|
+
- 1
|
127
129
|
- 0
|
128
|
-
|
129
|
-
version: "0.8"
|
130
|
-
type: :development
|
131
|
-
name: flexmock
|
130
|
+
version: "1.0"
|
132
131
|
version_requirements: *id007
|
132
|
+
name: flexmock
|
133
133
|
prerelease: false
|
134
134
|
- !ruby/object:Gem::Dependency
|
135
|
+
type: :development
|
135
136
|
requirement: &id008 !ruby/object:Gem::Requirement
|
136
137
|
none: false
|
137
138
|
requirements:
|
@@ -143,11 +144,11 @@ dependencies:
|
|
143
144
|
- 0
|
144
145
|
- 0
|
145
146
|
version: 1.0.0
|
146
|
-
type: :development
|
147
|
-
name: syntax
|
148
147
|
version_requirements: *id008
|
148
|
+
name: syntax
|
149
149
|
prerelease: false
|
150
150
|
- !ruby/object:Gem::Dependency
|
151
|
+
type: :development
|
151
152
|
requirement: &id009 !ruby/object:Gem::Requirement
|
152
153
|
none: false
|
153
154
|
requirements:
|
@@ -158,9 +159,8 @@ dependencies:
|
|
158
159
|
- 1
|
159
160
|
- 5
|
160
161
|
version: "1.5"
|
161
|
-
type: :development
|
162
|
-
name: nokogiri
|
163
162
|
version_requirements: *id009
|
163
|
+
name: nokogiri
|
164
164
|
prerelease: false
|
165
165
|
description: A toolkit of useful, reusable foundation code created by RightScale.
|
166
166
|
email: support@rightscale.com
|