rack-graphite 1.3.0 → 1.4.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 +8 -8
- data/lib/rack/graphite.rb +1 -1
- data/lib/rack/graphite/version.rb +1 -1
- data/rack-graphite.gemspec +1 -1
- data/spec/graphite_spec.rb +6 -6
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
ODQ0N2I5MjJjMTM5NTMwNmY4NTZjNzhmMTRjZThlZTQ2NzRmYTUxNw==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
ZjIxZmE5YzcyMzY4NmMwNjJlNzU1NTE3M2EyYzYxMjA2YmVkYmRlYw==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
N2E4N2ViYjkwMTZjMmM1MjI2MmJhYzI3ZDM5ZDE4MTA1ZWU0ZWIzOTFmMzYw
|
10
|
+
ZGVlM2I4YjFjYjI3NDYzOTEzNTUyMGM0Yzg4ZmMyOGY5YjczNDkxZmMxOTA3
|
11
|
+
YzNjZjhiZTJjNjkzMWRjZWYyY2Q3N2MxMjMxZDUyYmRlNzlkMGQ=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
ZTc5MDg3YmU0YjMyZjg5YmU1ZTZlYTE0ZWM4MGVjOWU2OWMzN2JkNGNhNzBl
|
14
|
+
MzM1ZDhiMDhlMGU4ZmEwMzk4NDc5ZTk5YjA5ODU2MTNkNWJmYTUxODczMzRm
|
15
|
+
N2Q2YWU5ZDQzZjAzMzE3MjcwNWE0NGQzOWVlZDg4Y2E0ZDEyYjI=
|
data/lib/rack/graphite.rb
CHANGED
@@ -19,7 +19,7 @@ module Rack
|
|
19
19
|
metric = path_to_graphite(method, path)
|
20
20
|
|
21
21
|
status, headers, body = nil
|
22
|
-
Lookout::Statsd.instance.
|
22
|
+
Lookout::Statsd.instance.time(metric) do
|
23
23
|
status, headers, body = @app.call(env)
|
24
24
|
end
|
25
25
|
Lookout::Statsd.instance.increment("#{metric}.response.#{status}")
|
data/rack-graphite.gemspec
CHANGED
data/spec/graphite_spec.rb
CHANGED
@@ -83,8 +83,8 @@ describe Rack::Graphite do
|
|
83
83
|
subject(:middleware) { described_class.new(app) }
|
84
84
|
|
85
85
|
before :each do
|
86
|
-
# Stub out
|
87
|
-
statsd.stub(:
|
86
|
+
# Stub out time by default to and just yield
|
87
|
+
statsd.stub(:time).and_yield
|
88
88
|
statsd.stub(:increment)
|
89
89
|
end
|
90
90
|
|
@@ -109,7 +109,7 @@ describe Rack::Graphite do
|
|
109
109
|
end
|
110
110
|
|
111
111
|
it 'should invoke a timer' do
|
112
|
-
statsd.should_receive(:
|
112
|
+
statsd.should_receive(:time)
|
113
113
|
middleware.call({})
|
114
114
|
end
|
115
115
|
end
|
@@ -122,7 +122,7 @@ describe Rack::Graphite do
|
|
122
122
|
|
123
123
|
context 'with a root request' do
|
124
124
|
before :each do
|
125
|
-
statsd.should_receive(:
|
125
|
+
statsd.should_receive(:time).with('requests.get.root').and_yield
|
126
126
|
statsd.should_receive(:increment).with('requests.get.root.response.200')
|
127
127
|
get '/'
|
128
128
|
end
|
@@ -131,7 +131,7 @@ describe Rack::Graphite do
|
|
131
131
|
|
132
132
|
context 'with a request with query params' do
|
133
133
|
before :each do
|
134
|
-
statsd.should_receive(:
|
134
|
+
statsd.should_receive(:time).with('requests.get.onelevel').and_yield
|
135
135
|
statsd.should_receive(:increment).with('requests.get.onelevel.response.200')
|
136
136
|
get '/onelevel?q=foo'
|
137
137
|
end
|
@@ -140,7 +140,7 @@ describe Rack::Graphite do
|
|
140
140
|
|
141
141
|
context 'with a PUT request' do
|
142
142
|
before :each do
|
143
|
-
statsd.should_receive(:
|
143
|
+
statsd.should_receive(:time).with('requests.put.onelevel').and_yield
|
144
144
|
statsd.should_receive(:increment).with('requests.put.onelevel.response.200')
|
145
145
|
put '/onelevel'
|
146
146
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rack-graphite
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- R. Tyler Croy
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-07-
|
11
|
+
date: 2016-07-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -30,14 +30,14 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - ~>
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '3.
|
33
|
+
version: '3.1'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - ~>
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '3.
|
40
|
+
version: '3.1'
|
41
41
|
description: Simple Rack middleware for logging request counts/timing information
|
42
42
|
email:
|
43
43
|
- rtyler.croy@lookout.com
|