newrelic-faraday 0.6.4 → 0.6.5
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +3 -0
- data/.rspec +2 -0
- data/.travis.yml +1 -0
- data/Gemfile +4 -0
- data/Rakefile +5 -0
- data/lib/newrelic_faraday/version.rb +1 -1
- data/newrelic-faraday.gemspec +21 -36
- data/spec/instrumentation_spec.rb +31 -0
- data/spec/spec_helper.rb +25 -0
- metadata +43 -9
- checksums.yaml +0 -15
data/.gitignore
ADDED
data/.rspec
ADDED
data/.travis.yml
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
language: ruby
|
data/Gemfile
ADDED
data/Rakefile
ADDED
data/newrelic-faraday.gemspec
CHANGED
@@ -1,41 +1,26 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'newrelic_faraday/version'
|
3
5
|
|
4
|
-
Gem::Specification.new do |
|
5
|
-
|
6
|
-
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = 'newrelic-faraday'
|
8
|
+
spec.version = NewrelicFaraday::VERSION::STRING
|
9
|
+
spec.authors = ['Eric Abbott', 'Matt Griffin', 'Kyle VanderBeek']
|
10
|
+
spec.email = ['matt@griffinonline.org']
|
11
|
+
spec.summary = 'Faraday instrumentation for Newrelic.'
|
12
|
+
spec.description = 'Faraday instrumentation for Newrelic.'
|
13
|
+
spec.homepage = 'http://github.com/roguecomma/newrelic-faraday'
|
14
|
+
spec.license = 'MIT'
|
7
15
|
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
s.has_rdoc = false
|
13
|
-
s.files = %w( README.rdoc LICENSE newrelic-faraday.gemspec )
|
14
|
-
s.files += Dir.glob("lib/**/*")
|
15
|
-
s.homepage = "http://github.com/roguecomma/newrelic-faraday"
|
16
|
-
s.require_paths = ["lib"]
|
17
|
-
s.rubyforge_project = "newrelic-faraday"
|
18
|
-
s.rubygems_version = "1.5.3"
|
19
|
-
s.summary = "Faraday instrumentation for Newrelic."
|
20
|
-
s.license = "MIT"
|
16
|
+
spec.files = `git ls-files -z`.split("\x0")
|
17
|
+
spec.executables = spec.files.grep(/^bin\//) { |f| File.basename(f) }
|
18
|
+
spec.test_files = spec.files.grep(/^(test|spec|features)\//)
|
19
|
+
spec.require_paths = ['lib']
|
21
20
|
|
22
|
-
|
23
|
-
|
21
|
+
spec.add_dependency 'faraday', '>= 0.6', '< 0.9'
|
22
|
+
spec.add_dependency 'newrelic_rpm', '~> 3.0'
|
24
23
|
|
25
|
-
|
26
|
-
|
27
|
-
s.add_runtime_dependency(%q<newrelic_rpm>, "~> 3.0")
|
28
|
-
s.add_development_dependency(%q<rdoc>, "~> 3.10")
|
29
|
-
else
|
30
|
-
s.add_dependency(%q<faraday>, ["< 0.9"])
|
31
|
-
s.add_dependency(%q<faraday>, [">= 0.6"])
|
32
|
-
s.add_dependency(%q<newrelic_rpm>, ["~> 3.0"])
|
33
|
-
s.add_dependency(%q<rdoc>, ["~> 3.10"])
|
34
|
-
end
|
35
|
-
else
|
36
|
-
s.add_dependency(%q<faraday>, ["< 0.9"])
|
37
|
-
s.add_dependency(%q<faraday>, [">= 0.6"])
|
38
|
-
s.add_dependency(%q<newrelic_rpm>, ["~> 3.0"])
|
39
|
-
s.add_dependency(%q<rdoc>, ["~> 3.10"])
|
40
|
-
end
|
24
|
+
spec.add_development_dependency 'rake'
|
25
|
+
spec.add_development_dependency 'rspec', '~> 3.1'
|
41
26
|
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
# -*- encoding : utf-8 -*-
|
2
|
+
require 'spec_helper'
|
3
|
+
|
4
|
+
describe Faraday::Connection do
|
5
|
+
|
6
|
+
Faraday::Adapter::Test::Stubs.new do |stub|
|
7
|
+
stub.get('/') { [200, {}, 'root'] }
|
8
|
+
stub.get('/foo/bar') { [200, {}, 'foo bar'] }
|
9
|
+
end
|
10
|
+
|
11
|
+
before(:each) do
|
12
|
+
::NewRelic::Agent.manual_start
|
13
|
+
@engine = ::NewRelic::Agent.instance.stats_engine
|
14
|
+
@engine.clear_stats
|
15
|
+
|
16
|
+
@sampler = ::NewRelic::Agent.instance.transaction_sampler
|
17
|
+
@sampler.reset!
|
18
|
+
|
19
|
+
::DependencyDetection.detect!
|
20
|
+
end
|
21
|
+
|
22
|
+
it 'add metrics to default categories' do
|
23
|
+
expect(Faraday::Connection).to receive(:trace_execution_scoped) do |metrics|
|
24
|
+
expect(metrics).to include('External/sushi.com/all')
|
25
|
+
expect(metrics).to include('External/all')
|
26
|
+
end
|
27
|
+
conn = Faraday::Connection.new 'http://sushi.com'
|
28
|
+
conn.get('/')
|
29
|
+
end
|
30
|
+
|
31
|
+
end
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
# -*- encoding : utf-8 -*-
|
2
|
+
|
3
|
+
require 'rspec'
|
4
|
+
|
5
|
+
require 'faraday'
|
6
|
+
require 'newrelic_rpm'
|
7
|
+
|
8
|
+
require 'newrelic-faraday'
|
9
|
+
|
10
|
+
# This file was generated by the `rspec --init` command. Conventionally, all
|
11
|
+
# specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
|
12
|
+
# Require this file using `require "spec_helper"` to ensure that it is only
|
13
|
+
# loaded once.
|
14
|
+
#
|
15
|
+
# See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
|
16
|
+
RSpec.configure do |config|
|
17
|
+
config.run_all_when_everything_filtered = true
|
18
|
+
config.filter_run :focus
|
19
|
+
|
20
|
+
# Run specs in random order to surface order dependencies. If you find an
|
21
|
+
# order dependency and want to debug it, you can fix the order by providing
|
22
|
+
# the seed, which is printed after each run.
|
23
|
+
# --seed 1234
|
24
|
+
config.order = 'random'
|
25
|
+
end
|
metadata
CHANGED
@@ -1,19 +1,22 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: newrelic-faraday
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.5
|
5
|
+
prerelease:
|
5
6
|
platform: ruby
|
6
7
|
authors:
|
7
8
|
- Eric Abbott
|
8
9
|
- Matt Griffin
|
10
|
+
- Kyle VanderBeek
|
9
11
|
autorequire:
|
10
12
|
bindir: bin
|
11
13
|
cert_chain: []
|
12
|
-
date: 2015-
|
14
|
+
date: 2015-03-04 00:00:00.000000000 Z
|
13
15
|
dependencies:
|
14
16
|
- !ruby/object:Gem::Dependency
|
15
17
|
name: faraday
|
16
18
|
requirement: !ruby/object:Gem::Requirement
|
19
|
+
none: false
|
17
20
|
requirements:
|
18
21
|
- - ! '>='
|
19
22
|
- !ruby/object:Gem::Version
|
@@ -24,6 +27,7 @@ dependencies:
|
|
24
27
|
type: :runtime
|
25
28
|
prerelease: false
|
26
29
|
version_requirements: !ruby/object:Gem::Requirement
|
30
|
+
none: false
|
27
31
|
requirements:
|
28
32
|
- - ! '>='
|
29
33
|
- !ruby/object:Gem::Version
|
@@ -34,6 +38,7 @@ dependencies:
|
|
34
38
|
- !ruby/object:Gem::Dependency
|
35
39
|
name: newrelic_rpm
|
36
40
|
requirement: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
37
42
|
requirements:
|
38
43
|
- - ~>
|
39
44
|
- !ruby/object:Gem::Version
|
@@ -41,24 +46,43 @@ dependencies:
|
|
41
46
|
type: :runtime
|
42
47
|
prerelease: false
|
43
48
|
version_requirements: !ruby/object:Gem::Requirement
|
49
|
+
none: false
|
44
50
|
requirements:
|
45
51
|
- - ~>
|
46
52
|
- !ruby/object:Gem::Version
|
47
53
|
version: '3.0'
|
48
54
|
- !ruby/object:Gem::Dependency
|
49
|
-
name:
|
55
|
+
name: rake
|
50
56
|
requirement: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
58
|
+
requirements:
|
59
|
+
- - ! '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
none: false
|
66
|
+
requirements:
|
67
|
+
- - ! '>='
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: '0'
|
70
|
+
- !ruby/object:Gem::Dependency
|
71
|
+
name: rspec
|
72
|
+
requirement: !ruby/object:Gem::Requirement
|
73
|
+
none: false
|
51
74
|
requirements:
|
52
75
|
- - ~>
|
53
76
|
- !ruby/object:Gem::Version
|
54
|
-
version: '3.
|
77
|
+
version: '3.1'
|
55
78
|
type: :development
|
56
79
|
prerelease: false
|
57
80
|
version_requirements: !ruby/object:Gem::Requirement
|
81
|
+
none: false
|
58
82
|
requirements:
|
59
83
|
- - ~>
|
60
84
|
- !ruby/object:Gem::Version
|
61
|
-
version: '3.
|
85
|
+
version: '3.1'
|
62
86
|
description: Faraday instrumentation for Newrelic.
|
63
87
|
email:
|
64
88
|
- matt@griffinonline.org
|
@@ -66,34 +90,44 @@ executables: []
|
|
66
90
|
extensions: []
|
67
91
|
extra_rdoc_files: []
|
68
92
|
files:
|
93
|
+
- .gitignore
|
94
|
+
- .rspec
|
95
|
+
- .travis.yml
|
96
|
+
- Gemfile
|
69
97
|
- LICENSE
|
70
98
|
- README.rdoc
|
99
|
+
- Rakefile
|
71
100
|
- lib/newrelic-faraday.rb
|
72
101
|
- lib/newrelic_faraday/instrumentation.rb
|
73
102
|
- lib/newrelic_faraday/version.rb
|
74
103
|
- newrelic-faraday.gemspec
|
104
|
+
- spec/instrumentation_spec.rb
|
105
|
+
- spec/spec_helper.rb
|
75
106
|
homepage: http://github.com/roguecomma/newrelic-faraday
|
76
107
|
licenses:
|
77
108
|
- MIT
|
78
|
-
metadata: {}
|
79
109
|
post_install_message:
|
80
110
|
rdoc_options: []
|
81
111
|
require_paths:
|
82
112
|
- lib
|
83
113
|
required_ruby_version: !ruby/object:Gem::Requirement
|
114
|
+
none: false
|
84
115
|
requirements:
|
85
116
|
- - ! '>='
|
86
117
|
- !ruby/object:Gem::Version
|
87
118
|
version: '0'
|
88
119
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
120
|
+
none: false
|
89
121
|
requirements:
|
90
122
|
- - ! '>='
|
91
123
|
- !ruby/object:Gem::Version
|
92
124
|
version: '0'
|
93
125
|
requirements: []
|
94
|
-
rubyforge_project:
|
95
|
-
rubygems_version:
|
126
|
+
rubyforge_project:
|
127
|
+
rubygems_version: 1.8.23
|
96
128
|
signing_key:
|
97
129
|
specification_version: 3
|
98
130
|
summary: Faraday instrumentation for Newrelic.
|
99
|
-
test_files:
|
131
|
+
test_files:
|
132
|
+
- spec/instrumentation_spec.rb
|
133
|
+
- spec/spec_helper.rb
|
checksums.yaml
DELETED
@@ -1,15 +0,0 @@
|
|
1
|
-
---
|
2
|
-
!binary "U0hBMQ==":
|
3
|
-
metadata.gz: !binary |-
|
4
|
-
MGE3Njc4NWEzNWNjZmUzNjMzMGI0OTY3MTdkYjNmZjFhMGRmOWYwYQ==
|
5
|
-
data.tar.gz: !binary |-
|
6
|
-
NmE4MjkxOWU3MjliYWE4MWRiMDMzZGY3ZjRiNjk4ZTcwNjRkODA4Ng==
|
7
|
-
SHA512:
|
8
|
-
metadata.gz: !binary |-
|
9
|
-
YzA2YWFhNjMyYzcwODRkMTFjMzdkNTYyZjhmZDAxY2M0OGY0NmM4MWM3NjZh
|
10
|
-
ZjdiMDJjMzBjZGNjZjAwM2I4ODNhZWZlNWE3OTkzNzVlODU3ZmYwZTY2ZjYx
|
11
|
-
N2JmN2MzYjI1ZjJkZjI2N2MzOGQ1NTJiNDM1MDI2NDlkZmFiMzk=
|
12
|
-
data.tar.gz: !binary |-
|
13
|
-
OTc1ODc5OGQyODliNTY5NGE4MmY1OTE4NTBkMmUyNzE2NmU5ZTU4MjFjOTA5
|
14
|
-
ZjdlYWY4NmI0NjQ5NzcxOTAxZjI2NzI0YTQwMzZmZTg0ZWUzMTlkZjBmMTI3
|
15
|
-
M2VlZWM2MzUxMTQyNjY0ZTQzZjhkYTczY2Y3ODRiYWE3NDJiYmE=
|