traceview 3.0.4-java → 3.0.5-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: 5d7b1e15c3cb6b5b4ef34bd1b5861f4a771e4d8f
4
- data.tar.gz: 65fdda8e86ddf934c454eb518274f20c0541eb45
3
+ metadata.gz: 6ed3821a6292705e02ec4fff2d84e34da9c7c9cc
4
+ data.tar.gz: 5a033d814244dddae9e137c8bb23d76aeb56fbd0
5
5
  SHA512:
6
- metadata.gz: 355c101e8ae6f25c1d23bdd405f1ab983daa57a091eaa3193e37677047dce5fbd15e1e442bffd23e4966fba211318b8cd0daa05359bdba84dcd161945007db13
7
- data.tar.gz: d36d61c09d859c317362772510d8a6a0e2fb9d22164f58d7cdd5615c5423367a669c3a37209b1e312bb7e8b02a4aef6d74798e0207bb34e069612ac1a364a136
6
+ metadata.gz: fdb1e46cba04472ffa486012fef5da31cdb4c37a9bed5ecb7df10dab556b166b91818f86333cdff8b600fd962678f3d154f6749eb41fbeb5d83b0c53f69da422
7
+ data.tar.gz: 99f0b8bd3725297a5395c2fab358bba7cd3fb31c1f2fb5cc5a1f8da6312250f665082d2026cbf76508406487adc1f50da97671d169b89fc0ffd90cf6e192e514
@@ -38,7 +38,7 @@ module TraceView
38
38
  def do_request_with_traceview(method, uri, query, body, header, &block)
39
39
  # If we're not tracing, just do a fast return.
40
40
  if !TraceView.tracing?
41
- return request_without_traceview(method, uri, query, body, header, &block)
41
+ return do_request_without_traceview(method, uri, query, body, header, &block)
42
42
  end
43
43
 
44
44
  begin
@@ -97,11 +97,23 @@ module TraceView
97
97
  case op
98
98
  when :set
99
99
  if command.count > 3
100
- options = command[3]
101
- kvs[:ex] = options[:ex] if options.key?(:ex)
102
- kvs[:px] = options[:px] if options.key?(:px)
103
- kvs[:nx] = options[:nx] if options.key?(:nx)
104
- kvs[:xx] = options[:xx] if options.key?(:xx)
100
+ if command[3].is_a?(Hash)
101
+ options = command[3]
102
+ kvs[:ex] = options[:ex] if options.key?(:ex)
103
+ kvs[:px] = options[:px] if options.key?(:px)
104
+ kvs[:nx] = options[:nx] if options.key?(:nx)
105
+ kvs[:xx] = options[:xx] if options.key?(:xx)
106
+ else
107
+ options = command[3..-1]
108
+ until (opts = options.shift(2)).empty?
109
+ case opts[0]
110
+ when "EX"; kvs[:ex] = opts[1]
111
+ when "PX"; kvs[:px] = opts[1]
112
+ when "NX"; kvs[:nx] = opts[1]
113
+ when "XX"; kvs[:xx] = opts[1]
114
+ end
115
+ end
116
+ end
105
117
  end
106
118
 
107
119
  when :get
@@ -8,7 +8,7 @@ module TraceView
8
8
  module Version
9
9
  MAJOR = 3
10
10
  MINOR = 0
11
- PATCH = 4
11
+ PATCH = 5
12
12
  BUILD = nil
13
13
 
14
14
  STRING = [MAJOR, MINOR, PATCH, BUILD].compact.join('.')
@@ -295,5 +295,28 @@ class HTTPClientTest < Minitest::Test
295
295
 
296
296
  TraceView::Config[:httpclient][:log_args] = @log_args
297
297
  end
298
+
299
+ def test_without_tracing
300
+ clear_all_traces
301
+
302
+ @tm = TraceView::Config[:tracing_mode]
303
+ TraceView::Config[:tracing_mode] = :never
304
+
305
+ response = nil
306
+
307
+ TraceView::API.start_trace('httpclient_tests') do
308
+ clnt = HTTPClient.new
309
+ response = clnt.get('http://127.0.0.1:8101/', :query => { :keyword => 'ruby', :lang => 'en' })
310
+ end
311
+
312
+ xtrace = response.headers['X-Trace']
313
+ assert xtrace == nil
314
+
315
+ traces = get_all_traces
316
+
317
+ assert_equal traces.count, 0
318
+
319
+ TraceView::Config[:tracing_mode] = @tm
320
+ end
298
321
  end
299
322
 
@@ -266,6 +266,18 @@ if defined?(::Redis)
266
266
  traces[2]['KVKey'].must_equal "one"
267
267
  end
268
268
 
269
+ it "should trace set + expiration" do
270
+ TraceView::API.start_trace('redis_test', '', {}) do
271
+ @redis.set("one", "hello", :ex => 12)
272
+ end
273
+
274
+ traces = get_all_traces
275
+ traces.count.must_equal 4
276
+ traces[2]['KVOp'].must_equal "set"
277
+ traces[2]['KVKey'].must_equal "one"
278
+ traces[2]['ex'].must_equal 12
279
+ end
280
+
269
281
  it "should trace setbit" do
270
282
  min_server_version(2.2)
271
283
 
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.0.4
4
+ version: 3.0.5
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-07-08 00:00:00.000000000 Z
12
+ date: 2015-07-20 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: json