librato-rack 1.0.1 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 43bcc15e0b037c711de7dc15bc918d476e5efeb4
4
- data.tar.gz: 272c3886d3efe9a35018ce94ab5309006b27b11c
3
+ metadata.gz: 7b2e81e09050e4d9b1f448806ec43c19314de09a
4
+ data.tar.gz: 4d6a014870df60b95a7fedc4efda0a5a96bf3a50
5
5
  SHA512:
6
- metadata.gz: f2bcfbf49e5dd485d1e1121731f9bb0fe6b708c6b8ec156faa7356330b2b840546132489660867d35392497d0b71b41b2115b79496adda9e7cdd17be1e061aad
7
- data.tar.gz: cec27780849819fc168877a2bf07957fb1363803cc460779ed52b40c5c17307bfb4e674951d62ff428be46315603d010800700d10729947dba1b188fa1c0102b
6
+ metadata.gz: cd329d855d6dcf6036e3f685c9e7ba29276ef731415de1674ac77df9a3dc91e05afd606917f36da2a0d1b1ab38d580af738af94c528d6287115e618a0bf914af
7
+ data.tar.gz: 42bf488009d6868df5227720d320dd9c6b0bd3ab8de15db4ee28f5e5fed7a2c1efd9781cf1463483cbfe0cb11ded77cf9268057b6df1131986f40549cbf99cbf
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -1,3 +1,6 @@
1
+ ### Version 1.1.0
2
+ * Fix deprecation warnings in ruby 2.4 (#57, Ben Radler)
3
+
1
4
  ### Version 1.0.1
2
5
  * Fix missing p95 for rack.request.time
3
6
 
@@ -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?(Fixnum)
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
@@ -1,5 +1,5 @@
1
1
  module Librato
2
2
  class Rack
3
- VERSION = "1.0.1"
3
+ VERSION = "1.1.0"
4
4
  end
5
5
  end
@@ -20,16 +20,16 @@ class NoStatsTest < Minitest::Test
20
20
  get '/'
21
21
  assert last_response.ok?
22
22
 
23
- assert_equal nil, counters["rack.request.total"]
24
- assert_equal nil, counters["rack.request.status.200"]
25
- assert_equal nil, counters["rack.request.status.2xx"]
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
- assert_equal nil, aggregate["rack.request.time"]
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
- assert_equal nil, counters["rack.request.exceptions"]
41
+ assert_nil counters["rack.request.exceptions"]
42
42
  end
43
43
 
44
44
  private
@@ -30,7 +30,7 @@ class NoSuitesTest < Minitest::Test
30
30
  def test_track_queue_time
31
31
  get '/'
32
32
  assert last_response.ok?
33
- assert_equal nil, aggregate["rack.request.queue.time"]
33
+ assert_nil aggregate["rack.request.queue.time"]
34
34
  end
35
35
 
36
36
  def test_increment_status
@@ -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 calculte p95 value
41
- refute_equal aggregate.fetch("rack.request.time", percentile: 95), 0.0
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
- assert_equal nil, counters['rack.request.method.get']
29
- assert_equal nil, aggregate['rack.request.method.get.time']
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
- assert_equal nil, counters["rack.request.status.200"]
33
- assert_equal nil, counters["rack.request.status.2xx"]
34
- assert_equal nil, counters["rack.request.status.200.time"]
35
- assert_equal nil, counters["rack.request.status.2xx.time"]
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
@@ -58,7 +58,7 @@ class TrackerRemoteTest < Minitest::Test
58
58
 
59
59
  tracker.flush
60
60
  assert_equal 0, collector.counters['knightrider']
61
- assert_equal nil, collector.counters['badguys']
61
+ assert_nil collector.counters['badguys']
62
62
  end
63
63
 
64
64
  def test_flush_should_send_measures_and_timings
@@ -75,7 +75,7 @@ module Librato
75
75
 
76
76
  def test_return_values
77
77
  simple = @agg.timing 'simple', 20
78
- assert_equal nil, simple
78
+ assert_nil simple
79
79
 
80
80
  timing = @agg.timing 'foo' do
81
81
  sleep 0.1
@@ -60,8 +60,8 @@ module Librato
60
60
  assert_equal 0, cc.fetch(:foo, :source => 'bar')
61
61
 
62
62
  # sporadic do not
63
- assert_equal nil, cc[:baz]
64
- assert_equal nil, cc.fetch(:baz, :source => 118)
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
- assert_equal nil, cc[:bazoom]
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
- assert_equal nil, config.event_mode
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
- assert_equal nil, config2.event_mode
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.1
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
- MIIDLjCCAhagAwIBAgIBADANBgkqhkiG9w0BAQUFADA9MQ0wCwYDVQQDDARtYXR0
13
+ MIIDLjCCAhagAwIBAgIBADANBgkqhkiG9w0BAQUFADA9MQ0wCwYDVQQDDARydWJ5
14
14
  MRcwFQYKCZImiZPyLGQBGRYHbGlicmF0bzETMBEGCgmSJomT8ixkARkWA2NvbTAe
15
- Fw0xNTEwMTIyMjA0MzVaFw0xNjEwMTEyMjA0MzVaMD0xDTALBgNVBAMMBG1hdHQx
15
+ Fw0xNzAxMTExODI3MDdaFw0xODAxMTExODI3MDdaMD0xDTALBgNVBAMMBHJ1Ynkx
16
16
  FzAVBgoJkiaJk/IsZAEZFgdsaWJyYXRvMRMwEQYKCZImiZPyLGQBGRYDY29tMIIB
17
- IjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA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ru4rSBOP6RmmzYU+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: 2016-08-12 00:00:00.000000000 Z
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 3-clause
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.4.5.1
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