traceview 3.4.1-java → 3.4.2-java

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0ed57ebd3157574cebbe079d0334d432df5fab32
4
- data.tar.gz: 1c3255424e1e52a1da52d014096f8f1702f3eae0
3
+ metadata.gz: 60acff05dba3ac97c12c212603c2055a1e866d5d
4
+ data.tar.gz: c92f3b700e4f410feacd4835b9dbe9f26ed79ec2
5
5
  SHA512:
6
- metadata.gz: bab8f3cc81f2db88d973f204359a930065ee23be2f89c3e2e608f15171ca1f378f61f4d37454703d949f0ed0af3c78d1d4a1ef6ac483115e06a5991bc59fc593
7
- data.tar.gz: fed0ca424618fb3363f63cf633122f4ba52c4d85263ca676df4d4e1a657c989aa99eb4d105fae903cecb9e50beb74e528564cb13cefe0211c7e3322e4b8e4393
6
+ metadata.gz: 7e10ef76df5b9cec31dc7b13f498da2748a0b4c97b5975cc5f780f0e964aa3715f6d319c7900fafe6ba6ab4b1f0bae663ee6d1dcdb79050fb57c123301938abc
7
+ data.tar.gz: 5e99e735b24c55801d5dde15a45b0087a8a82161628e77eb75caeb34ae91e3498b6690805dbce46f14f6ad3ec2aed48d67a0c05fcb982047d6bbd32cd4335245
data/CHANGELOG.md CHANGED
@@ -4,6 +4,18 @@ https://github.com/appneta/oboe-ruby/releases
4
4
 
5
5
  Dates in this file are in the format MM/DD/YYYY.
6
6
 
7
+ # traceview 3.4.2
8
+
9
+ This patch release includes the following fixes:
10
+
11
+ * bson dependency breaks Ruby 1.8.7 install: #158
12
+ * Resque worker automatic tracing: #157
13
+
14
+ Pushed to Rubygems:
15
+
16
+ https://rubygems.org/gems/traceview/versions/3.4.2
17
+ https://rubygems.org/gems/traceview/versions/3.4.2-java
18
+
7
19
  # traceview 3.4.1
8
20
 
9
21
  This patch release includes the following fixes:
data/README.md CHANGED
@@ -150,9 +150,11 @@ You can send deploy notifications to TraceView and have the events show up on yo
150
150
 
151
151
  # Custom Tracing
152
152
 
153
+ You can add even more visibility into any part of your application or scripts by adding custom instrumentation. If you want to see the performance of an existing method see Method Profiling. To trace blocks of code see the Tracing API.
154
+
153
155
  ## The Tracing API
154
156
 
155
- You can instrument any arbitrary block of code using `TraceView::API.trace`:
157
+ You can instrument any arbitrary block of code using `TraceView::API.trace`. The code and any supported calls for libraries that we support, will automatically get traced and reported to your dashboard.
156
158
 
157
159
  ```ruby
158
160
  # layer_name will show up in the TraceView app dashboard
@@ -181,27 +183,15 @@ Find more details in the [RubyDoc page](http://rdoc.info/gems/traceview/TraceVie
181
183
 
182
184
  ## Tracing Methods
183
185
 
184
- By using class level declarations, it's possible to automatically have certain methods on that class instrumented and reported to your TraceView dashboard automatically.
186
+ With TraceView, you can profile any method in your application or even in the Ruby language using `TraceView::API.profile_method`.
185
187
 
186
- The pattern for Method Profiling is as follows:
188
+ If, for example, you wanted to see the performance for the `Array::sort`, you could simply call the following in your startup code:
187
189
 
188
- ```ruby
189
- # 'profile_name' is similar to a layer name.
190
- # It identifies this custom trace in your dashboard.
191
- #
192
- class Engine
193
- def processor()
194
- # body of method
195
- end
196
-
197
- include TraceViewMethodProfiling
198
-
199
- # call syntax: profile_method <method>, <profile_name>
200
- profile_method :processor, 'processor'
201
- end
190
+ ```
191
+ TraceView::API.profile_method(Array, :sort)
202
192
  ```
