strelka-newrelic 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.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- ZTI4YWVjMjg1MTk4YTgzNmQyNDY2MGEzYmUwODk2YmRjMGY5NDgxYw==
4
+ MTljNGIxOWQxNDg4MDYxMWViN2UxNDQwYmFiMmQ5Yjc1Y2VlMGNmZg==
5
5
  data.tar.gz: !binary |-
6
- ZTMwYTViNGEyNzZiMzczYTdlNTJjMjcyZTk5YWU0ZmQ2YWNjMzEyMA==
6
+ ODE5MWNmYjdkNTNhMTkxZjcyMzczYjhhZmM4ZDlmOWJjZTBkZjNhYg==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- NjJmYjIyMTcwZjAyMmNlOWIzY2VmYTcxOTM3ZWUzMTAzNGZjYTVlNmU1NTk4
10
- NjMzYzM0MjkwNGY2OWE0MzRjYmQ1OTMyNTYwMGFkNjIwMGRjNzJhNGRjNDEy
11
- NmJhYjFlMmViZTgxYjcxMzRkZmM2NjU3MmQ1MzQ5M2I5MWRhYjE=
9
+ N2EyNDM4YWY4MTY2MWE0YjcyNTNkNWNlYWMzOTllNWY3OWRhZjY2MWQ4YmJk
10
+ NzVhMTIyZjZiYTI1OGUwZmMyMjhjMDlhNDhhODk2NjhjOTVkYTgyZTk2ZTBh
11
+ YzVkMWUxNjhhYWJkMGVlODNiYTFlZWY2NWM3ZDBiNjBjZmZlOGU=
12
12
  data.tar.gz: !binary |-
13
- MWMyYTcwMzRlM2EzNWRiZGEzMmE1ZGU5MjA1NzJkNGQ3M2EzNDFmOWIzMGMy
14
- NzU4OGVkODczZWY0ODgzZDU2NGQ1YTIxMTA0OWVmOWM2NGY3YTA2YmUzMDc1
15
- NDAyYzc2NDA2YmI3OGI0ODRhODIwMmRhOTg5ZDVkNGJjYWVlZjA=
13
+ Y2VkNjM3ZGVhYWFiZjlkN2NhNWI1YmM2NjlkYmY1ODc2NmI4YWU1MGFhMjgx
14
+ MzRkMmQyNjFjNWJkMTFjNGMxYmYxZDViOTJjY2Y1OTlkYzUzOThkNjJlOGIx
15
+ NTk0YTliZmFjMjM1NGZkNjBjZjFmMDJlOGYwOTk4ZmYyMjJhYTQ=
checksums.yaml.gz.sig CHANGED
Binary file
data/History.rdoc CHANGED
@@ -1,3 +1,9 @@
1
+ == v0.0.2 [2013-04-01] Michael Granger <ged@FaerieMUD.org>
2
+
3
+ Bugfixes:
4
+ - Only try to add RUM header/footer when the response has notes.
5
+
6
+
1
7
  == v0.0.1 [2013-01-16] Michael Granger <ged@FaerieMUD.org>
2
8
 
3
9
  Initial release.
@@ -35,15 +35,15 @@ module Strelka::App::NewRelic
35
35
 
36
36
 
37
37
  # Library version constant
38
- VERSION = '0.0.1'
38
+ VERSION = '0.0.2'
39
39
 
40
40
  # Version-control revision constant
41
- REVISION = %q$Revision: 16e6c9702fe8 $
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
- response.notes[:rum_header] = NewRelic::Agent.browser_timing_header
112
- response.notes[:rum_footer] = NewRelic::Agent.browser_timing_footer
113
-
114
- self.log.debug " response notes: %p" % [ response.notes ]
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
- ���aQ>�{�+�jX���(�?��,��2���Y��h��k@�V�뾫��C ��� ,(���ڭ017u\Ô*���[C�����ɹ��˛6]V|� �[)d��S���\���c*�<--�ﮄe�*�u *��
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ݍAR浸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.1
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-01 00:00:00.000000000 Z
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
- ���;�pgHӀl��]�r�lCG�? '�[.��n��-/6;��%�2,{ak���.%�_�)aMwrL�f�뇋Ѭ��2m ������g�������Q̡��W=��\��}ȃ)̍-�Go˦�����Uep=���:H`f��U|�eyJ}��2���I��E}uA"x�!���\�.� ���|�A�:��[B��@Şi����[켶�}�c>4��HҾSj�Z�(Ay��L�ۺ�>�@�4QɓjF��ђU>
1
+ Ƀ��4cc���#�y�-\��Ӊ���n��ه�C~Kb��t��jA+Um(��djgj�РA�Aϱ0u慆�+�0m���O��BL���C%��?R�ˤ=� n��Ě[=~
2
+ y