oboe 2.7.9.6-java → 2.7.10.1-java
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 +4 -4
- data/.travis.yml +1 -0
- data/lib/oboe/config.rb +28 -0
- data/lib/oboe/util.rb +1 -1
- data/lib/oboe/version.rb +2 -2
- data/test/support/config_test.rb +3 -1
- data/test/support/dnt_test.rb +73 -0
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1fcc957b05aaa4db312a9c3489c0afa9db8e7abc
|
4
|
+
data.tar.gz: 66c1e08d4e7a5347e639d5331fe18befd3ea65df
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 05e988b3c4820b76ac96cbaecda16b08d443449c444b8c083545f4b8fc5d27d3c35439eb2c9e56ac09d5970ed7652e0c7f7a4f71fb92e480ede3ecf12eb3e9cc
|
7
|
+
data.tar.gz: ca9686165ac5240eac0c4d706a73f16317362682c4a00e4108dc133c21fc24848373bfa152b1ecb7bd5ec8356215599070b6520f10cadbe274032c9fc6649261
|
data/.travis.yml
CHANGED
data/lib/oboe/config.rb
CHANGED
@@ -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'
|
data/lib/oboe/util.rb
CHANGED
@@ -103,7 +103,7 @@ module Oboe
|
|
103
103
|
# solely on filename)
|
104
104
|
#
|
105
105
|
def static_asset?(path)
|
106
|
-
(path =~
|
106
|
+
(path =~ Regexp.new(Oboe::Config[:dnt_regexp], Oboe::Config[:dnt_opts]))
|
107
107
|
end
|
108
108
|
|
109
109
|
##
|
data/lib/oboe/version.rb
CHANGED
data/test/support/config_test.rb
CHANGED
@@ -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.
|
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-
|
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
|