traceview 3.0.2-java → 3.0.3-java

Sign up to get free protection for your applications and to get access to all the features.
Files changed (67) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +39 -14
  3. data/Gemfile +4 -62
  4. data/Rakefile +23 -8
  5. data/gemfiles/frameworks.gemfile +40 -0
  6. data/gemfiles/libraries.gemfile +78 -0
  7. data/gemfiles/rails23.gemfile +47 -0
  8. data/gemfiles/rails30.gemfile +47 -0
  9. data/gemfiles/rails31.gemfile +47 -0
  10. data/gemfiles/rails32.gemfile +47 -0
  11. data/gemfiles/rails40.gemfile +35 -0
  12. data/gemfiles/rails41.gemfile +35 -0
  13. data/gemfiles/rails42.gemfile +35 -0
  14. data/lib/traceview/api/logging.rb +84 -38
  15. data/lib/traceview/frameworks/rails/inst/action_controller.rb +1 -1
  16. data/lib/traceview/inst/moped.rb +2 -2
  17. data/lib/traceview/util.rb +30 -34
  18. data/lib/traceview/version.rb +1 -1
  19. data/test/frameworks/apps/grape_nested.rb +3 -0
  20. data/test/frameworks/apps/grape_simple.rb +3 -0
  21. data/test/frameworks/apps/sinatra_simple.rb +3 -0
  22. data/test/frameworks/grape_test.rb +8 -4
  23. data/test/frameworks/padrino_test.rb +6 -2
  24. data/test/frameworks/rails2x_test.rb +3 -0
  25. data/test/frameworks/rails3x_test.rb +91 -0
  26. data/test/frameworks/rails4x_test.rb +89 -0
  27. data/test/frameworks/sinatra_test.rb +3 -0
  28. data/test/instrumentation/cassandra_test.rb +11 -4
  29. data/test/instrumentation/dalli_test.rb +3 -0
  30. data/test/instrumentation/em_http_request_test.rb +3 -0
  31. data/test/instrumentation/excon_test.rb +3 -0
  32. data/test/instrumentation/faraday_test.rb +3 -0
  33. data/test/instrumentation/http_test.rb +3 -0
  34. data/test/instrumentation/httpclient_test.rb +3 -0
  35. data/test/instrumentation/memcache_test.rb +9 -0
  36. data/test/instrumentation/memcached_test.rb +3 -0
  37. data/test/instrumentation/mongo_test.rb +14 -3
  38. data/test/instrumentation/moped_test.rb +29 -6
  39. data/test/instrumentation/rack_test.rb +3 -0
  40. data/test/instrumentation/redis_hashes_test.rb +187 -184
  41. data/test/instrumentation/redis_keys_test.rb +223 -220
  42. data/test/instrumentation/redis_lists_test.rb +225 -225
  43. data/test/instrumentation/redis_misc_test.rb +123 -120
  44. data/test/instrumentation/redis_sets_test.rb +216 -213
  45. data/test/instrumentation/redis_sortedsets_test.rb +245 -242
  46. data/test/instrumentation/redis_strings_test.rb +242 -238
  47. data/test/instrumentation/resque_test.rb +3 -0
  48. data/test/instrumentation/rest-client_test.rb +3 -0
  49. data/test/instrumentation/sequel_mysql2_test.rb +4 -1
  50. data/test/instrumentation/sequel_mysql_test.rb +4 -1
  51. data/test/instrumentation/sequel_pg_test.rb +4 -1
  52. data/test/minitest_helper.rb +25 -8
  53. data/test/profiling/method_test.rb +3 -0
  54. data/test/servers/rackapp_8101.rb +1 -1
  55. data/test/servers/rails2x_8140.rb +2 -2
  56. data/test/servers/rails3x_8140.rb +78 -0
  57. data/test/servers/rails4x_8140.rb +78 -0
  58. data/test/support/backcompat_test.rb +3 -0
  59. data/test/support/config_test.rb +3 -0
  60. data/test/support/dnt_test.rb +3 -0
  61. data/test/support/liboboe_settings_test.rb +3 -0
  62. data/test/support/tvalias_test.rb +3 -0
  63. data/test/support/xtrace_test.rb +3 -0
  64. metadata +19 -5
  65. data/Appraisals +0 -10
  66. data/gemfiles/mongo.gemfile +0 -33
  67. 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
- describe "Redis Sorted Sets" do
5
- attr_reader :entry_kvs, :exit_kvs, :redis, :redis_version
6
+ if defined?(::Redis)
7
+ describe "Redis Sorted Sets" do
8
+ attr_reader :entry_kvs, :exit_kvs, :redis, :redis_version
6
9
 
7
- def min_server_version(version)
8
- unless Gem::Version.new(@redis_version) >= Gem::Version.new(version.to_s)
9
- skip "supported only on redis-server #{version} or greater"
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
- before do
14
- clear_all_traces
16
+ before do
17
+ clear_all_traces
15
18
 
