oboe 2.7.9.6 → 2.7.10.1
Sign up to get free protection for your applications and to get access to all the features.
- 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: e8bb2b787b9dc0d9063cbf0fa36b421d845f2d0f
|
4
|
+
data.tar.gz: 3136a7df38094cead5f1c5cc9b78b90acfb6cd9f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 38fa91f208a17c8edc5543b0c7c87f792e5ef1631ec76924ee83b897ad88b13a2c7b7a1a55ed3ed5e5c4a2d3044ad529d1870181aac42a4b404b94784f8d4e3e
|
7
|
+
data.tar.gz: 678572388e75bd7f83e0e68a7009f69cf9799054ef8c26e0d28c3a14e722874f3d51187829597a06b852ce32515d4c83d6582fe1ba6c4b1ed55a8e2a68b5d456
|
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: ruby
|
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
|
@@ -160,6 +160,7 @@ files:
|
|
160
160
|
- test/minitest_helper.rb
|
161
161
|
- test/profiling/method_test.rb
|
162
162
|
- test/support/config_test.rb
|
163
|
+
- test/support/dnt_test.rb
|
163
164
|
- test/support/liboboe_settings_test.rb
|
164
165
|
- test/support/xtrace_test.rb
|
165
166
|
homepage: http://www.appneta.com/products/traceview/
|
@@ -220,3 +221,4 @@ test_files:
|
|
220
221
|
- test/support/liboboe_settings_test.rb
|
221
222
|
- test/support/config_test.rb
|
222
223
|
- test/support/xtrace_test.rb
|
224
|
+
- test/support/dnt_test.rb
|