newrelic-curb 0.0.1 → 0.0.2
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.
- data/lib/newrelic-curb.rb +1 -0
- data/lib/newrelic-curb/instrument.rb +22 -0
- metadata +8 -6
@@ -0,0 +1 @@
|
|
1
|
+
require 'newrelic-curb/instrument'
|
@@ -0,0 +1,22 @@
|
|
1
|
+
require 'curb'
|
2
|
+
require 'newrelic_rpm'
|
3
|
+
|
4
|
+
::Curl::Easy.class_eval do
|
5
|
+
def host
|
6
|
+
URI.parse((self.url.start_with?('http') ? '' : 'http://') + self.url).host
|
7
|
+
end
|
8
|
+
|
9
|
+
def perform_with_newrelic_trace(*args, &block)
|
10
|
+
metrics = ["External/#{host}/Curl::Easy","External/#{host}/all","External/all"]
|
11
|
+
if NewRelic::Agent::Instrumentation::MetricFrame.recording_web_transaction?
|
12
|
+
metrics << "External/allWeb"
|
13
|
+
else
|
14
|
+
metrics << "External/allOther"
|
15
|
+
end
|
16
|
+
self.class.trace_execution_scoped metrics do
|
17
|
+
perform_without_newrelic_trace(*args, &block)
|
18
|
+
end
|
19
|
+
end
|
20
|
+
alias perform_without_newrelic_trace perform
|
21
|
+
alias perform perform_with_newrelic_trace
|
22
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: newrelic-curb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -13,7 +13,7 @@ date: 2013-07-02 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: curb
|
16
|
-
requirement: &
|
16
|
+
requirement: &70277560728400 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70277560728400
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: newrelic_rpm
|
27
|
-
requirement: &
|
27
|
+
requirement: &70277560727760 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -32,13 +32,15 @@ dependencies:
|
|
32
32
|
version: '0'
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *70277560727760
|
36
36
|
description: Wraps Curl::Easy.perform to send per-host metrics to New Relic
|
37
37
|
email: keith.thornhill@gmail.com
|
38
38
|
executables: []
|
39
39
|
extensions: []
|
40
40
|
extra_rdoc_files: []
|
41
|
-
files:
|
41
|
+
files:
|
42
|
+
- lib/newrelic-curb.rb
|
43
|
+
- lib/newrelic-curb/instrument.rb
|
42
44
|
homepage: https://github.com/afex/newrelic-curb
|
43
45
|
licenses:
|
44
46
|
- MIT
|