16
- @redis ||= Redis.new
19
+ @redis ||= Redis.new
17
20
 
18
- @redis_version ||= @redis.info["redis_version"]
21
+ @redis_version ||= @redis.info["redis_version"]
19
22
 
20
- # These are standard entry/exit KVs that are passed up with all moped operations
21
- @entry_kvs ||= { 'Layer' => 'redis_test', 'Label' => 'entry' }
22
- @exit_kvs ||= { 'Layer' => 'redis_test', 'Label' => 'exit' }
23
- end
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
- it "should trace zadd" do
26
- min_server_version(1.2)
28
+ it "should trace zadd" do
29
+ min_server_version(1.2)
27
30
 
28
- TraceView::API.start_trace('redis_test', '', {}) do
29
- @redis.zadd("time", 0, "past")
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
- traces = get_all_traces
33
- traces.count.must_equal 4
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
- it "should trace zcard" do
39
- min_server_version(1.2)
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
- @redis.zadd("sauce", 0, "bechamel")
42
- @redis.zadd("sauce", 1, "veloute")
43
- @redis.zadd("sauce", 2, "espagnole")
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
- TraceView::API.start_trace('redis_test', '', {}) do
48
- @redis.zcard("sauce")
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
- traces = get_all_traces
52
- traces.count.must_equal 4
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
- it "should trace zcount" do
58
- min_server_version(2.0)
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
- @redis.zadd("sauce", 0, "bechamel")
61
- @redis.zadd("sauce", 1, "veloute")
62
- @redis.zadd("sauce", 2, "espagnole")
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
- TraceView::API.start_trace('redis_test', '', {}) do
67
- @redis.zcount("sauce", 1, 3)
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
- traces = get_all_traces
71
- traces.count.must_equal 4
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
- it "should trace zincrby" do
77
- min_server_version(1.2)
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
- @redis.zadd("sauce", 0, "bechamel")
80
- @redis.zadd("sauce", 1, "veloute")
81
- @redis.zadd("sauce", 2, "espagnole")
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
- TraceView::API.start_trace('redis_test', '', {}) do
86
- @redis.zincrby("sauce", 1, "veloute")
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
- traces = get_all_traces
90
- traces.count.must_equal 4
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
- it "should trace zinterstore" do
96
- min_server_version(2.0)
101
+ @redis.zadd("sauce", 0, "bechamel")
102
+ @redis.zadd("sauce", 1, "veloute")
103
+ @redis.zadd("sauce", 2, "espagnole")
97
104
 
98
- @redis.zadd("sauce", 0, "bechamel")
99
- @redis.zadd("sauce", 1, "veloute")
100
- @redis.zadd("sauce", 2, "espagnole")
105
+ @redis.zadd("beverage", 0, "milkshake")
106
+ @redis.zadd("beverage", 1, "soda")
101
107
 
102
- @redis.zadd("beverage", 0, "milkshake")
103
- @redis.zadd("beverage", 1, "soda")
108
+ TraceView::API.start_trace('redis_test', '', {}) do
109
+ @redis.zinterstore("zinterstore_dest", [ "sauce", "beverage" ], :weights => [2, 3])
110
+ end
104
111
 
