librato-rack 2.0.3 → 2.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/librato/rack.rb +1 -1
- data/lib/librato/rack/version.rb +1 -1
- data/test/integration/queue_wait_test.rb +11 -12
- data/test/integration/request_test.rb +7 -0
- metadata +30 -44
- checksums.yaml.gz.sig +0 -2
- data.tar.gz.sig +0 -2
- metadata.gz.sig +0 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 486a5fc1c305930b8c60e71454c762936ce7d708
|
4
|
+
data.tar.gz: b6b876efe328ce7b4b45318c54cff89857f78bdf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c1542c83e18eaadd2c555161ecdddfa83f2e63377fd4bc0b33b87693860f9088602ae04ae579e8fc318a3ac810f8ae5f08e1a3cf98ddd710d8a18906db98a90d
|
7
|
+
data.tar.gz: bfcae24e6b77da4644cabf0a7f8217ef681ba1ada3a8ebc9a757c447330f8c2f998a661ca7fd7c70437b29bac8d17cdfff0b345860267d8e3d28e05f4de650ab
|
data/lib/librato/rack.rb
CHANGED
@@ -50,7 +50,7 @@ module Librato
|
|
50
50
|
EOS
|
51
51
|
|
52
52
|
RECORD_RACK_METHOD_BODY = <<-'EOS'
|
53
|
-
method_tags = { method: http_method.downcase
|
53
|
+
method_tags = { method: http_method.downcase }
|
54
54
|
tracker.increment "rack.request.method", tags: method_tags, inherit_tags: true
|
55
55
|
tracker.timing "rack.request.method.time", duration, tags: method_tags, inherit_tags: true
|
56
56
|
EOS
|
data/lib/librato/rack/version.rb
CHANGED
@@ -19,19 +19,25 @@ class QueueWaitTest < Minitest::Test
|
|
19
19
|
def test_milliseconds
|
20
20
|
get '/milli'
|
21
21
|
|
22
|
+
# give jruby a bit more time since it can be slow
|
23
|
+
delta = defined?(JRUBY_VERSION) ? 5 : 4
|
24
|
+
|
22
25
|
# puts "milli: #{aggregate["rack.request.queue.time"].inspect}"
|
23
26
|
assert_equal 1, aggregate["rack.request.queue.time"][:count],
|
24
27
|
'should track total queue time'
|
25
|
-
assert_in_delta 5, aggregate["rack.request.queue.time"][:sum],
|
28
|
+
assert_in_delta 5, aggregate["rack.request.queue.time"][:sum], delta
|
26
29
|
end
|
27
30
|
|
28
31
|
def test_microseconds
|
29
32
|
get '/micro'
|
30
33
|
|
34
|
+
# give jruby a bit more time since it can be slow
|
35
|
+
delta = defined?(JRUBY_VERSION) ? 6 : 4
|
36
|
+
|
31
37
|
# puts "micro: #{aggregate["rack.request.queue.time"].inspect}"
|
32
38
|
assert_equal 1, aggregate["rack.request.queue.time"][:count],
|
33
39
|
'should track total queue time'
|
34
|
-
assert_in_delta 10, aggregate["rack.request.queue.time"][:sum],
|
40
|
+
assert_in_delta 10, aggregate["rack.request.queue.time"][:sum], delta
|
35
41
|
end
|
36
42
|
|
37
43
|
def test_queue_start
|
@@ -46,20 +52,13 @@ class QueueWaitTest < Minitest::Test
|
|
46
52
|
def test_with_t
|
47
53
|
get '/with_t'
|
48
54
|
|
49
|
-
# puts "micro: #{aggregate["rack.request.queue.time"].inspect}"
|
50
|
-
assert_equal 1, aggregate["rack.request.queue.time"][:count],
|
51
|
-
'should track total queue time'
|
52
|
-
assert_in_delta 20, aggregate["rack.request.queue.time"][:sum], 6
|
53
|
-
end
|
54
|
-
|
55
|
-
def test_with_period
|
56
|
-
get '/with_period'
|
57
|
-
|
58
55
|
# give jruby a bit more time since it can be slow
|
59
56
|
delta = defined?(JRUBY_VERSION) ? 10 : 6
|
57
|
+
|
58
|
+
# puts "micro: #{aggregate["rack.request.queue.time"].inspect}"
|
60
59
|
assert_equal 1, aggregate["rack.request.queue.time"][:count],
|
61
60
|
'should track total queue time'
|
62
|
-
assert_in_delta
|
61
|
+
assert_in_delta 20, aggregate["rack.request.queue.time"][:sum], delta
|
63
62
|
end
|
64
63
|
|
65
64
|
def test_with_period
|
@@ -61,6 +61,13 @@ class RequestTest < Minitest::Test
|
|
61
61
|
assert_equal 1, aggregate.fetch("rack.request.method.time", tags: @tags.merge({ method: "post" }))[:count]
|
62
62
|
end
|
63
63
|
|
64
|
+
def test_request_method_not_mutated
|
65
|
+
get '/', {}, {'REQUEST_METHOD' => "GET".freeze}
|
66
|
+
|
67
|
+
assert_equal 1, counters.fetch("rack.request.method", tags: @tags.merge({ method: "GET" }))[:value]
|
68
|
+
assert_equal 1, aggregate.fetch("rack.request.method.time", tags: @tags.merge({ method: "get" }))[:count]
|
69
|
+
end
|
70
|
+
|
64
71
|
def test_track_exceptions
|
65
72
|
begin
|
66
73
|
get '/exception'
|
metadata
CHANGED
@@ -1,41 +1,24 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: librato-rack
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matt Sanders
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain:
|
11
|
-
-
|
12
|
-
|
13
|
-
MIIDLjCCAhagAwIBAgIBADANBgkqhkiG9w0BAQUFADA9MQ0wCwYDVQQDDARydWJ5
|
14
|
-
MRcwFQYKCZImiZPyLGQBGRYHbGlicmF0bzETMBEGCgmSJomT8ixkARkWA2NvbTAe
|
15
|
-
Fw0xNzAxMTExODI3MDdaFw0xODAxMTExODI3MDdaMD0xDTALBgNVBAMMBHJ1Ynkx
|
16
|
-
FzAVBgoJkiaJk/IsZAEZFgdsaWJyYXRvMRMwEQYKCZImiZPyLGQBGRYDY29tMIIB
|
17
|
-
IjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA58LirwsWnKL1uuClQ0uwA1XL
|
18
|
-
GpxDuFzSosipiPkzZY3hiHazC8SHDREZQXlm7ITX/o+dueNoB7dt0BR3RPVipH7V
|
19
|
-
7cvbCUaZNjEXR5Lal6PsmUsbMTrddkvj3e7flmJv+kMj+teeJ7MDeJTU5wXXV9pD
|
20
|
-
ThiCDILJMF5CdP8Jru4rSBOP6RmmzYU+0cN5+5pt9xqrycA+Poo2ZuoUMCMsSBvl
|
21
|
-
PimM3PPvoWTuE41GTn/bLoOVoXQmdwZIbwUSVH8rCDjZSlttOst+xrBw4KG0dYUp
|
22
|
-
2UvEe8iCyqEMQ8fEZ7EXuP2WMVICutFbz8Pt4hIMq+OTnDX+mIfma7GvPaKAFwID
|
23
|
-
AQABozkwNzAJBgNVHRMEAjAAMB0GA1UdDgQWBBQBSxu9Jj4VTrXTpLujPwk9Kzwp
|
24
|
-
2jALBgNVHQ8EBAMCBLAwDQYJKoZIhvcNAQEFBQADggEBACvNsw1pGv72xp3LiDlZ
|
25
|
-
0tphNP/85RcYyJMklslG3tIYblyo71xHW1UbK5ArUK6k0BN43MuDn3pqLJQttVmi
|
26
|
-
bUdA3yYi13GeSrrAMlr4nH8Yt/Bn/XpZGliouJUBwh1BjG6dSj1iuR4/9pt9/LtO
|
27
|
-
QTdIc+07qGspypT0Uh/w/BodEcGuAaZZFlkU9vottTe6wWNnM6hfRExiSIsr+oVe
|
28
|
-
s8s83ObshjuSzjOqS56IBtNlPEL+D6ghjZZLP3lS6l9p70Pcpcl+IcE4veqZmmKC
|
29
|
-
sGepgRclC6UbZh+yQ3alXVghM2qsonAwI/rTNmFJN9kQn6nP9+f1Uf/qZFNcjn4L
|
30
|
-
9bg=
|
31
|
-
-----END CERTIFICATE-----
|
32
|
-
date: 2017-06-23 00:00:00.000000000 Z
|
11
|
+
- certs/librato-public.pem
|
12
|
+
date: 2018-08-07 00:00:00.000000000 Z
|
33
13
|
dependencies:
|
34
14
|
- !ruby/object:Gem::Dependency
|
35
15
|
name: librato-metrics
|
36
16
|
requirement: !ruby/object:Gem::Requirement
|
37
17
|
requirements:
|
38
18
|
- - "~>"
|
19
|
+
- !ruby/object:Gem::Version
|
20
|
+
version: '2.1'
|
21
|
+
- - ">="
|
39
22
|
- !ruby/object:Gem::Version
|
40
23
|
version: 2.1.0
|
41
24
|
type: :runtime
|
@@ -43,6 +26,9 @@ dependencies:
|
|
43
26
|
version_requirements: !ruby/object:Gem::Requirement
|
44
27
|
requirements:
|
45
28
|
- - "~>"
|
29
|
+
- !ruby/object:Gem::Version
|
30
|
+
version: '2.1'
|
31
|
+
- - ">="
|
46
32
|
- !ruby/object:Gem::Version
|
47
33
|
version: 2.1.0
|
48
34
|
- !ruby/object:Gem::Dependency
|
@@ -63,14 +49,14 @@ dependencies:
|
|
63
49
|
name: minitest
|
64
50
|
requirement: !ruby/object:Gem::Requirement
|
65
51
|
requirements:
|
66
|
-
- - "
|
52
|
+
- - "~>"
|
67
53
|
- !ruby/object:Gem::Version
|
68
54
|
version: '0'
|
69
55
|
type: :development
|
70
56
|
prerelease: false
|
71
57
|
version_requirements: !ruby/object:Gem::Requirement
|
72
58
|
requirements:
|
73
|
-
- - "
|
59
|
+
- - "~>"
|
74
60
|
- !ruby/object:Gem::Version
|
75
61
|
version: '0'
|
76
62
|
description: Rack middleware to report key app statistics and custom instrumentation
|
@@ -145,32 +131,32 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
145
131
|
version: '0'
|
146
132
|
requirements: []
|
147
133
|
rubyforge_project:
|
148
|
-
rubygems_version: 2.
|
134
|
+
rubygems_version: 2.6.11
|
149
135
|
signing_key:
|
150
136
|
specification_version: 4
|
151
137
|
summary: Use Librato Metrics with your rack application
|
152
138
|
test_files:
|
153
|
-
- test/
|
154
|
-
- test/apps/custom.ru
|
155
|
-
- test/apps/custom_suites.ru
|
156
|
-
- test/apps/no_stats.ru
|
157
|
-
- test/apps/queue_wait.ru
|
158
|
-
- test/integration/custom_test.rb
|
159
|
-
- test/integration/no_stats_test.rb
|
160
|
-
- test/integration/no_suites_test.rb
|
161
|
-
- test/integration/queue_wait_test.rb
|
162
|
-
- test/integration/request_test.rb
|
163
|
-
- test/integration/suites_test.rb
|
164
|
-
- test/remote/tracker_test.rb
|
165
|
-
- test/support/environment_helpers.rb
|
166
|
-
- test/test_helper.rb
|
167
|
-
- test/unit/collector/aggregator_test.rb
|
139
|
+
- test/unit/collector_test.rb
|
168
140
|
- test/unit/collector/counter_cache_test.rb
|
169
141
|
- test/unit/collector/group_test.rb
|
170
|
-
- test/unit/
|
142
|
+
- test/unit/collector/aggregator_test.rb
|
171
143
|
- test/unit/rack/configuration/suites_test.rb
|
172
|
-
- test/unit/rack/configuration_test.rb
|
173
144
|
- test/unit/rack/logger_test.rb
|
174
145
|
- test/unit/rack/tracker_test.rb
|
175
|
-
- test/unit/rack/
|
146
|
+
- test/unit/rack/configuration_test.rb
|
176
147
|
- test/unit/rack/worker_test.rb
|
148
|
+
- test/unit/rack/validating_queue_test.rb
|
149
|
+
- test/integration/no_stats_test.rb
|
150
|
+
- test/integration/queue_wait_test.rb
|
151
|
+
- test/integration/request_test.rb
|
152
|
+
- test/integration/custom_test.rb
|
153
|
+
- test/integration/no_suites_test.rb
|
154
|
+
- test/integration/suites_test.rb
|
155
|
+
- test/support/environment_helpers.rb
|
156
|
+
- test/test_helper.rb
|
157
|
+
- test/apps/queue_wait.ru
|
158
|
+
- test/apps/custom_suites.ru
|
159
|
+
- test/apps/custom.ru
|
160
|
+
- test/apps/no_stats.ru
|
161
|
+
- test/apps/basic.ru
|
162
|
+
- test/remote/tracker_test.rb
|
checksums.yaml.gz.sig
DELETED
data.tar.gz.sig
DELETED
metadata.gz.sig
DELETED