formatted-metrics 1.1.2 → 1.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/lib/faraday/instrumentation.rb +2 -2
- data/lib/metrics/version.rb +1 -1
- data/spec/faraday/instrumentation_spec.rb +10 -1
- metadata +7 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
!binary "U0hBMQ==":
|
3
|
+
metadata.gz: 1ed386b390da64c2b40decaab4367307fc1ef17f
|
4
|
+
data.tar.gz: 1f9ba0fb3a7294d7fd91ffdfd3cd575969f36302
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3ccaa74fa9a04e5a1d5067b60e780a45b9e88c9ad38ebb2cc993e818e44416f1aeaaf09952619d5ad4206a940374c9206f9c4190e7db5cc6b540f052aa0e805b
|
7
|
+
data.tar.gz: 705fdc6207ce6e6ba9921f7892182d44284603efc4546dd7784b8a4ae2f5cc775c37900c52071b614528b01c41918c3ed817da1017d1cf552b324e1cfea3e683
|
@@ -7,7 +7,7 @@ module Faraday
|
|
7
7
|
|
8
8
|
def initialize(app, options = {})
|
9
9
|
super(app)
|
10
|
-
@options = { metric: 'faraday.request' }.merge(options)
|
10
|
+
@options = { metric: 'faraday.request', path: false }.merge(options)
|
11
11
|
end
|
12
12
|
|
13
13
|
def call(env)
|
@@ -25,7 +25,7 @@ module Faraday
|
|
25
25
|
|
26
26
|
def source(env)
|
27
27
|
method = env[:method]
|
28
|
-
path = env[:url].path.gsub(/\//, '.')
|
28
|
+
path = options[:path] ? env[:url].path.gsub(/\//, '.') : ''
|
29
29
|
"#{method}#{path}"
|
30
30
|
end
|
31
31
|
|
data/lib/metrics/version.rb
CHANGED
@@ -14,8 +14,17 @@ describe Faraday::Instrumentation do
|
|
14
14
|
end
|
15
15
|
|
16
16
|
it 'sets the source' do
|
17
|
-
Metrics.should_receive(:group).with('faraday.request', source: 'get
|
17
|
+
Metrics.should_receive(:group).with('faraday.request', source: 'get').and_call_original
|
18
18
|
expect(middleware.call(method: :get, url: uri)).to eq response
|
19
19
|
end
|
20
|
+
|
21
|
+
describe 'with path: true' do
|
22
|
+
let(:middleware) { described_class.new(app, path: true) }
|
23
|
+
|
24
|
+
it 'includes the path in the source' do
|
25
|
+
Metrics.should_receive(:group).with('faraday.request', source: 'get.v1.foo').and_call_original
|
26
|
+
expect(middleware.call(method: :get, url: uri)).to eq response
|
27
|
+
end
|
28
|
+
end
|
20
29
|
end
|
21
30
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: formatted-metrics
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Eric J. Holmes
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-08-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -28,14 +28,14 @@ dependencies:
|
|
28
28
|
name: rake
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - '>='
|
31
|
+
- - ! '>='
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '0'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- - '>='
|
38
|
+
- - ! '>='
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
@@ -115,17 +115,17 @@ require_paths:
|
|
115
115
|
- lib
|
116
116
|
required_ruby_version: !ruby/object:Gem::Requirement
|
117
117
|
requirements:
|
118
|
-
- - '>='
|
118
|
+
- - ! '>='
|
119
119
|
- !ruby/object:Gem::Version
|
120
120
|
version: '0'
|
121
121
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
122
122
|
requirements:
|
123
|
-
- - '>='
|
123
|
+
- - ! '>='
|
124
124
|
- !ruby/object:Gem::Version
|
125
125
|
version: '0'
|
126
126
|
requirements: []
|
127
127
|
rubyforge_project:
|
128
|
-
rubygems_version: 2.
|
128
|
+
rubygems_version: 2.2.2
|
129
129
|
signing_key:
|
130
130
|
specification_version: 4
|
131
131
|
summary: Easily output formatted metrics to stdout
|