203
193
 
204
- This example demonstrates method profiling of instance methods. Class methods are profiled slightly differently. See the TraceView [documentation portal](https://docs.appneta.com/ruby#customizing-ruby-instrumentation) for full details.
194
+ For full documentation, options and reporting custom KVs, see our documentation on [method profiling](http://docs.appneta.com/ruby#profiling-ruby-methods).
205
195
 
206
196
  # Support
207
197
 
@@ -7,7 +7,7 @@ group :development, :test do
7
7
  gem 'minitest-debugger', :require => false
8
8
  gem 'rack-test'
9
9
  gem 'puma'
10
- gem 'bson'
10
+ gem 'bson', '< 4.0'
11
11
  end
12
12
 
13
13
  if defined?(JRUBY_VERSION)
@@ -10,7 +10,7 @@ group :development, :test do
10
10
  if RUBY_VERSION < '1.9.3'
11
11
  gem 'bson', '<= 1.12.3'
12
12
  else
13
- gem 'bson'
13
+ gem 'bson', '< 4.0'
14
14
  end
15
15
  end
16
16
 
@@ -20,7 +20,7 @@ group :development, :test do
20
20
  if RUBY_VERSION < '1.9.3'
21
21
  gem 'bson', '<= 1.12.3'
22
22
  else
23
- gem 'bson'
23
+ gem 'bson', '< 4.0'
24
24
  end
25
25
  end
26
26
 
@@ -23,7 +23,7 @@ group :development, :test do
23
23
  if RUBY_VERSION < '1.9.3'
24
24
  gem 'bson', '<= 1.12.3'
25
25
  else
26
- gem 'bson'
26
+ gem 'bson', '< 4.0'
27
27
  end
28
28
  end
29
29
 
@@ -7,7 +7,7 @@ group :development, :test do
7
7
  gem 'minitest-debugger', :require => false
8
8
  gem 'rack-test'
9
9
  gem 'puma'
10
- gem 'bson'
10
+ gem 'bson', '< 4.0'
11
11
  end
12
12
 
13
13
  if defined?(JRUBY_VERSION)
@@ -142,7 +142,7 @@ module TraceViewBase
142
142
  # DelayedJob or Sidekiq workers.
143
143
  #
144
144
  def entry_layer?(layer)
145
- %w(delayed_job-worker sidekiq-worker).include?(layer.to_s)
145
+ %w(delayed_job-worker sidekiq-worker resque-worker).include?(layer.to_s)
146
146
  end
147
147
 
148
148
  ##
@@ -8,7 +8,7 @@ module TraceView
8
8
  module Version
9
9
  MAJOR = 3
10
10
  MINOR = 4
11
- PATCH = 1
11
+ PATCH = 2
12
12
  BUILD = nil
13
13
 
14
14
  STRING = [MAJOR, MINOR, PATCH, BUILD].compact.join('.')
@@ -191,16 +191,14 @@ if RUBY_VERSION >= '1.9.3'
191
191
  response = nil
192
192
 
193
193
  TraceView::API.start_trace('rest_client_test') do
194
- resource = RestClient::Resource.new 'http://www.appneta.com/products/traceview?a=1'
194
+ resource = RestClient::Resource.new 'http://127.0.0.1:8101/redirectme?redirect_test'
195
195
  response = resource.get
196
196
  end
197
197
 
198
198
  traces = get_all_traces
199
- traces.count.must_equal 12
199
+ traces.count.must_equal 18
200
200
 
201
- # FIXME: We need to switch from making external calls to an internal test
202
- # stack instead so we can validate cross-app traces.
203
- # valid_edges?(traces).must_equal true
201
+ valid_edges?(traces).must_equal true
204
202
  validate_outer_layers(traces, 'rest_client_test')
205
203
 
206
204
  traces[1]['Layer'].must_equal 'rest-client'
@@ -209,43 +207,43 @@ if RUBY_VERSION >= '1.9.3'
209
207
  traces[2]['Layer'].must_equal 'net-http'
210
208
  traces[2]['Label'].must_equal 'entry'
211
209
 
212
- traces[3]['Layer'].must_equal 'net-http'
213
- traces[3]['Label'].must_equal 'info'
214
- traces[3]['IsService'].must_equal 1
215
- traces[3]['RemoteProtocol'].must_equal 'HTTP'
216
- traces[3]['RemoteHost'].must_equal 'www.appneta.com'
217
- traces[3]['ServiceArg'].must_equal '/products/traceview?a=1'
218
- traces[3]['HTTPMethod'].must_equal 'GET'
219
- traces[3]['HTTPStatus'].must_equal "301"
220
- traces[3].key?('Backtrace').must_equal TraceView::Config[:nethttp][:collect_backtraces]
210
+ traces[6]['Layer'].must_equal 'net-http'
211
+ traces[6]['Label'].must_equal 'info'
212
+ traces[6]['IsService'].must_equal 1
213
+ traces[6]['RemoteProtocol'].must_equal 'HTTP'
214
+ traces[6]['RemoteHost'].must_equal '127.0.0.1:8101'
215
+ traces[6]['ServiceArg'].must_equal '/redirectme?redirect_test'
216
+ traces[6]['HTTPMethod'].must_equal 'GET'
217
+ traces[6]['HTTPStatus'].must_equal "301"
218
+ traces[6].key?('Backtrace').must_equal TraceView::Config[:nethttp][:collect_backtraces]
219
+
220
+ traces[7]['Layer'].must_equal 'net-http'
221
+ traces[7]['Label'].must_equal 'exit'
221
222
 
222
- traces[4]['Layer'].must_equal 'net-http'
223
- traces[4]['Label'].must_equal 'exit'
223
+ traces[8]['Layer'].must_equal 'rest-client'
224
+ traces[8]['Label'].must_equal 'entry'
224
225
 
225
- traces[5]['Layer'].must_equal 'rest-client'
226
- traces[5]['Label'].must_equal 'entry'
226
+ traces[9]['Layer'].must_equal 'net-http'
227
+ traces[9]['Label'].must_equal 'entry'
227
228
 
228
- traces[6]['Layer'].must_equal 'net-http'
229
- traces[6]['Label'].must_equal 'entry'
229
+ traces[13]['Layer'].must_equal 'net-http'
230
+ traces[13]['Label'].must_equal 'info'
231
+ traces[13]['IsService'].must_equal 1
232
+ traces[13]['RemoteProtocol'].must_equal 'HTTP'
233
+ traces[13]['RemoteHost'].must_equal '127.0.0.1:8101'
234
+ traces[13]['ServiceArg'].must_equal '/'
235
+ traces[13]['HTTPMethod'].must_equal 'GET'
236
+ traces[13]['HTTPStatus'].must_equal "200"
237
+ traces[13].key?('Backtrace').must_equal TraceView::Config[:nethttp][:collect_backtraces]
230
238
 
231
- traces[7]['Layer'].must_equal 'net-http'
232
- traces[7]['Label'].must_equal 'info'
233
- traces[7]['IsService'].must_equal 1
234
- traces[7]['RemoteProtocol'].must_equal 'HTTP'
235
- traces[7]['RemoteHost'].must_equal 'www.appneta.com'
236
- traces[7]['ServiceArg'].must_equal '/products/traceview/?a=1'
237
- traces[7]['HTTPMethod'].must_equal 'GET'
238
- traces[7]['HTTPStatus'].must_equal "200"
239
- traces[7].key?('Backtrace').must_equal TraceView::Config[:nethttp][:collect_backtraces]
240
-
241
- traces[8]['Layer'].must_equal 'net-http'
242
- traces[8]['Label'].must_equal 'exit'
239
+ traces[14]['Layer'].must_equal 'net-http'
240
+ traces[14]['Label'].must_equal 'exit'
243
241
 
244
- traces[9]['Layer'].must_equal 'rest-client'
245
- traces[9]['Label'].must_equal 'exit'
242
+ traces[15]['Layer'].must_equal 'rest-client'
243
+ traces[15]['Label'].must_equal 'exit'
246
244
 
247
- traces[10]['Layer'].must_equal 'rest-client'
248
- traces[10]['Label'].must_equal 'exit'
245
+ traces[16]['Layer'].must_equal 'rest-client'
246
+ traces[16]['Label'].must_equal 'exit'
249
247
  end
250
248
 
251
249
  it 'should trace and capture raised exceptions' do
@@ -9,9 +9,17 @@ TraceView.logger.info "[traceview/info] Starting background utility rack app on
9
9
  Thread.new do
10
10
  app = Rack::Builder.new {
11
11
  use TraceView::Rack
12
- run Proc.new { |env|
13
- [200, {"Content-Type" => "text/html"}, ['Hello TraceView!']]
14
- }
12
+ map "/" do
13
+ run Proc.new { |env|
14
+ [200, {"Content-Type" => "text/html"}, ['Hello TraceView!']]
15
+ }
16
+ end
17
+
18
+ map "/redirectme" do
19
+ run Proc.new { |env|
20
+ [301, {"Location" => "/", "Content-Type" => "text/html"}, ['']]
21
+ }
22
+ end
15
23
  }
16
24
 
17
25
  Rack::Handler::Puma.run(app, {:Host => '127.0.0.1', :Port => 8101})
@@ -15,11 +15,13 @@ class AutoTraceTest < Minitest::Test
15
15
  def test_entry_layers
16
16
  TraceView.entry_layer?('delayed_job-worker').must_equal true
17
17
  TraceView.entry_layer?('sidekiq-worker').must_equal true
18
+ TraceView.entry_layer?('resque-worker').must_equal true
18
19
  TraceView.entry_layer?('asdf-worker').must_equal false
19
20
  end
20
21
 
21
22
  def test_entry_layers_supports_symbols
22
23
  TraceView.entry_layer?(:'delayed_job-worker').must_equal true
24
+ TraceView.entry_layer?(:'resque-worker').must_equal true
23
25
  TraceView.entry_layer?(:asdfworker).must_equal false
24
26
  end
25
27
 
@@ -39,6 +41,14 @@ class AutoTraceTest < Minitest::Test
39
41
  end
40
42
  end
41
43
 
44
+ def test_trace_when_default_tm_resque
45
+ TraceView::Config[:tracing_mode] = :through
46
+
47
+ TV::API.start_trace('resque-worker') do
48
+ TraceView.tracing?.must_equal true
49
+ end
50
+ end
51
+
42
52
  def test_dont_trace_when_never
43
53
  TraceView::Config[:tracing_mode] = :never
44
54
 
data/traceview.gemspec CHANGED
@@ -22,7 +22,6 @@ Gem::Specification.new do |s|
22
22
  s.extensions = ['ext/oboe_metal/extconf.rb'] unless defined?(JRUBY_VERSION)
23
23
 
24
24
  s.add_runtime_dependency('json', '>= 0')
25
- s.add_runtime_dependency('bson', '< 4.0')
26
25
 
27
26
  # Development dependencies used in gem development & testing
28
27
  s.add_development_dependency('rake', '>= 0.9.0')
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: traceview
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.4.1
4
+ version: 3.4.2
5
5
  platform: java
6
6
  authors:
7
7
  - Peter Giacomo Lombardo
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2016-01-05 00:00:00.000000000 Z
12
+ date: 2016-01-25 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: json
@@ -25,20 +25,6 @@ dependencies:
25
25
  version: '0'
26
26
  prerelease: false
27
27
  type: :runtime
28
- - !ruby/object:Gem::Dependency
29
- name: bson
30
- version_requirements: !ruby/object:Gem::Requirement
31
- requirements:
32
- - - "<"
33
- - !ruby/object:Gem::Version
34
- version: '4.0'
35
- requirement: !ruby/object:Gem::Requirement
36
- requirements:
37
- - - "<"
38
- - !ruby/object:Gem::Version
39
- version: '4.0'
40
- prerelease: false
41
- type: :runtime
42
28
  - !ruby/object:Gem::Dependency
43
29
  name: rake
44
30
  version_requirements: !ruby/object:Gem::Requirement