librato-rails 0.5.1 → 0.5.2
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/librato/rails.rb +1 -1
- data/lib/librato/rails/aggregator.rb +2 -2
- data/lib/librato/rails/counter_cache.rb +1 -1
- data/lib/librato/rails/version.rb +1 -1
- data/test/dummy/config/application.rb +1 -1
- data/test/dummy/db/development.sqlite3 +0 -0
- data/test/dummy/log/development.log +2189 -0
- data/test/dummy/log/test.log +6733 -139
- data/test/dummy/test_env.sh +2 -0
- data/test/dummy/tmp/cache/assets/CD8/370/sprockets%2F357970feca3ac29060c1e3861e2c0953 +0 -0
- data/test/dummy/tmp/cache/assets/CDF/870/sprockets%2Fb878faf942403e313a5b103e5d80488e +0 -0
- data/test/dummy/tmp/cache/assets/CE8/7E0/sprockets%2F178e2a1f9aa891d473009c7f3095df28 +0 -0
- data/test/dummy/tmp/cache/assets/CF9/7C0/sprockets%2F40fc2f3d2a468a00e463f1d313cb1683 +0 -0
- data/test/dummy/tmp/cache/assets/D04/890/sprockets%2F587335c079eef8d5a63784fc8f99905a +0 -0
- data/test/dummy/tmp/cache/assets/D05/D40/sprockets%2F1c9faaf28d05409b88ad3113374d613c +0 -0
- data/test/dummy/tmp/cache/assets/D11/D90/sprockets%2Ff688bee5b15ad322749fd06432065df2 +0 -0
- data/test/dummy/tmp/cache/assets/D32/A10/sprockets%2F13fe41fee1fe35b49d145bcc06610705 +0 -0
- data/test/dummy/tmp/cache/assets/D48/6E0/sprockets%2F3d5dd928c45756c99bb1018cdbba7485 +0 -0
- data/test/dummy/tmp/cache/assets/D4E/1B0/sprockets%2Ff7cbd26ba1d28d48de824f0e94586655 +0 -0
- data/test/dummy/tmp/cache/assets/D4F/000/sprockets%2F25e44896aac12384727e9dab827ebef9 +0 -0
- data/test/dummy/tmp/cache/assets/D5A/EA0/sprockets%2Fd771ace226fc8215a3572e0aa35bb0d6 +0 -0
- data/test/dummy/tmp/cache/assets/D66/890/sprockets%2F789354d3ec91e1ba6c8e92878d8f6ff8 +0 -0
- data/test/dummy/tmp/cache/assets/D84/000/sprockets%2F2ed60caa8412eb8334fe327cab12cb32 +0 -0
- data/test/dummy/tmp/cache/assets/D8B/F90/sprockets%2Ffe6ce696e9141eb755d8eed79128e17c +0 -0
- data/test/dummy/tmp/cache/assets/D98/8B0/sprockets%2Fedbef6e0d0a4742346cf479f2c522eb0 +0 -0
- data/test/dummy/tmp/cache/assets/DDC/400/sprockets%2Fcffd775d018f68ce5dba1ee0d951a994 +0 -0
- data/test/dummy/tmp/cache/assets/E04/890/sprockets%2F2f5173deea6c795b8fdde723bb4b63af +0 -0
- data/test/remote/rails_remote_test.rb +27 -2
- metadata +48 -6
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
@@ -19,6 +19,10 @@ class LibratoRailsRemoteTest < ActiveSupport::TestCase
|
|
19
19
|
end
|
20
20
|
Librato::Rails.delete_all
|
21
21
|
end
|
22
|
+
|
23
|
+
teardown do
|
24
|
+
Librato::Rails.prefix = nil
|
25
|
+
end
|
22
26
|
|
23
27
|
test 'flush sends counters' do
|
24
28
|
delete_all_metrics
|
@@ -43,11 +47,11 @@ class LibratoRailsRemoteTest < ActiveSupport::TestCase
|
|
43
47
|
assert_equal 2, bar[source][0]['value']
|
44
48
|
end
|
45
49
|
|
46
|
-
test 'counters should
|
50
|
+
test 'counters should persist through flush' do
|
47
51
|
Librato::Rails.increment 'knightrider'
|
48
52
|
assert_equal 1, Librato::Rails.counters['knightrider']
|
49
53
|
Librato::Rails.flush
|
50
|
-
assert_equal
|
54
|
+
assert_equal 0, Librato::Rails.counters['knightrider']
|
51
55
|
end
|
52
56
|
|
53
57
|
test 'flush sends measures/timings' do
|
@@ -89,6 +93,27 @@ class LibratoRailsRemoteTest < ActiveSupport::TestCase
|
|
89
93
|
|
90
94
|
assert_equal [], Librato::Rails.client.list
|
91
95
|
end
|
96
|
+
|
97
|
+
test 'flush respects prefix' do
|
98
|
+
delete_all_metrics
|
99
|
+
source = Librato::Rails.qualified_source
|
100
|
+
Librato::Rails.prefix = 'testyprefix'
|
101
|
+
|
102
|
+
Librato::Rails.timing 'mytime', 221.1
|
103
|
+
Librato::Rails.increment 'mycount', 4
|
104
|
+
Librato::Rails.flush
|
105
|
+
|
106
|
+
client = Librato::Rails.client
|
107
|
+
metric_names = client.list.map { |m| m['name'] }
|
108
|
+
assert metric_names.include?('testyprefix.mytime'), 'testyprefix.mytime should be present'
|
109
|
+
assert metric_names.include?('testyprefix.mycount'), 'testyprefix.mycount should be present'
|
110
|
+
|
111
|
+
mytime = client.fetch 'testyprefix.mytime', :count => 10
|
112
|
+
assert_equal 1, mytime[source][0]['count']
|
113
|
+
|
114
|
+
mycount = client.fetch 'testyprefix.mycount', :count => 10
|
115
|
+
assert_equal 4, mycount[source][0]['value']
|
116
|
+
end
|
92
117
|
|
93
118
|
private
|
94
119
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: librato-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-10-
|
12
|
+
date: 2012-10-08 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|
@@ -34,7 +34,7 @@ dependencies:
|
|
34
34
|
requirements:
|
35
35
|
- - ~>
|
36
36
|
- !ruby/object:Gem::Version
|
37
|
-
version: 0.7.
|
37
|
+
version: 0.7.2
|
38
38
|
type: :runtime
|
39
39
|
prerelease: false
|
40
40
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -42,7 +42,7 @@ dependencies:
|
|
42
42
|
requirements:
|
43
43
|
- - ~>
|
44
44
|
- !ruby/object:Gem::Version
|
45
|
-
version: 0.7.
|
45
|
+
version: 0.7.2
|
46
46
|
- !ruby/object:Gem::Dependency
|
47
47
|
name: sqlite3
|
48
48
|
requirement: !ruby/object:Gem::Requirement
|
@@ -135,9 +135,11 @@ files:
|
|
135
135
|
- test/dummy/config/routes.rb
|
136
136
|
- test/dummy/config/unicorn.rb
|
137
137
|
- test/dummy/config.ru
|
138
|
+
- test/dummy/db/development.sqlite3
|
138
139
|
- test/dummy/db/migrate/20120719231810_create_users.rb
|
139
140
|
- test/dummy/db/schema.rb
|
140
141
|
- test/dummy/db/test.sqlite3
|
142
|
+
- test/dummy/log/development.log
|
141
143
|
- test/dummy/log/test.log
|
142
144
|
- test/dummy/public/404.html
|
143
145
|
- test/dummy/public/422.html
|
@@ -146,6 +148,25 @@ files:
|
|
146
148
|
- test/dummy/Rakefile
|
147
149
|
- test/dummy/README.rdoc
|
148
150
|
- test/dummy/script/rails
|
151
|
+
- test/dummy/test_env.sh
|
152
|
+
- test/dummy/tmp/cache/assets/CD8/370/sprockets%2F357970feca3ac29060c1e3861e2c0953
|
153
|
+
- test/dummy/tmp/cache/assets/CDF/870/sprockets%2Fb878faf942403e313a5b103e5d80488e
|
154
|
+
- test/dummy/tmp/cache/assets/CE8/7E0/sprockets%2F178e2a1f9aa891d473009c7f3095df28
|
155
|
+
- test/dummy/tmp/cache/assets/CF9/7C0/sprockets%2F40fc2f3d2a468a00e463f1d313cb1683
|
156
|
+
- test/dummy/tmp/cache/assets/D04/890/sprockets%2F587335c079eef8d5a63784fc8f99905a
|
157
|
+
- test/dummy/tmp/cache/assets/D05/D40/sprockets%2F1c9faaf28d05409b88ad3113374d613c
|
158
|
+
- test/dummy/tmp/cache/assets/D11/D90/sprockets%2Ff688bee5b15ad322749fd06432065df2
|
159
|
+
- test/dummy/tmp/cache/assets/D32/A10/sprockets%2F13fe41fee1fe35b49d145bcc06610705
|
160
|
+
- test/dummy/tmp/cache/assets/D48/6E0/sprockets%2F3d5dd928c45756c99bb1018cdbba7485
|
161
|
+
- test/dummy/tmp/cache/assets/D4E/1B0/sprockets%2Ff7cbd26ba1d28d48de824f0e94586655
|
162
|
+
- test/dummy/tmp/cache/assets/D4F/000/sprockets%2F25e44896aac12384727e9dab827ebef9
|
163
|
+
- test/dummy/tmp/cache/assets/D5A/EA0/sprockets%2Fd771ace226fc8215a3572e0aa35bb0d6
|
164
|
+
- test/dummy/tmp/cache/assets/D66/890/sprockets%2F789354d3ec91e1ba6c8e92878d8f6ff8
|
165
|
+
- test/dummy/tmp/cache/assets/D84/000/sprockets%2F2ed60caa8412eb8334fe327cab12cb32
|
166
|
+
- test/dummy/tmp/cache/assets/D8B/F90/sprockets%2Ffe6ce696e9141eb755d8eed79128e17c
|
167
|
+
- test/dummy/tmp/cache/assets/D98/8B0/sprockets%2Fedbef6e0d0a4742346cf479f2c522eb0
|
168
|
+
- test/dummy/tmp/cache/assets/DDC/400/sprockets%2Fcffd775d018f68ce5dba1ee0d951a994
|
169
|
+
- test/dummy/tmp/cache/assets/E04/890/sprockets%2F2f5173deea6c795b8fdde723bb4b63af
|
149
170
|
- test/fixtures/config/librato.yml
|
150
171
|
- test/integration/custom_test.rb
|
151
172
|
- test/integration/mail_test.rb
|
@@ -175,7 +196,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
175
196
|
version: '0'
|
176
197
|
segments:
|
177
198
|
- 0
|
178
|
-
hash:
|
199
|
+
hash: 1496276957323870941
|
179
200
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
180
201
|
none: false
|
181
202
|
requirements:
|
@@ -184,7 +205,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
184
205
|
version: '0'
|
185
206
|
segments:
|
186
207
|
- 0
|
187
|
-
hash:
|
208
|
+
hash: 1496276957323870941
|
188
209
|
requirements: []
|
189
210
|
rubyforge_project:
|
190
211
|
rubygems_version: 1.8.24
|
@@ -229,9 +250,11 @@ test_files:
|
|
229
250
|
- test/dummy/config/routes.rb
|
230
251
|
- test/dummy/config/unicorn.rb
|
231
252
|
- test/dummy/config.ru
|
253
|
+
- test/dummy/db/development.sqlite3
|
232
254
|
- test/dummy/db/migrate/20120719231810_create_users.rb
|
233
255
|
- test/dummy/db/schema.rb
|
234
256
|
- test/dummy/db/test.sqlite3
|
257
|
+
- test/dummy/log/development.log
|
235
258
|
- test/dummy/log/test.log
|
236
259
|
- test/dummy/public/404.html
|
237
260
|
- test/dummy/public/422.html
|
@@ -240,6 +263,25 @@ test_files:
|
|
240
263
|
- test/dummy/Rakefile
|
241
264
|
- test/dummy/README.rdoc
|
242
265
|
- test/dummy/script/rails
|
266
|
+
- test/dummy/test_env.sh
|
267
|
+
- test/dummy/tmp/cache/assets/CD8/370/sprockets%2F357970feca3ac29060c1e3861e2c0953
|
268
|
+
- test/dummy/tmp/cache/assets/CDF/870/sprockets%2Fb878faf942403e313a5b103e5d80488e
|
269
|
+
- test/dummy/tmp/cache/assets/CE8/7E0/sprockets%2F178e2a1f9aa891d473009c7f3095df28
|
270
|
+
- test/dummy/tmp/cache/assets/CF9/7C0/sprockets%2F40fc2f3d2a468a00e463f1d313cb1683
|
271
|
+
- test/dummy/tmp/cache/assets/D04/890/sprockets%2F587335c079eef8d5a63784fc8f99905a
|
272
|
+
- test/dummy/tmp/cache/assets/D05/D40/sprockets%2F1c9faaf28d05409b88ad3113374d613c
|
273
|
+
- test/dummy/tmp/cache/assets/D11/D90/sprockets%2Ff688bee5b15ad322749fd06432065df2
|
274
|
+
- test/dummy/tmp/cache/assets/D32/A10/sprockets%2F13fe41fee1fe35b49d145bcc06610705
|
275
|
+
- test/dummy/tmp/cache/assets/D48/6E0/sprockets%2F3d5dd928c45756c99bb1018cdbba7485
|
276
|
+
- test/dummy/tmp/cache/assets/D4E/1B0/sprockets%2Ff7cbd26ba1d28d48de824f0e94586655
|
277
|
+
- test/dummy/tmp/cache/assets/D4F/000/sprockets%2F25e44896aac12384727e9dab827ebef9
|
278
|
+
- test/dummy/tmp/cache/assets/D5A/EA0/sprockets%2Fd771ace226fc8215a3572e0aa35bb0d6
|
279
|
+
- test/dummy/tmp/cache/assets/D66/890/sprockets%2F789354d3ec91e1ba6c8e92878d8f6ff8
|
280
|
+
- test/dummy/tmp/cache/assets/D84/000/sprockets%2F2ed60caa8412eb8334fe327cab12cb32
|
281
|
+
- test/dummy/tmp/cache/assets/D8B/F90/sprockets%2Ffe6ce696e9141eb755d8eed79128e17c
|
282
|
+
- test/dummy/tmp/cache/assets/D98/8B0/sprockets%2Fedbef6e0d0a4742346cf479f2c522eb0
|
283
|
+
- test/dummy/tmp/cache/assets/DDC/400/sprockets%2Fcffd775d018f68ce5dba1ee0d951a994
|
284
|
+
- test/dummy/tmp/cache/assets/E04/890/sprockets%2F2f5173deea6c795b8fdde723bb4b63af
|
243
285
|
- test/fixtures/config/librato.yml
|
244
286
|
- test/integration/custom_test.rb
|
245
287
|
- test/integration/mail_test.rb
|