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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: b72967d33d3eaeaefa60e66a94b4df665733bb66
4
- data.tar.gz: 80529c68a14a80c2f7127385440f090a9f446383
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: 1ed386b390da64c2b40decaab4367307fc1ef17f
4
+ data.tar.gz: 1f9ba0fb3a7294d7fd91ffdfd3cd575969f36302
5
5
  SHA512:
6
- metadata.gz: 488dfe4484cbc9d34340ae4c307de143472ad257b0db4a0eae5002ca1f55069785ae1967f1d19aed1616e860790ee136b6211bb89d9665f6ff91544cf165bceb
7
- data.tar.gz: 957744dc87ce70b5663d4cef80a816e46537b4a7a4c90bad0495b9750c1721a8bd1dd9ad678d99af65b56f09576add7550b8c2eda7cf6fe68b059c018706a7e9
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
 
@@ -1,3 +1,3 @@
1
1
  module FormattedMetrics
2
- VERSION = '1.1.2'
2
+ VERSION = '1.1.3'
3
3
  end
@@ -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.v1.foo').and_call_original
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.2
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-02-05 00:00:00.000000000 Z
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.0.14
128
+ rubygems_version: 2.2.2
129
129
  signing_key:
130
130
  specification_version: 4
131
131
  summary: Easily output formatted metrics to stdout