105
- TraceView::API.start_trace('redis_test', '', {}) do
106
- @redis.zinterstore("zinterstore_dest", [ "sauce", "beverage" ], :weights => [2, 3])
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
- traces = get_all_traces
110
- traces.count.must_equal 4
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
- it "should trace zrange" do
117
- min_server_version(1.2)
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
- @redis.zadd("sauce", 0, "bechamel")
120
- @redis.zadd("sauce", 1, "veloute")
121
- @redis.zadd("sauce", 2, "espagnole")
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
- TraceView::API.start_trace('redis_test', '', {}) do
126
- @redis.zrange("sauce", 1, 3)
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
- traces = get_all_traces
130
- traces.count.must_equal 4
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
- it "should trace zrangebyscore" do
136
- min_server_version(1.0)
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
- @redis.zadd("sauce", 0, "bechamel")
139
- @redis.zadd("sauce", 1, "veloute")
140
- @redis.zadd("sauce", 2, "espagnole")
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
- TraceView::API.start_trace('redis_test', '', {}) do
145
- @redis.zrangebyscore("sauce", "5", "(100")
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
- traces = get_all_traces
149
- traces.count.must_equal 4
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
- it "should trace zrank" do
155
- min_server_version(2.0)
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
- @redis.zadd("sauce", 0, "bechamel")
158
- @redis.zadd("sauce", 1, "veloute")
159
- @redis.zadd("sauce", 2, "espagnole")
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
- TraceView::API.start_trace('redis_test', '', {}) do
164
- @redis.zrank("sauce", "veloute")
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
- traces = get_all_traces
168
- traces.count.must_equal 4
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
- it "should trace zrem" do
174
- min_server_version(1.2)
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
- @redis.zadd("sauce", 0, "bechamel")
177
- @redis.zadd("sauce", 1, "veloute")
178
- @redis.zadd("sauce", 2, "espagnole")
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
- TraceView::API.start_trace('redis_test', '', {}) do
183
- @redis.zrem("sauce", "veloute")
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
- traces = get_all_traces
187
- traces.count.must_equal 4
188
- traces[2]['KVOp'].must_equal "zrem"
189
- traces[2]['KVKey'].must_equal "sauce"
190
- end
191
-
192
- it "should trace zremrangebyrank" do
193
- min_server_version(2.0)
194
-
195
- @redis.zadd("sauce", 0, "bechamel")
196
- @redis.zadd("sauce", 1, "veloute")
197
- @redis.zadd("sauce", 2, "espagnole")
198
- @redis.zadd("sauce", 3, "hollandaise")
199
- @redis.zadd("sauce", 4, "classic tomate")
200
-
201
- TraceView::API.start_trace('redis_test', '', {}) do
202
- @redis.zremrangebyrank("sauce", -5, -1)
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
- traces = get_all_traces
206
- traces.count.must_equal 4
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
- it "should trace zremrangebyscore" do
214
- min_server_version(1.2)
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
- @redis.zadd("sauce", 0, "bechamel")
217
- @redis.zadd("sauce", 1, "veloute")
218
- @redis.zadd("sauce", 2, "espagnole")
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
- TraceView::API.start_trace('redis_test', '', {}) do
223
- @redis.zremrangebyscore("sauce", -5, -1)
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
- traces = get_all_traces
227
- traces.count.must_equal 4
228
- traces[2]['KVOp'].must_equal "zremrangebyscore"
229
- traces[2]['KVKey'].must_equal "sauce"
230
- end
231
-
232
- it "should trace zrevrange" do
233
- min_server_version(1.2)
234
-
235
- @redis.zadd("sauce", 0, "bechamel")
236
- @redis.zadd("sauce", 1, "veloute")
237
- @redis.zadd("sauce", 2, "espagnole")
238
- @redis.zadd("sauce", 3, "hollandaise")
239
- @redis.zadd("sauce", 4, "classic tomate")
240
-
241
- TraceView::API.start_trace('redis_test', '', {}) do
242
- @redis.zrevrange("sauce", 0, -1)
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
- traces = get_all_traces
246
- traces.count.must_equal 4
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
- it "should trace zrevrangebyscore" do
254
- min_server_version(1.2)
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
- @redis.zadd("sauce", 0, "bechamel")
257
- @redis.zadd("sauce", 1, "veloute")
258
- @redis.zadd("sauce", 2, "espagnole")
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
- TraceView::API.start_trace('redis_test', '', {}) do
263
- @redis.zrevrangebyscore("sauce", "(100", "5")
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
- traces = get_all_traces
267
- traces.count.must_equal 4
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
- it "should trace zrevrank" do
273
- min_server_version(2.0)
278
+ @redis.zadd("letters", 0, "a")
279
+ @redis.zadd("letters", 1, "b")
280
+ @redis.zadd("letters", 1, "c")
274
281
 
275
- @redis.zadd("letters", 0, "a")
276
- @redis.zadd("letters", 1, "b")
277
- @redis.zadd("letters", 1, "c")
282
+ TraceView::API.start_trace('redis_test', '', {}) do
283
+ @redis.zrevrank("letters", "c")
284
+ end
278
285
 
279
- TraceView::API.start_trace('redis_test', '', {}) do
280
- @redis.zrevrank("letters", "c")
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
- traces = get_all_traces
284
- traces.count.must_equal 4
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
- it "should trace zscore" do
290
- min_server_version(1.2)
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
- @redis.zadd("elements", 0, "fire")
293
- @redis.zadd("elements", 1, "water")
294
- @redis.zadd("elements", 1, "earth")
295
- @redis.zadd("elements", 1, "air")
300
+ TraceView::API.start_trace('redis_test', '', {}) do
301
+ @redis.zscore("elements", "earth")
302
+ end
296
303
 
297
- TraceView::API.start_trace('redis_test', '', {}) do
298
- @redis.zscore("elements", "earth")
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
- traces = get_all_traces
302
- traces.count.must_equal 4
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
- it "should trace zunionstore" do
308
- min_server_version(1.0)
313
+ @redis.zadd("colors", 0, "blueish")
314
+ @redis.zadd("colors", 1, "yellowish")
315
+ @redis.zadd("codes", 0, "0xff")
309
316
 
310
- @redis.zadd("colors", 0, "blueish")
311
- @redis.zadd("colors", 1, "yellowish")
312
- @redis.zadd("codes", 0, "0xff")
317
+ TraceView::API.start_trace('redis_test', '', {}) do
318
+ @redis.zunionstore("zdest", ["colors", "codes"])
319
+ end
313
320
 
314
- TraceView::API.start_trace('redis_test', '', {}) do
315
- @redis.zunionstore("zdest", ["colors", "codes"])
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
-