strelka-newrelic 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- checksums.yaml.gz.sig +0 -0
- data/History.rdoc +6 -0
- data/lib/strelka/app/newrelic.rb +10 -7
- data/spec/strelka/app/newrelic_spec.rb +11 -9
- data.tar.gz.sig +1 -1
- metadata +2 -2
- metadata.gz.sig +2 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
MTljNGIxOWQxNDg4MDYxMWViN2UxNDQwYmFiMmQ5Yjc1Y2VlMGNmZg==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
ODE5MWNmYjdkNTNhMTkxZjcyMzczYjhhZmM4ZDlmOWJjZTBkZjNhYg==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
N2EyNDM4YWY4MTY2MWE0YjcyNTNkNWNlYWMzOTllNWY3OWRhZjY2MWQ4YmJk
|
10
|
+
NzVhMTIyZjZiYTI1OGUwZmMyMjhjMDlhNDhhODk2NjhjOTVkYTgyZTk2ZTBh
|
11
|
+
YzVkMWUxNjhhYWJkMGVlODNiYTFlZWY2NWM3ZDBiNjBjZmZlOGU=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
Y2VkNjM3ZGVhYWFiZjlkN2NhNWI1YmM2NjlkYmY1ODc2NmI4YWU1MGFhMjgx
|
14
|
+
MzRkMmQyNjFjNWJkMTFjNGMxYmYxZDViOTJjY2Y1OTlkYzUzOThkNjJlOGIx
|
15
|
+
NTk0YTliZmFjMjM1NGZkNjBjZjFmMDJlOGYwOTk4ZmYyMjJhYTQ=
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/History.rdoc
CHANGED
data/lib/strelka/app/newrelic.rb
CHANGED
@@ -35,15 +35,15 @@ module Strelka::App::NewRelic
|
|
35
35
|
|
36
36
|
|
37
37
|
# Library version constant
|
38
|
-
VERSION = '0.0.
|
38
|
+
VERSION = '0.0.2'
|
39
39
|
|
40
40
|
# Version-control revision constant
|
41
|
-
REVISION = %q$Revision:
|
41
|
+
REVISION = %q$Revision: 95dd2b5fc474 $
|
42
42
|
|
43
43
|
|
44
44
|
|
45
45
|
# Insert this plugin after routing in the app's stack
|
46
|
-
run_after :routing
|
46
|
+
run_after :routing, :templating
|
47
47
|
|
48
48
|
# Configurability API -- load newrelic configuration from the 'newrelic'
|
49
49
|
# section of the universal config. Since NewRelic's config is separate
|
@@ -87,6 +87,7 @@ module Strelka::App::NewRelic
|
|
87
87
|
|
88
88
|
### Mark and time the app.
|
89
89
|
def handle_request( request )
|
90
|
+
response = nil
|
90
91
|
self.log.debug "[:newrelic] Instrumenting with NewRelic."
|
91
92
|
|
92
93
|
txname = if !request.notes[:routing][:route].empty?
|
@@ -108,10 +109,12 @@ module Strelka::App::NewRelic
|
|
108
109
|
super
|
109
110
|
end
|
110
111
|
|
111
|
-
|
112
|
-
response.notes
|
113
|
-
|
114
|
-
|
112
|
+
self.log.debug "Response is: %p" % [ response ]
|
113
|
+
if response && response.respond_to?( :notes ) && response.notes
|
114
|
+
response.notes[:rum_header] = NewRelic::Agent.browser_timing_header
|
115
|
+
response.notes[:rum_footer] = NewRelic::Agent.browser_timing_footer
|
116
|
+
self.log.debug " response notes: %p" % [ response.notes ]
|
117
|
+
end
|
115
118
|
|
116
119
|
return response
|
117
120
|
rescue => err
|
@@ -107,13 +107,10 @@ describe Strelka::App::NewRelic do
|
|
107
107
|
plugin :parameters
|
108
108
|
param :sku, :integer
|
109
109
|
|
110
|
-
plugin :routing
|
110
|
+
plugin :routing, :templating
|
111
111
|
|
112
112
|
get '/foo' do |request|
|
113
113
|
self.log.debug "Agent logger: %p" % [ NewRelic::Agent.logger ]
|
114
|
-
NewRelic::Agent.logger.debug "DEBUG"
|
115
|
-
NewRelic::Agent.logger.info "INFO"
|
116
|
-
NewRelic::Agent.browser_timing_header
|
117
114
|
res = request.response
|
118
115
|
res.status = HTTP::OK
|
119
116
|
return res
|
@@ -124,12 +121,11 @@ describe Strelka::App::NewRelic do
|
|
124
121
|
res.status = HTTP::OK
|
125
122
|
return res
|
126
123
|
end
|
127
|
-
end
|
128
|
-
|
129
|
-
# logdevice = Loggability[ NewRelic ]
|
130
|
-
# logger = NewRelic::Agent::AgentLogger.new(NewRelic::Agent.config, '', logdevice )
|
131
|
-
# NewRelic::Agent.logger = logger
|
132
124
|
|
125
|
+
get '/template' do |request|
|
126
|
+
return Inversion::Template.new( '' )
|
127
|
+
end
|
128
|
+
end
|
133
129
|
end
|
134
130
|
|
135
131
|
after( :each ) do
|
@@ -159,6 +155,12 @@ describe Strelka::App::NewRelic do
|
|
159
155
|
response.notes[:rum_footer].should =~ /NREUMQ/
|
160
156
|
end
|
161
157
|
|
158
|
+
it "only tries to add browser timing JS to the response if it's got notes" do
|
159
|
+
request = @request_factory.get( '/template' )
|
160
|
+
response = @app.new.start_newrelic_agent.handle( request )
|
161
|
+
response.status.should == HTTP::OK
|
162
|
+
end
|
163
|
+
|
162
164
|
end
|
163
165
|
|
164
166
|
|
data.tar.gz.sig
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
z�M0�H���*�҄�B��Gƍ*�����~�4� %�6�� ��"�-�tm�+�poYu�ꚓG�T��O$�\�ll���Z�CI��l��1\Wn14�R����f�1��?�r���|P�T���'8� )�/YݍA�R浸m�]I�C#Wv�Ɛ6��ȉ+�y��M*/[�E���d9E����Q�ST�@�;���bq���(��#��+K�6[�ّ/�S�*Tn�(�S�ڱ�]���i���P����
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: strelka-newrelic
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Granger
|
@@ -37,7 +37,7 @@ cert_chain:
|
|
37
37
|
YjMyZVFMago2bUtDd2pwZWd5dEUwb2lmWGZGOGs3NUE5MTA1Y0JuTmlNWk9l
|
38
38
|
MXRYaXFZYy9leENnV3ZiZ2d1cnpET2NSa1p1Ci9ZU3VzYWlEWEhLVTJPM0Fr
|
39
39
|
YzNodEE9PQotLS0tLUVORCBDRVJUSUZJQ0FURS0tLS0tCg==
|
40
|
-
date: 2013-04-
|
40
|
+
date: 2013-04-02 00:00:00.000000000 Z
|
41
41
|
dependencies:
|
42
42
|
- !ruby/object:Gem::Dependency
|
43
43
|
name: strelka
|
metadata.gz.sig
CHANGED
@@ -1 +1,2 @@
|
|
1
|
-
|
1
|
+
Ƀ��4cc���#�y�-\��Ӊ���n��ه�C~Kb��t��jA+Um(��d�jgj�РA�Aϱ0u慆�+�0m���O��BL���C%��?R�ˤ=��n��Ě[=~
|
2
|
+
y�
|