oboe 2.7.9.6-java → 2.7.10.1-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: 8ed9e41f9666afe02baa1c1052e552478ebc7b69
4
- data.tar.gz: d48538a8be6ce71406a22c9cf749342c68d3e9d3
3
+ metadata.gz: 1fcc957b05aaa4db312a9c3489c0afa9db8e7abc
4
+ data.tar.gz: 66c1e08d4e7a5347e639d5331fe18befd3ea65df
5
5
  SHA512:
6
- metadata.gz: 42b5479c04c6c057f3f670b1419ca6ca93b2f2d8af9d8ff81fac0fb5082b6e48090c175579c136c09e4fef581fdae8249d61187a2a74b44b7433337fcf4778c8
7
- data.tar.gz: 5d0dc460872f60977390181bba08a242fcf71d4ed1d25e17fb13dfd509330605732652bd5ceaef7565183ca0595e434d881d5e704b972a8edf8b3cfd933ff59b
6
+ metadata.gz: 05e988b3c4820b76ac96cbaecda16b08d443449c444b8c083545f4b8fc5d27d3c35439eb2c9e56ac09d5970ed7652e0c7f7a4f71fb92e480ede3ecf12eb3e9cc
7
+ data.tar.gz: ca9686165ac5240eac0c4d706a73f16317362682c4a00e4108dc133c21fc24848373bfa152b1ecb7bd5ec8356215599070b6520f10cadbe274032c9fc6649261
@@ -6,6 +6,7 @@ cache:
6
6
  - vendor/bundle
7
7
 
8
8
  rvm:
9
+ - 2.2.0
9
10
  - 2.1.1
10
11
  - 2.0.0
11
12
  - 1.9.3
@@ -71,6 +71,34 @@ module Oboe
71
71
  # avoid collecting and reporting query literals to TraceView.
72
72
  @@config[:sanitize_sql] = false
73
73
 
74
+ # Do Not Trace
75
+ # These two values allow you to configure specific URL patterns to
76
+ # never be traced. By default, this is set to common static file
77
+ # extensions but you may want to customize this list for your needs.
78
+ #
79
+ # dnt_regexp and dnt_opts is passed to Regexp.new to create
80
+ # a regular expression object. That is then used to match against
81
+ # the incoming request path.
82
+ #
83
+ # The path string originates from the rack layer and is retrieved
84
+ # as follows:
85
+ #
86
+ # req = ::Rack::Request.new(env)
87
+ # path = URI.unescape(req.path)
88
+ #
89
+ # Usage:
90
+ # Oboe::Config[:dnt_regexp] = "lobster$"
91
+ # Oboe::Config[:dnt_opts] = Regexp::IGNORECASE
92
+ #
93
+ # This will ignore all requests that end with the string lobster
94
+ # regardless of case
95
+ #
96
+ # Requests with positive matches (non nil) will not be traced.
97
+ # See lib/oboe/util.rb: Oboe::Util.static_asset?
98
+ #
99
+ @@config[:dnt_regexp] = "\.(jpg|jpeg|gif|png|ico|css|zip|tgz|gz|rar|bz2|pdf|txt|tar|wav|bmp|rtf|js|flv|swf|ttf|woff|svg|less)$"
100
+ @@config[:dnt_opts] = Regexp::IGNORECASE
101
+
74
102
  if ENV.key?('OPENSHIFT_TRACEVIEW_TLYZER_IP')
75
103
  # We're running on OpenShift
76
104
  @@config[:tracing_mode] = 'always'
@@ -103,7 +103,7 @@ module Oboe
103
103
  # solely on filename)
104
104
  #
105
105
  def static_asset?(path)
106
- (path =~ /\.(jpg|jpeg|gif|png|ico|css|zip|tgz|gz|rar|bz2|pdf|txt|tar|wav|bmp|rtf|js|flv|swf|ttf|woff|svg|less)$/i)
106
+ (path =~ Regexp.new(Oboe::Config[:dnt_regexp], Oboe::Config[:dnt_opts]))
107
107
  end
108
108
 
109
109
  ##
@@ -8,8 +8,8 @@ module Oboe
8
8
  module Version
