traceview 3.0.2 → 3.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +39 -14
- data/Gemfile +4 -62
- data/Rakefile +23 -8
- data/gemfiles/frameworks.gemfile +40 -0
- data/gemfiles/libraries.gemfile +78 -0
- data/gemfiles/rails23.gemfile +47 -0
- data/gemfiles/rails30.gemfile +47 -0
- data/gemfiles/rails31.gemfile +47 -0
- data/gemfiles/rails32.gemfile +47 -0
- data/gemfiles/rails40.gemfile +35 -0
- data/gemfiles/rails41.gemfile +35 -0
- data/gemfiles/rails42.gemfile +35 -0
- data/lib/traceview/api/logging.rb +84 -38
- data/lib/traceview/frameworks/rails/inst/action_controller.rb +1 -1
- data/lib/traceview/inst/moped.rb +2 -2
- data/lib/traceview/util.rb +30 -34
- data/lib/traceview/version.rb +1 -1
- data/test/frameworks/apps/grape_nested.rb +3 -0
- data/test/frameworks/apps/grape_simple.rb +3 -0
- data/test/frameworks/apps/sinatra_simple.rb +3 -0
- data/test/frameworks/grape_test.rb +8 -4
- data/test/frameworks/padrino_test.rb +6 -2
- data/test/frameworks/rails2x_test.rb +3 -0
- data/test/frameworks/rails3x_test.rb +91 -0
- data/test/frameworks/rails4x_test.rb +89 -0
- data/test/frameworks/sinatra_test.rb +3 -0
- data/test/instrumentation/cassandra_test.rb +11 -4
- data/test/instrumentation/dalli_test.rb +3 -0
- data/test/instrumentation/em_http_request_test.rb +3 -0
- data/test/instrumentation/excon_test.rb +3 -0
- data/test/instrumentation/faraday_test.rb +3 -0
- data/test/instrumentation/http_test.rb +3 -0
- data/test/instrumentation/httpclient_test.rb +3 -0
- data/test/instrumentation/memcache_test.rb +9 -0
- data/test/instrumentation/memcached_test.rb +3 -0
- data/test/instrumentation/mongo_test.rb +14 -3
- data/test/instrumentation/moped_test.rb +29 -6
- data/test/instrumentation/rack_test.rb +3 -0
- data/test/instrumentation/redis_hashes_test.rb +187 -184
- data/test/instrumentation/redis_keys_test.rb +223 -220
- data/test/instrumentation/redis_lists_test.rb +225 -225
- data/test/instrumentation/redis_misc_test.rb +123 -120
- data/test/instrumentation/redis_sets_test.rb +216 -213
- data/test/instrumentation/redis_sortedsets_test.rb +245 -242
- data/test/instrumentation/redis_strings_test.rb +242 -238
- data/test/instrumentation/resque_test.rb +3 -0
- data/test/instrumentation/rest-client_test.rb +3 -0
- data/test/instrumentation/sequel_mysql2_test.rb +4 -1
- data/test/instrumentation/sequel_mysql_test.rb +4 -1
- data/test/instrumentation/sequel_pg_test.rb +4 -1
- data/test/minitest_helper.rb +25 -8
- data/test/profiling/method_test.rb +3 -0
- data/test/servers/rackapp_8101.rb +1 -1
- data/test/servers/rails2x_8140.rb +2 -2
- data/test/servers/rails3x_8140.rb +78 -0
- data/test/servers/rails4x_8140.rb +78 -0
- data/test/support/backcompat_test.rb +3 -0
- data/test/support/config_test.rb +3 -0
- data/test/support/dnt_test.rb +3 -0
- data/test/support/liboboe_settings_test.rb +3 -0
- data/test/support/tvalias_test.rb +3 -0
- data/test/support/xtrace_test.rb +3 -0
- metadata +19 -5
- data/Appraisals +0 -10
- data/gemfiles/mongo.gemfile +0 -33
- data/gemfiles/moped.gemfile +0 -33
@@ -1,333 +1,337 @@
|
|
1
|
+
# Copyright (c) 2015 AppNeta, Inc.
|
2
|
+
# All rights reserved.
|
3
|
+
|
1
4
|
require 'minitest_helper'
|
2
|
-
require "redis"
|
3
5
|
|
4
|
-
|
5
|
-
|
6
|
+
if defined?(::Redis)
|
7
|
+
describe "Redis Strings" do
|
8
|
+
attr_reader :entry_kvs, :exit_kvs, :redis, :redis_version
|
6
9
|
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
+
def min_server_version(version)
|
11
|
+
unless Gem::Version.new(@redis_version) >= Gem::Version.new(version.to_s)
|
12
|
+
skip "supported only on redis-server #{version} or greater"
|
13
|
+
end
|
10
14
|
end
|
11
|
-
end
|
12
15
|
|
13
|
-
|
14
|
-
|
16
|
+
before do
|
17
|
+
clear_all_traces
|
15
18
|
|
16
|
-
|
19
|
+
@redis ||= Redis.new
|
17
20
|
|
18
|
-
|
21
|
+
@redis_version ||= @redis.info["redis_version"]
|
19
22
|
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
23
|
+
# These are standard entry/exit KVs that are passed up with all moped operations
|
24
|
+
@entry_kvs ||= { 'Layer' => 'redis_test', 'Label' => 'entry' }
|
25
|
+
@exit_kvs ||= { 'Layer' => 'redis_test', 'Label' => 'exit' }
|
26
|
+
end
|
24
27
|
|
25
|
-
|
26
|
-
|
28
|
+
it "should trace append" do
|
29
|
+
@redis.set("yourkey", "test")
|
27
30
|
|
28
|
-
|
29
|
-
|
31
|
+
TraceView::API.start_trace('redis_test', '', {}) do
|
32
|
+
@redis.append("yourkey", "blah")
|
33
|
+
end
|
34
|
+
|
35
|
+
traces = get_all_traces
|
36
|
+
traces.count.must_equal 4
|
37
|
+
traces[2]['KVOp'].must_equal "append"
|
38
|
+
traces[2]['KVKey'].must_equal "yourkey"
|
30
39
|
end
|
31
40
|
|
32
|
-
|
33
|
-
traces.count.must_equal 4
|
34
|
-
traces[2]['KVOp'].must_equal "append"
|
35
|
-
traces[2]['KVKey'].must_equal "yourkey"
|
36
|
-
end
|
41
|
+
it "should trace bitcount (>=2.6)" do
|
37
42
|
|
38
|
-
|
43
|
+
min_server_version("2.6")
|
39
44
|
|
40
|
-
|
45
|
+
TraceView::API.start_trace('redis_test', '', {}) do
|
46
|
+
@redis.bitcount("yourkey")
|
47
|
+
end
|
41
48
|
|
42
|
-
|
43
|
-
|
49
|
+
traces = get_all_traces
|
50
|
+
traces.count.must_equal 4
|
51
|
+
traces[2]['KVOp'].must_equal "bitcount"
|
52
|
+
traces[2]['start'].must_equal 0
|
53
|
+
traces[2]['stop'].must_equal (-1)
|
44
54
|
end
|
45
55
|
|
46
|
-
|
47
|
-
traces.count.must_equal 4
|
48
|
-
traces[2]['KVOp'].must_equal "bitcount"
|
49
|
-
traces[2]['start'].must_equal 0
|
50
|
-
traces[2]['stop'].must_equal -1
|
51
|
-
end
|
56
|
+
it "should trace bitop (>=2.6)" do
|
52
57
|
|
53
|
-
|
58
|
+
min_server_version("2.6")
|
54
59
|
|
55
|
-
|
60
|
+
TraceView::API.start_trace('redis_test', '', {}) do
|
61
|
+
@redis.bitop("not", "bitopkey", "yourkey")
|
62
|
+
end
|
56
63
|
|
57
|
-
|
58
|
-
|
64
|
+
traces = get_all_traces
|
65
|
+
traces.count.must_equal 4
|
66
|
+
traces[2]['KVOp'].must_equal "bitop"
|
67
|
+
traces[2]['operation'].must_equal "not"
|
68
|
+
traces[2]['destkey'].must_equal "bitopkey"
|
59
69
|
end
|
60
70
|
|
61
|
-
|
62
|
-
|
63
|
-
traces[2]['KVOp'].must_equal "bitop"
|
64
|
-
traces[2]['operation'].must_equal "not"
|
65
|
-
traces[2]['destkey'].must_equal "bitopkey"
|
66
|
-
end
|
71
|
+
it "should trace decr" do
|
72
|
+
@redis.setex("decr", 60, 0)
|
67
73
|
|
68
|
-
|
69
|
-
|
74
|
+
TraceView::API.start_trace('redis_test', '', {}) do
|
75
|
+
@redis.decr("decr")
|
76
|
+
end
|
70
77
|
|
71
|
-
|
72
|
-
|
78
|
+
traces = get_all_traces
|
79
|
+
traces.count.must_equal 4
|
80
|
+
traces[2]['KVOp'].must_equal "decr"
|
81
|
+
traces[2]['KVKey'].must_equal "decr"
|
73
82
|
end
|
74
83
|
|
75
|
-
|
76
|
-
|
77
|
-
traces[2]['KVOp'].must_equal "decr"
|
78
|
-
traces[2]['KVKey'].must_equal "decr"
|
79
|
-
end
|
84
|
+
it "should trace decrby" do
|
85
|
+
@redis.setex("decr", 60, 0)
|
80
86
|
|
81
|
-
|
82
|
-
|
87
|
+
TraceView::API.start_trace('redis_test', '', {}) do
|
88
|
+
@redis.decrby("decr", 1)
|
89
|
+
end
|
83
90
|
|
84
|
-
|
85
|
-
|
91
|
+
traces = get_all_traces
|
92
|
+
traces.count.must_equal 4
|
93
|
+
traces[2]['KVOp'].must_equal "decrby"
|
94
|
+
traces[2]['KVKey'].must_equal "decr"
|
95
|
+
traces[2]['decrement'].must_equal 1
|
86
96
|
end
|
87
97
|
|
88
|
-
|
89
|
-
|
90
|
-
traces[2]['KVOp'].must_equal "decrby"
|
91
|
-
traces[2]['KVKey'].must_equal "decr"
|
92
|
-
traces[2]['decrement'].must_equal 1
|
93
|
-
end
|
98
|
+
it "should trace get" do
|
99
|
+
@redis.setex("diwore", 60, "okokok")
|
94
100
|
|
95
|
-
|
96
|
-
|
101
|
+
TraceView::API.start_trace('redis_test', '', {}) do
|
102
|
+
@rv = @redis.get("diwore")
|
103
|
+
end
|
97
104
|
|
98
|
-
|
99
|
-
@rv = @redis.get("diwore")
|
100
|
-
end
|
105
|
+
@rv.must_equal "okokok"
|
101
106
|
|
102
|
-
|
107
|
+
traces = get_all_traces
|
108
|
+
traces.count.must_equal 4
|
109
|
+
traces[2]['KVOp'].must_equal "get"
|
110
|
+
traces[2]['KVKey'].must_equal "diwore"
|
111
|
+
end
|
103
112
|
|
104
|
-
|
105
|
-
|
106
|
-
traces[2]['KVOp'].must_equal "get"
|
107
|
-
traces[2]['KVKey'].must_equal "diwore"
|
108
|
-
end
|
113
|
+
it "should trace getbit" do
|
114
|
+
min_server_version(2.2)
|
109
115
|
|
110
|
-
|
111
|
-
min_server_version(2.2)
|
116
|
+
@redis.setex("diwore", 60, "okokok")
|
112
117
|
|
113
|
-
|
118
|
+
TraceView::API.start_trace('redis_test', '', {}) do
|
119
|
+
@redis.getbit("diwore", 3)
|
120
|
+
end
|
114
121
|
|
115
|
-
|
116
|
-
|
122
|
+
traces = get_all_traces
|
123
|
+
traces.count.must_equal 4
|
124
|
+
traces[2]['KVOp'].must_equal "getbit"
|
125
|
+
traces[2]['KVKey'].must_equal "diwore"
|
126
|
+
traces[2]['offset'].must_equal 3
|
117
127
|
end
|
118
128
|
|
119
|
-
|
120
|
-
|
121
|
-
traces[2]['KVOp'].must_equal "getbit"
|
122
|
-
traces[2]['KVKey'].must_equal "diwore"
|
123
|
-
traces[2]['offset'].must_equal 3
|
124
|
-
end
|
129
|
+
it "should trace getrange" do
|
130
|
+
min_server_version(2.2)
|
125
131
|
|
126
|
-
|
127
|
-
|
132
|
+
TraceView::API.start_trace('redis_test', '', {}) do
|
133
|
+
@redis.getrange("yourkey", 0, 3)
|
134
|
+
end
|
128
135
|
|
129
|
-
|
130
|
-
|
136
|
+
traces = get_all_traces
|
137
|
+
traces.count.must_equal 4
|
138
|
+
traces[2]['KVOp'].must_equal "getrange"
|
139
|
+
traces[2]['KVKey'].must_equal "yourkey"
|
140
|
+
traces[2]['start'].must_equal 0
|
141
|
+
traces[2]['end'].must_equal 3
|
131
142
|
end
|
132
143
|
|
133
|
-
|
134
|
-
|
135
|
-
traces[2]['KVOp'].must_equal "getrange"
|
136
|
-
traces[2]['KVKey'].must_equal "yourkey"
|
137
|
-
traces[2]['start'].must_equal 0
|
138
|
-
traces[2]['end'].must_equal 3
|
139
|
-
end
|
144
|
+
it "should trace getset" do
|
145
|
+
min_server_version(2.2)
|
140
146
|
|
141
|
-
|
142
|
-
|
147
|
+
TraceView::API.start_trace('redis_test', '', {}) do
|
148
|
+
@redis.getset("dollar", 0)
|
149
|
+
end
|
143
150
|
|
144
|
-
|
145
|
-
|
151
|
+
traces = get_all_traces
|
152
|
+
traces.count.must_equal 4
|
153
|
+
traces[2]['KVOp'].must_equal "getset"
|
154
|
+
traces[2]['KVKey'].must_equal "dollar"
|
155
|
+
traces[2]['value'].must_equal "0"
|
146
156
|
end
|
147
157
|
|
148
|
-
|
149
|
-
|
150
|
-
traces[2]['KVOp'].must_equal "getset"
|
151
|
-
traces[2]['KVKey'].must_equal "dollar"
|
152
|
-
traces[2]['value'].must_equal "0"
|
153
|
-
end
|
158
|
+
it "should trace incr" do
|
159
|
+
@redis.setex("dotcom", 60, 0)
|
154
160
|
|
155
|
-
|
156
|
-
|
161
|
+
TraceView::API.start_trace('redis_test', '', {}) do
|
162
|
+
@redis.incr("dotcom")
|
163
|
+
end
|
157
164
|
|
158
|
-
|
159
|
-
|
165
|
+
traces = get_all_traces
|
166
|
+
traces.count.must_equal 4
|
167
|
+
traces[2]['KVOp'].must_equal "incr"
|
168
|
+
traces[2]['KVKey'].must_equal "dotcom"
|
160
169
|
end
|
161
170
|
|
162
|
-
|
163
|
-
|
164
|
-
traces[2]['KVOp'].must_equal "incr"
|
165
|
-
traces[2]['KVKey'].must_equal "dotcom"
|
166
|
-
end
|
171
|
+
it "should trace incrby" do
|
172
|
+
@redis.setex("incr", 60, 0)
|
167
173
|
|
168
|
-
|
169
|
-
|
174
|
+
TraceView::API.start_trace('redis_test', '', {}) do
|
175
|
+
@redis.incrby("incr", 1)
|
176
|
+
end
|
170
177
|
|
171
|
-
|
172
|
-
|
178
|
+
traces = get_all_traces
|
179
|
+
traces.count.must_equal 4
|
180
|
+
traces[2]['KVOp'].must_equal "incrby"
|
181
|
+
traces[2]['KVKey'].must_equal "incr"
|
182
|
+
traces[2]['increment'].must_equal 1
|
173
183
|
end
|
174
184
|
|
175
|
-
|
176
|
-
|
177
|
-
traces[2]['KVOp'].must_equal "incrby"
|
178
|
-
traces[2]['KVKey'].must_equal "incr"
|
179
|
-
traces[2]['increment'].must_equal 1
|
180
|
-
end
|
185
|
+
it "should trace incrbyfloat" do
|
186
|
+
min_server_version(2.6)
|
181
187
|
|
182
|
-
|
183
|
-
min_server_version(2.6)
|
188
|
+
@redis.setex("incrfloat", 60, 0.0)
|
184
189
|
|
185
|
-
|
190
|
+
TraceView::API.start_trace('redis_test', '', {}) do
|
191
|
+
@redis.incrbyfloat("incrfloat", 1.01)
|
192
|
+
end
|
186
193
|
|
187
|
-
|
188
|
-
|
194
|
+
traces = get_all_traces
|
195
|
+
traces.count.must_equal 4
|
196
|
+
traces[2]['KVOp'].must_equal "incrbyfloat"
|
197
|
+
traces[2]['KVKey'].must_equal "incrfloat"
|
198
|
+
traces[2]['increment'].must_equal 1.01
|
189
199
|
end
|
190
200
|
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
201
|
+
it "should trace mget" do
|
202
|
+
@redis.setex("france", 60, "ok")
|
203
|
+
@redis.setex("denmark", 60, "ok")
|
204
|
+
@redis.setex("germany", 60, "ok")
|
205
|
+
|
206
|
+
TraceView::API.start_trace('redis_test', '', {}) do
|
207
|
+
@redis.mget(["france", "nothing", "denmark"])
|
208
|
+
@redis.mget("germany")
|
209
|
+
end
|
210
|
+
|
211
|
+
traces = get_all_traces
|
212
|
+
traces.count.must_equal 6
|
213
|
+
traces[2]['KVOp'].must_equal "mget"
|
214
|
+
traces[2]['KVKeyCount'].must_equal 3
|
215
|
+
traces[2]['KVHitCount'].must_equal 2
|
216
|
+
traces[4]['KVOp'].must_equal "mget"
|
217
|
+
traces[4]['KVKeyCount'].must_equal 1
|
218
|
+
traces[4]['KVHitCount'].must_equal 1
|
206
219
|
end
|
207
220
|
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
@redis.mset(["one", 1, "two", 2, "three", 3])
|
221
|
-
@redis.mset("one", 1)
|
221
|
+
it "should trace mset" do
|
222
|
+
TraceView::API.start_trace('redis_test', '', {}) do
|
223
|
+
@redis.mset(["one", 1, "two", 2, "three", 3])
|
224
|
+
@redis.mset("one", 1)
|
225
|
+
end
|
226
|
+
|
227
|
+
traces = get_all_traces
|
228
|
+
traces.count.must_equal 6
|
229
|
+
traces[2]['KVOp'].must_equal "mset"
|
230
|
+
traces[2]['KVKeyCount'].must_equal 3
|
231
|
+
traces[4]['KVOp'].must_equal "mset"
|
232
|
+
traces[4]['KVKeyCount'].must_equal 1
|
222
233
|
end
|
223
234
|
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
traces[4]['KVOp'].must_equal "mset"
|
229
|
-
traces[4]['KVKeyCount'].must_equal 1
|
230
|
-
end
|
235
|
+
it "should trace msetnx" do
|
236
|
+
TraceView::API.start_trace('redis_test', '', {}) do
|
237
|
+
@redis.msetnx(["one", 1, "two", 2, "three", 3])
|
238
|
+
end
|
231
239
|
|
232
|
-
|
233
|
-
|
234
|
-
|
240
|
+
traces = get_all_traces
|
241
|
+
traces.count.must_equal 4
|
242
|
+
traces[2]['KVOp'].must_equal "msetnx"
|
235
243
|
end
|
236
244
|
|
237
|
-
|
238
|
-
traces.count.must_equal 4
|
239
|
-
traces[2]['KVOp'].must_equal "msetnx"
|
240
|
-
end
|
245
|
+
it "should trace psetex (>= v2.6)" do
|
241
246
|
|
242
|
-
|
247
|
+
TraceView::API.start_trace('redis_test', '', {}) do
|
248
|
+
@redis.psetex("one", 60, "hello")
|
249
|
+
end
|
243
250
|
|
244
|
-
|
245
|
-
|
251
|
+
traces = get_all_traces
|
252
|
+
traces.count.must_equal 4
|
253
|
+
traces[2]['KVOp'].must_equal "psetex"
|
254
|
+
traces[2]['KVKey'].must_equal "one"
|
255
|
+
traces[2]['ttl'].must_equal 60
|
246
256
|
end
|
247
257
|
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
traces[2]['ttl'].must_equal 60
|
253
|
-
end
|
258
|
+
it "should trace basic set" do
|
259
|
+
TraceView::API.start_trace('redis_test', '', {}) do
|
260
|
+
@redis.set("one", "hello")
|
261
|
+
end
|
254
262
|
|
255
|
-
|
256
|
-
|
257
|
-
|
263
|
+
traces = get_all_traces
|
264
|
+
traces.count.must_equal 4
|
265
|
+
traces[2]['KVOp'].must_equal "set"
|
266
|
+
traces[2]['KVKey'].must_equal "one"
|
258
267
|
end
|
259
268
|
|
260
|
-
|
261
|
-
|
262
|
-
traces[2]['KVOp'].must_equal "set"
|
263
|
-
traces[2]['KVKey'].must_equal "one"
|
264
|
-
end
|
269
|
+
it "should trace setbit" do
|
270
|
+
min_server_version(2.2)
|
265
271
|
|
266
|
-
|
267
|
-
|
272
|
+
TraceView::API.start_trace('redis_test', '', {}) do
|
273
|
+
@redis.setbit("yourkey", 3, 0)
|
274
|
+
end
|
268
275
|
|
269
|
-
|
270
|
-
|
276
|
+
traces = get_all_traces
|
277
|
+
traces.count.must_equal 4
|
278
|
+
traces[2]['KVOp'].must_equal "setbit"
|
279
|
+
traces[2]['KVKey'].must_equal "yourkey"
|
280
|
+
traces[2]['offset'].must_equal 3
|
271
281
|
end
|
272
282
|
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
traces[2]['offset'].must_equal 3
|
278
|
-
end
|
283
|
+
it "should trace setex" do
|
284
|
+
TraceView::API.start_trace('redis_test', '', {}) do
|
285
|
+
@redis.setex("one", 60, "hello")
|
286
|
+
end
|
279
287
|
|
280
|
-
|
281
|
-
|
282
|
-
|
288
|
+
traces = get_all_traces
|
289
|
+
traces.count.must_equal 4
|
290
|
+
traces[2]['KVOp'].must_equal "setex"
|
291
|
+
traces[2]['KVKey'].must_equal "one"
|
292
|
+
traces[2]['ttl'].must_equal 60
|
283
293
|
end
|
284
294
|
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
traces[2]['ttl'].must_equal 60
|
290
|
-
end
|
295
|
+
it "should trace setnx" do
|
296
|
+
TraceView::API.start_trace('redis_test', '', {}) do
|
297
|
+
@redis.setnx("one", "hello")
|
298
|
+
end
|
291
299
|
|
292
|
-
|
293
|
-
|
294
|
-
|
300
|
+
traces = get_all_traces
|
301
|
+
traces.count.must_equal 4
|
302
|
+
traces[2]['KVOp'].must_equal "setnx"
|
303
|
+
traces[2]['KVKey'].must_equal "one"
|
295
304
|
end
|
296
305
|
|
297
|
-
|
298
|
-
|
299
|
-
traces[2]['KVOp'].must_equal "setnx"
|
300
|
-
traces[2]['KVKey'].must_equal "one"
|
301
|
-
end
|
306
|
+
it "should trace setrange" do
|
307
|
+
min_server_version(2.2)
|
302
308
|
|
303
|
-
|
304
|
-
min_server_version(2.2)
|
309
|
+
@redis.setex("spandau_ballet", 60, "XXXXXXXXXXXXXXX")
|
305
310
|
|
306
|
-
|
311
|
+
TraceView::API.start_trace('redis_test', '', {}) do
|
312
|
+
@redis.setrange("yourkey", 2, "ok")
|
313
|
+
end
|
307
314
|
|
308
|
-
|
309
|
-
|
315
|
+
traces = get_all_traces
|
316
|
+
traces.count.must_equal 4
|
317
|
+
traces[2]['KVOp'].must_equal "setrange"
|
318
|
+
traces[2]['KVKey'].must_equal "yourkey"
|
319
|
+
traces[2]['offset'].must_equal 2
|
310
320
|
end
|
311
321
|
|
312
|
-
|
313
|
-
|
314
|
-
traces[2]['KVOp'].must_equal "setrange"
|
315
|
-
traces[2]['KVKey'].must_equal "yourkey"
|
316
|
-
traces[2]['offset'].must_equal 2
|
317
|
-
end
|
322
|
+
it "should trace strlen" do
|
323
|
+
min_server_version(2.2)
|
318
324
|
|
319
|
-
|
320
|
-
min_server_version(2.2)
|
325
|
+
@redis.setex("talking_heads", 60, "burning down the house")
|
321
326
|
|
322
|
-
|
327
|
+
TraceView::API.start_trace('redis_test', '', {}) do
|
328
|
+
@redis.strlen("talking_heads")
|
329
|
+
end
|
323
330
|
|
324
|
-
|
325
|
-
|
331
|
+
traces = get_all_traces
|
332
|
+
traces.count.must_equal 4
|
333
|
+
traces[2]['KVOp'].must_equal "strlen"
|
334
|
+
traces[2]['KVKey'].must_equal "talking_heads"
|
326
335
|
end
|
327
|
-
|
328
|
-
traces = get_all_traces
|
329
|
-
traces.count.must_equal 4
|
330
|
-
traces[2]['KVOp'].must_equal "strlen"
|
331
|
-
traces[2]['KVKey'].must_equal "talking_heads"
|
332
336
|
end
|
333
337
|
end
|