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,325 +1,328 @@
|
|
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 Sorted Sets" 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 zadd" do
|
29
|
+
min_server_version(1.2)
|
27
30
|
|
28
|
-
|
29
|
-
|
31
|
+
TraceView::API.start_trace('redis_test', '', {}) do
|
32
|
+
@redis.zadd("time", 0, "past")
|
33
|
+
end
|
34
|
+
|
35
|
+
traces = get_all_traces
|
36
|
+
traces.count.must_equal 4
|
37
|
+
traces[2]['KVOp'].must_equal "zadd"
|
38
|
+
traces[2]['KVKey'].must_equal "time"
|
30
39
|
end
|
31
40
|
|
32
|
-
|
33
|
-
|
34
|
-
traces[2]['KVOp'].must_equal "zadd"
|
35
|
-
traces[2]['KVKey'].must_equal "time"
|
36
|
-
end
|
41
|
+
it "should trace zcard" do
|
42
|
+
min_server_version(1.2)
|
37
43
|
|
38
|
-
|
39
|
-
|
44
|
+
@redis.zadd("sauce", 0, "bechamel")
|
45
|
+
@redis.zadd("sauce", 1, "veloute")
|
46
|
+
@redis.zadd("sauce", 2, "espagnole")
|
47
|
+
@redis.zadd("sauce", 3, "hollandaise")
|
48
|
+
@redis.zadd("sauce", 4, "classic tomate")
|
40
49
|
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
@redis.zadd("sauce", 3, "hollandaise")
|
45
|
-
@redis.zadd("sauce", 4, "classic tomate")
|
50
|
+
TraceView::API.start_trace('redis_test', '', {}) do
|
51
|
+
@redis.zcard("sauce")
|
52
|
+
end
|
46
53
|
|
47
|
-
|
48
|
-
|
54
|
+
traces = get_all_traces
|
55
|
+
traces.count.must_equal 4
|
56
|
+
traces[2]['KVOp'].must_equal "zcard"
|
57
|
+
traces[2]['KVKey'].must_equal "sauce"
|
49
58
|
end
|
50
59
|
|
51
|
-
|
52
|
-
|
53
|
-
traces[2]['KVOp'].must_equal "zcard"
|
54
|
-
traces[2]['KVKey'].must_equal "sauce"
|
55
|
-
end
|
60
|
+
it "should trace zcount" do
|
61
|
+
min_server_version(2.0)
|
56
62
|
|
57
|
-
|
58
|
-
|
63
|
+
@redis.zadd("sauce", 0, "bechamel")
|
64
|
+
@redis.zadd("sauce", 1, "veloute")
|
65
|
+
@redis.zadd("sauce", 2, "espagnole")
|
66
|
+
@redis.zadd("sauce", 3, "hollandaise")
|
67
|
+
@redis.zadd("sauce", 4, "classic tomate")
|
59
68
|
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
@redis.zadd("sauce", 3, "hollandaise")
|
64
|
-
@redis.zadd("sauce", 4, "classic tomate")
|
69
|
+
TraceView::API.start_trace('redis_test', '', {}) do
|
70
|
+
@redis.zcount("sauce", 1, 3)
|
71
|
+
end
|
65
72
|
|
66
|
-
|
67
|
-
|
73
|
+
traces = get_all_traces
|
74
|
+
traces.count.must_equal 4
|
75
|
+
traces[2]['KVOp'].must_equal "zcount"
|
76
|
+
traces[2]['KVKey'].must_equal "sauce"
|
68
77
|
end
|
69
78
|
|
70
|
-
|
71
|
-
|
72
|
-
traces[2]['KVOp'].must_equal "zcount"
|
73
|
-
traces[2]['KVKey'].must_equal "sauce"
|
74
|
-
end
|
79
|
+
it "should trace zincrby" do
|
80
|
+
min_server_version(1.2)
|
75
81
|
|
76
|
-
|
77
|
-
|
82
|
+
@redis.zadd("sauce", 0, "bechamel")
|
83
|
+
@redis.zadd("sauce", 1, "veloute")
|
84
|
+
@redis.zadd("sauce", 2, "espagnole")
|
85
|
+
@redis.zadd("sauce", 3, "hollandaise")
|
86
|
+
@redis.zadd("sauce", 4, "classic tomate")
|
78
87
|
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
@redis.zadd("sauce", 3, "hollandaise")
|
83
|
-
@redis.zadd("sauce", 4, "classic tomate")
|
88
|
+
TraceView::API.start_trace('redis_test', '', {}) do
|
89
|
+
@redis.zincrby("sauce", 1, "veloute")
|
90
|
+
end
|
84
91
|
|
85
|
-
|
86
|
-
|
92
|
+
traces = get_all_traces
|
93
|
+
traces.count.must_equal 4
|
94
|
+
traces[2]['KVOp'].must_equal "zincrby"
|
95
|
+
traces[2]['KVKey'].must_equal "sauce"
|
87
96
|
end
|
88
97
|
|
89
|
-
|
90
|
-
|
91
|
-
traces[2]['KVOp'].must_equal "zincrby"
|
92
|
-
traces[2]['KVKey'].must_equal "sauce"
|
93
|
-
end
|
98
|
+
it "should trace zinterstore" do
|
99
|
+
min_server_version(2.0)
|
94
100
|
|
95
|
-
|
96
|
-
|
101
|
+
@redis.zadd("sauce", 0, "bechamel")
|
102
|
+
@redis.zadd("sauce", 1, "veloute")
|
103
|
+
@redis.zadd("sauce", 2, "espagnole")
|
97
104
|
|
98
|
-
|
99
|
-
|
100
|
-
@redis.zadd("sauce", 2, "espagnole")
|
105
|
+
@redis.zadd("beverage", 0, "milkshake")
|
106
|
+
@redis.zadd("beverage", 1, "soda")
|
101
107
|
|
102
|
-
|
103
|
-
|
108
|
+
TraceView::API.start_trace('redis_test', '', {}) do
|
109
|
+
@redis.zinterstore("zinterstore_dest", [ "sauce", "beverage" ], :weights => [2, 3])
|
110
|
+
end
|
104
111
|
|
105
|
-
|
106
|
-
|
112
|
+
traces = get_all_traces
|
113
|
+
traces.count.must_equal 4
|
114
|
+
traces[2]['KVOp'].must_equal "zinterstore"
|
115
|
+
traces[2]['destination'].must_equal "zinterstore_dest"
|
116
|
+
traces[2].has_key?('KVKey').must_equal false
|
107
117
|
end
|
108
118
|
|
109
|
-
|
110
|
-
|
111
|
-
traces[2]['KVOp'].must_equal "zinterstore"
|
112
|
-
traces[2]['destination'].must_equal "zinterstore_dest"
|
113
|
-
traces[2].has_key?('KVKey').must_equal false
|
114
|
-
end
|
119
|
+
it "should trace zrange" do
|
120
|
+
min_server_version(1.2)
|
115
121
|
|
116
|
-
|
117
|
-
|
122
|
+
@redis.zadd("sauce", 0, "bechamel")
|
123
|
+
@redis.zadd("sauce", 1, "veloute")
|
124
|
+
@redis.zadd("sauce", 2, "espagnole")
|
125
|
+
@redis.zadd("sauce", 3, "hollandaise")
|
126
|
+
@redis.zadd("sauce", 4, "classic tomate")
|
118
127
|
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
@redis.zadd("sauce", 3, "hollandaise")
|
123
|
-
@redis.zadd("sauce", 4, "classic tomate")
|
128
|
+
TraceView::API.start_trace('redis_test', '', {}) do
|
129
|
+
@redis.zrange("sauce", 1, 3)
|
130
|
+
end
|
124
131
|
|
125
|
-
|
126
|
-
|
132
|
+
traces = get_all_traces
|
133
|
+
traces.count.must_equal 4
|
134
|
+
traces[2]['KVOp'].must_equal "zrange"
|
135
|
+
traces[2]['KVKey'].must_equal "sauce"
|
127
136
|
end
|
128
137
|
|
129
|
-
|
130
|
-
|
131
|
-
traces[2]['KVOp'].must_equal "zrange"
|
132
|
-
traces[2]['KVKey'].must_equal "sauce"
|
133
|
-
end
|
138
|
+
it "should trace zrangebyscore" do
|
139
|
+
min_server_version(1.0)
|
134
140
|
|
135
|
-
|
136
|
-
|
141
|
+
@redis.zadd("sauce", 0, "bechamel")
|
142
|
+
@redis.zadd("sauce", 1, "veloute")
|
143
|
+
@redis.zadd("sauce", 2, "espagnole")
|
144
|
+
@redis.zadd("sauce", 3, "hollandaise")
|
145
|
+
@redis.zadd("sauce", 4, "classic tomate")
|
137
146
|
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
@redis.zadd("sauce", 3, "hollandaise")
|
142
|
-
@redis.zadd("sauce", 4, "classic tomate")
|
147
|
+
TraceView::API.start_trace('redis_test', '', {}) do
|
148
|
+
@redis.zrangebyscore("sauce", "5", "(100")
|
149
|
+
end
|
143
150
|
|
144
|
-
|
145
|
-
|
151
|
+
traces = get_all_traces
|
152
|
+
traces.count.must_equal 4
|
153
|
+
traces[2]['KVOp'].must_equal "zrangebyscore"
|
154
|
+
traces[2]['KVKey'].must_equal "sauce"
|
146
155
|
end
|
147
156
|
|
148
|
-
|
149
|
-
|
150
|
-
traces[2]['KVOp'].must_equal "zrangebyscore"
|
151
|
-
traces[2]['KVKey'].must_equal "sauce"
|
152
|
-
end
|
157
|
+
it "should trace zrank" do
|
158
|
+
min_server_version(2.0)
|
153
159
|
|
154
|
-
|
155
|
-
|
160
|
+
@redis.zadd("sauce", 0, "bechamel")
|
161
|
+
@redis.zadd("sauce", 1, "veloute")
|
162
|
+
@redis.zadd("sauce", 2, "espagnole")
|
163
|
+
@redis.zadd("sauce", 3, "hollandaise")
|
164
|
+
@redis.zadd("sauce", 4, "classic tomate")
|
156
165
|
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
@redis.zadd("sauce", 3, "hollandaise")
|
161
|
-
@redis.zadd("sauce", 4, "classic tomate")
|
166
|
+
TraceView::API.start_trace('redis_test', '', {}) do
|
167
|
+
@redis.zrank("sauce", "veloute")
|
168
|
+
end
|
162
169
|
|
163
|
-
|
164
|
-
|
170
|
+
traces = get_all_traces
|
171
|
+
traces.count.must_equal 4
|
172
|
+
traces[2]['KVOp'].must_equal "zrank"
|
173
|
+
traces[2]['KVKey'].must_equal "sauce"
|
165
174
|
end
|
166
175
|
|
167
|
-
|
168
|
-
|
169
|
-
traces[2]['KVOp'].must_equal "zrank"
|
170
|
-
traces[2]['KVKey'].must_equal "sauce"
|
171
|
-
end
|
176
|
+
it "should trace zrem" do
|
177
|
+
min_server_version(1.2)
|
172
178
|
|
173
|
-
|
174
|
-
|
179
|
+
@redis.zadd("sauce", 0, "bechamel")
|
180
|
+
@redis.zadd("sauce", 1, "veloute")
|
181
|
+
@redis.zadd("sauce", 2, "espagnole")
|
182
|
+
@redis.zadd("sauce", 3, "hollandaise")
|
183
|
+
@redis.zadd("sauce", 4, "classic tomate")
|
175
184
|
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
@redis.zadd("sauce", 3, "hollandaise")
|
180
|
-
@redis.zadd("sauce", 4, "classic tomate")
|
185
|
+
TraceView::API.start_trace('redis_test', '', {}) do
|
186
|
+
@redis.zrem("sauce", "veloute")
|
187
|
+
end
|
181
188
|
|
182
|
-
|
183
|
-
|
189
|
+
traces = get_all_traces
|
190
|
+
traces.count.must_equal 4
|
191
|
+
traces[2]['KVOp'].must_equal "zrem"
|
192
|
+
traces[2]['KVKey'].must_equal "sauce"
|
184
193
|
end
|
185
194
|
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
195
|
+
it "should trace zremrangebyrank" do
|
196
|
+
min_server_version(2.0)
|
197
|
+
|
198
|
+
@redis.zadd("sauce", 0, "bechamel")
|
199
|
+
@redis.zadd("sauce", 1, "veloute")
|
200
|
+
@redis.zadd("sauce", 2, "espagnole")
|
201
|
+
@redis.zadd("sauce", 3, "hollandaise")
|
202
|
+
@redis.zadd("sauce", 4, "classic tomate")
|
203
|
+
|
204
|
+
TraceView::API.start_trace('redis_test', '', {}) do
|
205
|
+
@redis.zremrangebyrank("sauce", -5, -1)
|
206
|
+
end
|
207
|
+
|
208
|
+
traces = get_all_traces
|
209
|
+
traces.count.must_equal 4
|
210
|
+
traces[2]['KVOp'].must_equal "zremrangebyrank"
|
211
|
+
traces[2]['KVKey'].must_equal "sauce"
|
212
|
+
traces[2]['start'].must_equal (-5)
|
213
|
+
traces[2]['stop'].must_equal (-1)
|
203
214
|
end
|
204
215
|
|
205
|
-
|
206
|
-
|
207
|
-
traces[2]['KVOp'].must_equal "zremrangebyrank"
|
208
|
-
traces[2]['KVKey'].must_equal "sauce"
|
209
|
-
traces[2]['start'].must_equal -5
|
210
|
-
traces[2]['stop'].must_equal -1
|
211
|
-
end
|
216
|
+
it "should trace zremrangebyscore" do
|
217
|
+
min_server_version(1.2)
|
212
218
|
|
213
|
-
|
214
|
-
|
219
|
+
@redis.zadd("sauce", 0, "bechamel")
|
220
|
+
@redis.zadd("sauce", 1, "veloute")
|
221
|
+
@redis.zadd("sauce", 2, "espagnole")
|
222
|
+
@redis.zadd("sauce", 3, "hollandaise")
|
223
|
+
@redis.zadd("sauce", 4, "classic tomate")
|
215
224
|
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
@redis.zadd("sauce", 3, "hollandaise")
|
220
|
-
@redis.zadd("sauce", 4, "classic tomate")
|
225
|
+
TraceView::API.start_trace('redis_test', '', {}) do
|
226
|
+
@redis.zremrangebyscore("sauce", -5, -1)
|
227
|
+
end
|
221
228
|
|
222
|
-
|
223
|
-
|
229
|
+
traces = get_all_traces
|
230
|
+
traces.count.must_equal 4
|
231
|
+
traces[2]['KVOp'].must_equal "zremrangebyscore"
|
232
|
+
traces[2]['KVKey'].must_equal "sauce"
|
224
233
|
end
|
225
234
|
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
235
|
+
it "should trace zrevrange" do
|
236
|
+
min_server_version(1.2)
|
237
|
+
|
238
|
+
@redis.zadd("sauce", 0, "bechamel")
|
239
|
+
@redis.zadd("sauce", 1, "veloute")
|
240
|
+
@redis.zadd("sauce", 2, "espagnole")
|
241
|
+
@redis.zadd("sauce", 3, "hollandaise")
|
242
|
+
@redis.zadd("sauce", 4, "classic tomate")
|
243
|
+
|
244
|
+
TraceView::API.start_trace('redis_test', '', {}) do
|
245
|
+
@redis.zrevrange("sauce", 0, -1)
|
246
|
+
end
|
247
|
+
|
248
|
+
traces = get_all_traces
|
249
|
+
traces.count.must_equal 4
|
250
|
+
traces[2]['KVOp'].must_equal "zrevrange"
|
251
|
+
traces[2]['KVKey'].must_equal "sauce"
|
252
|
+
traces[2]['start'].must_equal 0
|
253
|
+
traces[2]['stop'].must_equal (-1)
|
243
254
|
end
|
244
255
|
|
245
|
-
|
246
|
-
|
247
|
-
traces[2]['KVOp'].must_equal "zrevrange"
|
248
|
-
traces[2]['KVKey'].must_equal "sauce"
|
249
|
-
traces[2]['start'].must_equal 0
|
250
|
-
traces[2]['stop'].must_equal -1
|
251
|
-
end
|
256
|
+
it "should trace zrevrangebyscore" do
|
257
|
+
min_server_version(1.2)
|
252
258
|
|
253
|
-
|
254
|
-
|
259
|
+
@redis.zadd("sauce", 0, "bechamel")
|
260
|
+
@redis.zadd("sauce", 1, "veloute")
|
261
|
+
@redis.zadd("sauce", 2, "espagnole")
|
262
|
+
@redis.zadd("sauce", 3, "hollandaise")
|
263
|
+
@redis.zadd("sauce", 4, "classic tomate")
|
255
264
|
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
@redis.zadd("sauce", 3, "hollandaise")
|
260
|
-
@redis.zadd("sauce", 4, "classic tomate")
|
265
|
+
TraceView::API.start_trace('redis_test', '', {}) do
|
266
|
+
@redis.zrevrangebyscore("sauce", "(100", "5")
|
267
|
+
end
|
261
268
|
|
262
|
-
|
263
|
-
|
269
|
+
traces = get_all_traces
|
270
|
+
traces.count.must_equal 4
|
271
|
+
traces[2]['KVOp'].must_equal "zrevrangebyscore"
|
272
|
+
traces[2]['KVKey'].must_equal "sauce"
|
264
273
|
end
|
265
274
|
|
266
|
-
|
267
|
-
|
268
|
-
traces[2]['KVOp'].must_equal "zrevrangebyscore"
|
269
|
-
traces[2]['KVKey'].must_equal "sauce"
|
270
|
-
end
|
275
|
+
it "should trace zrevrank" do
|
276
|
+
min_server_version(2.0)
|
271
277
|
|
272
|
-
|
273
|
-
|
278
|
+
@redis.zadd("letters", 0, "a")
|
279
|
+
@redis.zadd("letters", 1, "b")
|
280
|
+
@redis.zadd("letters", 1, "c")
|
274
281
|
|
275
|
-
|
276
|
-
|
277
|
-
|
282
|
+
TraceView::API.start_trace('redis_test', '', {}) do
|
283
|
+
@redis.zrevrank("letters", "c")
|
284
|
+
end
|
278
285
|
|
279
|
-
|
280
|
-
|
286
|
+
traces = get_all_traces
|
287
|
+
traces.count.must_equal 4
|
288
|
+
traces[2]['KVOp'].must_equal "zrevrank"
|
289
|
+
traces[2]['KVKey'].must_equal "letters"
|
281
290
|
end
|
282
291
|
|
283
|
-
|
284
|
-
|
285
|
-
traces[2]['KVOp'].must_equal "zrevrank"
|
286
|
-
traces[2]['KVKey'].must_equal "letters"
|
287
|
-
end
|
292
|
+
it "should trace zscore" do
|
293
|
+
min_server_version(1.2)
|
288
294
|
|
289
|
-
|
290
|
-
|
295
|
+
@redis.zadd("elements", 0, "fire")
|
296
|
+
@redis.zadd("elements", 1, "water")
|
297
|
+
@redis.zadd("elements", 1, "earth")
|
298
|
+
@redis.zadd("elements", 1, "air")
|
291
299
|
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
@redis.zadd("elements", 1, "air")
|
300
|
+
TraceView::API.start_trace('redis_test', '', {}) do
|
301
|
+
@redis.zscore("elements", "earth")
|
302
|
+
end
|
296
303
|
|
297
|
-
|
298
|
-
|
304
|
+
traces = get_all_traces
|
305
|
+
traces.count.must_equal 4
|
306
|
+
traces[2]['KVOp'].must_equal "zscore"
|
307
|
+
traces[2]['KVKey'].must_equal "elements"
|
299
308
|
end
|
300
309
|
|
301
|
-
|
302
|
-
|
303
|
-
traces[2]['KVOp'].must_equal "zscore"
|
304
|
-
traces[2]['KVKey'].must_equal "elements"
|
305
|
-
end
|
310
|
+
it "should trace zunionstore" do
|
311
|
+
min_server_version(1.0)
|
306
312
|
|
307
|
-
|
308
|
-
|
313
|
+
@redis.zadd("colors", 0, "blueish")
|
314
|
+
@redis.zadd("colors", 1, "yellowish")
|
315
|
+
@redis.zadd("codes", 0, "0xff")
|
309
316
|
|
310
|
-
|
311
|
-
|
312
|
-
|
317
|
+
TraceView::API.start_trace('redis_test', '', {}) do
|
318
|
+
@redis.zunionstore("zdest", ["colors", "codes"])
|
319
|
+
end
|
313
320
|
|
314
|
-
|
315
|
-
|
321
|
+
traces = get_all_traces
|
322
|
+
traces.count.must_equal 4
|
323
|
+
traces[2]['KVOp'].must_equal "zunionstore"
|
324
|
+
traces[2]['destination'].must_equal "zdest"
|
325
|
+
traces[2].has_key?('KVKey').must_equal false
|
316
326
|
end
|
317
|
-
|
318
|
-
traces = get_all_traces
|
319
|
-
traces.count.must_equal 4
|
320
|
-
traces[2]['KVOp'].must_equal "zunionstore"
|
321
|
-
traces[2]['destination'].must_equal "zdest"
|
322
|
-
traces[2].has_key?('KVKey').must_equal false
|
323
327
|
end
|
324
328
|
end
|
325
|
-
|