9
9
  MAJOR = 2
10
10
  MINOR = 7
11
- PATCH = 9
12
- BUILD = 6
11
+ PATCH = 10
12
+ BUILD = 1
13
13
 
14
14
  STRING = [MAJOR, MINOR, PATCH, BUILD].compact.join('.')
15
15
  end
@@ -59,6 +59,8 @@ describe Oboe::Config do
59
59
 
60
60
  Oboe::Config[:resque][:link_workers].must_equal false
61
61
  Oboe::Config[:blacklist].is_a?(Array).must_equal true
62
- end
63
62
 
63
+ Oboe::Config[:dnt_regexp].must_equal "\.(jpg|jpeg|gif|png|ico|css|zip|tgz|gz|rar|bz2|pdf|txt|tar|wav|bmp|rtf|js|flv|swf|ttf|woff|svg|less)$"
64
+ Oboe::Config[:dnt_opts].must_equal Regexp::IGNORECASE
65
+ end
64
66
  end
@@ -0,0 +1,73 @@
1
+ require 'minitest_helper'
2
+ require 'rack/test'
3
+ require 'rack/lobster'
4
+ require 'oboe/inst/rack'
5
+
6
+ class RackTestApp < Minitest::Test
7
+ include Rack::Test::Methods
8
+
9
+ def app
10
+ @app = Rack::Builder.new {
11
+ use Rack::CommonLogger
12
+ use Rack::ShowExceptions
13
+ use Oboe::Rack
14
+ map "/lobster" do
15
+ use Rack::Lint
16
+ run Rack::Lobster.new
17
+ end
18
+ }
19
+ end
20
+
21
+ def test_custom_do_not_trace
22
+ clear_all_traces
23
+
24
+ dnt_original = Oboe::Config[:dnt_regexp]
25
+ Oboe::Config[:dnt_regexp] = "lobster$"
26
+
27
+ get "/lobster"
28
+
29
+ traces = get_all_traces
30
+ assert traces.empty?
31
+
32
+ Oboe::Config[:dnt_regexp] = dnt_original
33
+ end
34
+
35
+ def test_do_not_trace_static_assets
36
+ clear_all_traces
37
+
38
+ get "/assets/static_asset.png"
39
+
40
+ traces = get_all_traces
41
+ assert traces.empty?
42
+
43
+ assert last_response.status == 404
44
+ end
45
+
46
+ def test_complex_do_not_trace
47
+ skip "not supported" if RUBY_VERSION < '1.9'
48
+
49
+ clear_all_traces
50
+
51
+ dnt_original = Oboe::Config[:dnt_regexp]
52
+
53
+ # Do not trace .js files _except for_ show.js
54
+ Oboe::Config[:dnt_regexp] = "(\.js$)(?<!show.js)"
55
+
56
+ # First: We shouldn't trace general .js files
57
+ get "/javascripts/application.js"
58
+
59
+ traces = get_all_traces
60
+ assert traces.empty?
61
+
62
+ # Second: We should trace show.js
63
+ clear_all_traces
64
+
65
+ get "/javascripts/show.js"
66
+
67
+ traces = get_all_traces
68
+ assert !traces.empty?
69
+
70
+ Oboe::Config[:dnt_regexp] = dnt_original
71
+ end
72
+ end
73
+
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: oboe
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.7.9.6
4
+ version: 2.7.10.1
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: 2015-01-27 00:00:00.000000000 Z
12
+ date: 2015-02-02 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: json
@@ -158,6 +158,7 @@ files:
158
158
  - test/minitest_helper.rb
159
159
  - test/profiling/method_test.rb
160
160
  - test/support/config_test.rb
161
+ - test/support/dnt_test.rb
161
162
  - test/support/liboboe_settings_test.rb
162
163
  - test/support/xtrace_test.rb
163
164
  homepage: http://www.appneta.com/products/traceview/
@@ -218,3 +219,4 @@ test_files:
218
219
  - test/support/liboboe_settings_test.rb
219
220
  - test/support/config_test.rb
220
221
  - test/support/xtrace_test.rb
222
+ - test/support/dnt_test.rb