newrelic-excon 0.2

Sign up to get free protection for your applications and to get access to all the features.
data/LICENSE ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2012 Andreas Gerauer
2
+
3
+ The MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README ADDED
@@ -0,0 +1,11 @@
1
+ = newrelic-excon
2
+
3
+ * http://github.com/helle/newrelic-excon
4
+
5
+ == DESCRIPTION:
6
+
7
+ Excon instrumentation for Newrelic.
8
+
9
+ == INSTALL:
10
+
11
+ * gem install newrelic-excon
data/Rakefile ADDED
@@ -0,0 +1,29 @@
1
+ task :gem do
2
+ `gem build *.gemspec`
3
+ end
4
+
5
+ task :install do
6
+ Rake::Task[:gem].invoke
7
+ `sudo gem install *.gem`
8
+ Rake::Task[:cleanup].invoke
9
+ end
10
+
11
+ task :cleanup do
12
+ `rm *.gem`
13
+ end
14
+
15
+
16
+ # ---------------------- Documentation
17
+
18
+ Rake::RDocTask.new { |rdoc|
19
+ rdoc.rdoc_dir = 'doc/rdoc'
20
+ rdoc.title = "MCC"
21
+ rdoc.options << '--line-numbers' << '--inline-source'
22
+ rdoc.template = "#{ENV['template']}.rb" if ENV['template']
23
+ if ENV['DOC_FILES']
24
+ rdoc.rdoc_files.include(ENV['DOC_FILES'].split(/,\s*/))
25
+ else
26
+ rdoc.rdoc_files.include('README')
27
+ rdoc.rdoc_files.include('lib/**/*.rb')
28
+ end
29
+ }
@@ -0,0 +1,17 @@
1
+ if defined?(::Excon) and not NewRelic::Control.instance['disable_excon'] and not ENV['NEWRELIC_ENABLE'].to_s =~ /false|off|no/i
2
+ Excon::Connection.class_eval do
3
+ def request_with_newrelic_trace(params, &block)
4
+ metrics = ["External/#{params[:host]}/Excon::Connection/#{params[:method]}", "External/#{params[:host]}/all", "External/all"]
5
+ if NewRelic::Agent::Instrumentation::MetricFrame.recording_web_transaction?
6
+ metrics << "External/allWeb"
7
+ else
8
+ metrics << "External/allOther"
9
+ end
10
+ self.class.trace_execution_scoped metrics do
11
+ request_without_newrelic_trace(params, &block)
12
+ end
13
+ end
14
+ alias request_without_newrelic_trace request
15
+ alias request request_with_newrelic_trace
16
+ end
17
+ end
@@ -0,0 +1 @@
1
+ require 'newrelic-excon/instrumentation'
metadata ADDED
@@ -0,0 +1,82 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: newrelic-excon
3
+ version: !ruby/object:Gem::Version
4
+ version: '0.2'
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Andreas Gerauer
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2012-10-23 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: excon
16
+ requirement: !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: '0'
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ! '>='
28
+ - !ruby/object:Gem::Version
29
+ version: '0'
30
+ - !ruby/object:Gem::Dependency
31
+ name: newrelic_rpm
32
+ requirement: !ruby/object:Gem::Requirement
33
+ none: false
34
+ requirements:
35
+ - - ! '>='
36
+ - !ruby/object:Gem::Version
37
+ version: '0'
38
+ type: :runtime
39
+ prerelease: false
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ! '>='
44
+ - !ruby/object:Gem::Version
45
+ version: '0'
46
+ description:
47
+ email: andi@tickaroo.com
48
+ executables: []
49
+ extensions: []
50
+ extra_rdoc_files: []
51
+ files:
52
+ - Rakefile
53
+ - README
54
+ - LICENSE
55
+ - lib/newrelic-excon/instrumentation.rb
56
+ - lib/newrelic-excon.rb
57
+ homepage: http://www.tickaroo.com
58
+ licenses:
59
+ - MIT
60
+ post_install_message:
61
+ rdoc_options: []
62
+ require_paths:
63
+ - lib
64
+ required_ruby_version: !ruby/object:Gem::Requirement
65
+ none: false
66
+ requirements:
67
+ - - ! '>='
68
+ - !ruby/object:Gem::Version
69
+ version: '0'
70
+ required_rubygems_version: !ruby/object:Gem::Requirement
71
+ none: false
72
+ requirements:
73
+ - - ! '>='
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ requirements: []
77
+ rubyforge_project:
78
+ rubygems_version: 1.8.24
79
+ signing_key:
80
+ specification_version: 3
81
+ summary: Excon instrumentation for Newrelic.
82
+ test_files: []