librato-rack 1.0.1 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/CHANGELOG.md +3 -0
- data/lib/librato/collector/counter_cache.rb +3 -2
- data/lib/librato/rack/version.rb +1 -1
- data/test/integration/no_stats_test.rb +5 -5
- data/test/integration/no_suites_test.rb +1 -1
- data/test/integration/request_test.rb +2 -2
- data/test/integration/suites_test.rb +6 -6
- data/test/remote/tracker_test.rb +1 -1
- data/test/unit/collector/aggregator_test.rb +1 -1
- data/test/unit/collector/counter_cache_test.rb +3 -3
- data/test/unit/rack/configuration_test.rb +2 -2
- metadata +21 -20
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7b2e81e09050e4d9b1f448806ec43c19314de09a
|
4
|
+
data.tar.gz: 4d6a014870df60b95a7fedc4efda0a5a96bf3a50
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cd329d855d6dcf6036e3f685c9e7ba29276ef731415de1674ac77df9a3dc91e05afd606917f36da2a0d1b1ab38d580af738af94c528d6287115e618a0bf914af
|
7
|
+
data.tar.gz: 42bf488009d6868df5227720d320dd9c6b0bd3ab8de15db4ee28f5e5fed7a2c1efd9781cf1463483cbfe0cb11ded77cf9268057b6df1131986f40549cbf99cbf
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/CHANGELOG.md
CHANGED
@@ -5,6 +5,7 @@ module Librato
|
|
5
5
|
#
|
6
6
|
class CounterCache
|
7
7
|
SEPARATOR = '%%'
|
8
|
+
INTEGER_CLASS = 1.class
|
8
9
|
|
9
10
|
extend Forwardable
|
10
11
|
|
@@ -74,7 +75,7 @@ module Librato
|
|
74
75
|
# increment :foo, :source => user.id
|
75
76
|
#
|
76
77
|
def increment(counter, options={})
|
77
|
-
if options.is_a?(
|
78
|
+
if options.is_a?(INTEGER_CLASS)
|
78
79
|
# suppport legacy style
|
79
80
|
options = {by: options}
|
80
81
|
end
|
@@ -110,4 +111,4 @@ module Librato
|
|
110
111
|
end
|
111
112
|
|
112
113
|
end
|
113
|
-
end
|
114
|
+
end
|
data/lib/librato/rack/version.rb
CHANGED
@@ -20,16 +20,16 @@ class NoStatsTest < Minitest::Test
|
|
20
20
|
get '/'
|
21
21
|
assert last_response.ok?
|
22
22
|
|
23
|
-
|
24
|
-
|
25
|
-
|
23
|
+
assert_nil counters["rack.request.total"]
|
24
|
+
assert_nil counters["rack.request.status.200"]
|
25
|
+
assert_nil counters["rack.request.status.2xx"]
|
26
26
|
end
|
27
27
|
|
28
28
|
def test_no_standard_measures
|
29
29
|
get '/'
|
30
30
|
assert last_response.ok?
|
31
31
|
|
32
|
-
|
32
|
+
assert_nil aggregate["rack.request.time"]
|
33
33
|
end
|
34
34
|
|
35
35
|
def test_dont_track_exceptions
|
@@ -38,7 +38,7 @@ class NoStatsTest < Minitest::Test
|
|
38
38
|
rescue RuntimeError => e
|
39
39
|
raise unless e.message == 'exception raised!'
|
40
40
|
end
|
41
|
-
|
41
|
+
assert_nil counters["rack.request.exceptions"]
|
42
42
|
end
|
43
43
|
|
44
44
|
private
|
@@ -37,8 +37,8 @@ class RequestTest < Minitest::Test
|
|
37
37
|
assert_equal 1, aggregate["rack.request.time"][:count],
|
38
38
|
'should track total request time'
|
39
39
|
|
40
|
-
# should
|
41
|
-
|
40
|
+
# should calculate p95 value
|
41
|
+
assert aggregate.fetch("rack.request.time", percentile: 95) > 0.0
|
42
42
|
|
43
43
|
# status specific
|
44
44
|
assert_equal 1, aggregate["rack.request.status.200.time"][:count]
|
@@ -25,14 +25,14 @@ class SuitesTest < Minitest::Test
|
|
25
25
|
assert_equal 1, aggregate["rack.request.time"][:count]
|
26
26
|
|
27
27
|
# rack.request.method metrics (rack_method suite) should not get logged
|
28
|
-
|
29
|
-
|
28
|
+
assert_nil counters['rack.request.method.get']
|
29
|
+
assert_nil aggregate['rack.request.method.get.time']
|
30
30
|
|
31
31
|
# rack.request.status metrics (rack_status suite) should not get logged
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
32
|
+
assert_nil counters["rack.request.status.200"]
|
33
|
+
assert_nil counters["rack.request.status.2xx"]
|
34
|
+
assert_nil counters["rack.request.status.200.time"]
|
35
|
+
assert_nil counters["rack.request.status.2xx.time"]
|
36
36
|
end
|
37
37
|
|
38
38
|
private
|
data/test/remote/tracker_test.rb
CHANGED
@@ -58,7 +58,7 @@ class TrackerRemoteTest < Minitest::Test
|
|
58
58
|
|
59
59
|
tracker.flush
|
60
60
|
assert_equal 0, collector.counters['knightrider']
|
61
|
-
|
61
|
+
assert_nil collector.counters['badguys']
|
62
62
|
end
|
63
63
|
|
64
64
|
def test_flush_should_send_measures_and_timings
|
@@ -60,8 +60,8 @@ module Librato
|
|
60
60
|
assert_equal 0, cc.fetch(:foo, :source => 'bar')
|
61
61
|
|
62
62
|
# sporadic do not
|
63
|
-
|
64
|
-
|
63
|
+
assert_nil cc[:baz]
|
64
|
+
assert_nil cc.fetch(:baz, :source => 118)
|
65
65
|
|
66
66
|
# add a different sporadic metric
|
67
67
|
cc.increment :bazoom, :sporadic => true
|
@@ -69,7 +69,7 @@ module Librato
|
|
69
69
|
|
70
70
|
# persist values again
|
71
71
|
cc.flush_to(Librato::Metrics::Queue.new)
|
72
|
-
|
72
|
+
assert_nil cc[:bazoom]
|
73
73
|
end
|
74
74
|
|
75
75
|
def test_flushing
|
@@ -55,7 +55,7 @@ module Librato
|
|
55
55
|
|
56
56
|
def test_event_mode
|
57
57
|
config = Configuration.new
|
58
|
-
|
58
|
+
assert_nil config.event_mode
|
59
59
|
|
60
60
|
config.event_mode = :synchrony
|
61
61
|
assert_equal :synchrony, config.event_mode
|
@@ -67,7 +67,7 @@ module Librato
|
|
67
67
|
# handle invalid
|
68
68
|
config2 = Configuration.new
|
69
69
|
config2.event_mode = 'fooballoo'
|
70
|
-
|
70
|
+
assert_nil config2.event_mode
|
71
71
|
|
72
72
|
# env detection
|
73
73
|
ENV['LIBRATO_EVENT_MODE'] = 'eventmachine'
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: librato-rack
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matt Sanders
|
@@ -10,26 +10,26 @@ bindir: bin
|
|
10
10
|
cert_chain:
|
11
11
|
- |
|
12
12
|
-----BEGIN CERTIFICATE-----
|
13
|
-
|
13
|
+
MIIDLjCCAhagAwIBAgIBADANBgkqhkiG9w0BAQUFADA9MQ0wCwYDVQQDDARydWJ5
|
14
14
|
MRcwFQYKCZImiZPyLGQBGRYHbGlicmF0bzETMBEGCgmSJomT8ixkARkWA2NvbTAe
|
15
|
-
|
15
|
+
Fw0xNzAxMTExODI3MDdaFw0xODAxMTExODI3MDdaMD0xDTALBgNVBAMMBHJ1Ynkx
|
16
16
|
FzAVBgoJkiaJk/IsZAEZFgdsaWJyYXRvMRMwEQYKCZImiZPyLGQBGRYDY29tMIIB
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
+
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
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
31
|
-----END CERTIFICATE-----
|
32
|
-
date:
|
32
|
+
date: 2017-01-11 00:00:00.000000000 Z
|
33
33
|
dependencies:
|
34
34
|
- !ruby/object:Gem::Dependency
|
35
35
|
name: librato-metrics
|
@@ -77,6 +77,7 @@ description: Rack middleware to report key app statistics and custom instrumenta
|
|
77
77
|
to the Librato Metrics service.
|
78
78
|
email:
|
79
79
|
- matt@librato.com
|
80
|
+
- ruby@librato.com
|
80
81
|
executables: []
|
81
82
|
extensions: []
|
82
83
|
extra_rdoc_files: []
|
@@ -125,7 +126,7 @@ files:
|
|
125
126
|
- test/unit/rack/worker_test.rb
|
126
127
|
homepage: https://github.com/librato/librato-rack
|
127
128
|
licenses:
|
128
|
-
- BSD
|
129
|
+
- BSD-3-Clause
|
129
130
|
metadata: {}
|
130
131
|
post_install_message:
|
131
132
|
rdoc_options: []
|
@@ -143,7 +144,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
143
144
|
version: '0'
|
144
145
|
requirements: []
|
145
146
|
rubyforge_project:
|
146
|
-
rubygems_version: 2.
|
147
|
+
rubygems_version: 2.6.8
|
147
148
|
signing_key:
|
148
149
|
specification_version: 4
|
149
150
|
summary: Use Librato Metrics with your rack application
|
metadata.gz.sig
CHANGED
Binary file
|