appoptics_apm 4.0.3 → 4.0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (118) hide show
  1. checksums.yaml +4 -4
  2. data/Dockerfile_test +6 -7
  3. data/README.md +3 -3
  4. data/Rakefile +3 -2
  5. data/appoptics_apm.gemspec +2 -2
  6. data/docker-compose.yml +0 -22
  7. data/ext/oboe_metal/extconf.rb +4 -0
  8. data/lib/appoptics_apm/config.rb +11 -6
  9. data/lib/appoptics_apm/version.rb +1 -1
  10. metadata +3 -202
  11. data/gemfiles/delayed_job.gemfile +0 -36
  12. data/gemfiles/frameworks.gemfile +0 -44
  13. data/gemfiles/instrumentation_mocked.gemfile +0 -29
  14. data/gemfiles/libraries.gemfile +0 -85
  15. data/gemfiles/noop.gemfile +0 -17
  16. data/gemfiles/rails23.gemfile +0 -39
  17. data/gemfiles/rails30.gemfile +0 -42
  18. data/gemfiles/rails31.gemfile +0 -44
  19. data/gemfiles/rails32.gemfile +0 -54
  20. data/gemfiles/rails40.gemfile +0 -27
  21. data/gemfiles/rails41.gemfile +0 -27
  22. data/gemfiles/rails42.gemfile +0 -35
  23. data/gemfiles/rails50.gemfile +0 -44
  24. data/gemfiles/rails51.gemfile +0 -44
  25. data/test/benchmark/README.md +0 -65
  26. data/test/benchmark/logging_bench.rb +0 -54
  27. data/test/benchmark/with_libraries_gemfile/bunny_bench.rb +0 -69
  28. data/test/benchmark/with_rails5x_gemfile/action_controller5x_bench.rb +0 -43
  29. data/test/frameworks/apps/grape_nested.rb +0 -33
  30. data/test/frameworks/apps/grape_simple.rb +0 -80
  31. data/test/frameworks/apps/padrino_simple.rb +0 -80
  32. data/test/frameworks/apps/sinatra_simple.rb +0 -55
  33. data/test/frameworks/grape_test.rb +0 -286
  34. data/test/frameworks/padrino_test.rb +0 -222
  35. data/test/frameworks/rails3x_test.rb +0 -554
  36. data/test/frameworks/rails4x_test.rb +0 -570
  37. data/test/frameworks/rails5x_api_test.rb +0 -210
  38. data/test/frameworks/rails5x_test.rb +0 -376
  39. data/test/frameworks/rails_shared_tests.rb +0 -172
  40. data/test/frameworks/sinatra_test.rb +0 -140
  41. data/test/instrumentation/bunny_client_test.rb +0 -276
  42. data/test/instrumentation/bunny_consumer_test.rb +0 -204
  43. data/test/instrumentation/curb_test.rb +0 -398
  44. data/test/instrumentation/dalli_test.rb +0 -177
  45. data/test/instrumentation/em_http_request_test.rb +0 -89
  46. data/test/instrumentation/excon_test.rb +0 -231
  47. data/test/instrumentation/faraday_test.rb +0 -228
  48. data/test/instrumentation/http_test.rb +0 -143
  49. data/test/instrumentation/httpclient_test.rb +0 -304
  50. data/test/instrumentation/memcache_test.rb +0 -260
  51. data/test/instrumentation/memcached_test.rb +0 -229
  52. data/test/instrumentation/mongo_v1_test.rb +0 -479
  53. data/test/instrumentation/mongo_v2_index_test.rb +0 -124
  54. data/test/instrumentation/mongo_v2_test.rb +0 -584
  55. data/test/instrumentation/mongo_v2_view_test.rb +0 -435
  56. data/test/instrumentation/moped_test.rb +0 -517
  57. data/test/instrumentation/rack_test.rb +0 -165
  58. data/test/instrumentation/redis_hashes_test.rb +0 -268
  59. data/test/instrumentation/redis_keys_test.rb +0 -321
  60. data/test/instrumentation/redis_lists_test.rb +0 -310
  61. data/test/instrumentation/redis_misc_test.rb +0 -163
  62. data/test/instrumentation/redis_sets_test.rb +0 -296
  63. data/test/instrumentation/redis_sortedsets_test.rb +0 -328
  64. data/test/instrumentation/redis_strings_test.rb +0 -349
  65. data/test/instrumentation/resque_test.rb +0 -185
  66. data/test/instrumentation/rest-client_test.rb +0 -288
  67. data/test/instrumentation/sequel_mysql2_test.rb +0 -353
  68. data/test/instrumentation/sequel_mysql_test.rb +0 -334
  69. data/test/instrumentation/sequel_pg_test.rb +0 -336
  70. data/test/instrumentation/sidekiq-client_test.rb +0 -159
  71. data/test/instrumentation/sidekiq-worker_test.rb +0 -180
  72. data/test/instrumentation/twitter-cassandra_test.rb +0 -424
  73. data/test/instrumentation/typhoeus_test.rb +0 -284
  74. data/test/jobs/delayed_job/db_worker_job.rb +0 -29
  75. data/test/jobs/delayed_job/error_worker_job.rb +0 -10
  76. data/test/jobs/delayed_job/remote_call_worker_job.rb +0 -20
  77. data/test/jobs/resque/db_worker_job.rb +0 -29
  78. data/test/jobs/resque/error_worker_job.rb +0 -10
  79. data/test/jobs/resque/remote_call_worker_job.rb +0 -20
  80. data/test/jobs/sidekiq/db_worker_job.rb +0 -29
  81. data/test/jobs/sidekiq/error_worker_job.rb +0 -10
  82. data/test/jobs/sidekiq/remote_call_worker_job.rb +0 -20
  83. data/test/minitest_helper.rb +0 -277
  84. data/test/mocked/curb_mocked_test.rb +0 -324
  85. data/test/mocked/excon_mocked_test.rb +0 -174
  86. data/test/mocked/faraday_mocked_test.rb +0 -97
  87. data/test/mocked/http_mocked_test.rb +0 -135
  88. data/test/mocked/httpclient_mocked_test.rb +0 -258
  89. data/test/mocked/rest_client_mocked_test.rb +0 -109
  90. data/test/mocked/typhoeus_mocked_test.rb +0 -207
  91. data/test/models/widget.rb +0 -36
  92. data/test/noop/noop_test.rb +0 -145
  93. data/test/profiling/legacy_method_profiling_test.rb +0 -201
  94. data/test/profiling/method_profiling_test.rb +0 -631
  95. data/test/queues/delayed_job-client_test.rb +0 -95
  96. data/test/queues/delayed_job-worker_test.rb +0 -91
  97. data/test/reporter/reporter_test.rb +0 -14
  98. data/test/servers/delayed_job.rb +0 -107
  99. data/test/servers/rackapp_8101.rb +0 -29
  100. data/test/servers/rails3x_8140.rb +0 -96
  101. data/test/servers/rails4x_8140.rb +0 -96
  102. data/test/servers/rails5x_8140.rb +0 -95
  103. data/test/servers/rails5x_api_8150.rb +0 -78
  104. data/test/servers/sidekiq.rb +0 -29
  105. data/test/servers/sidekiq.yml +0 -7
  106. data/test/servers/sidekiq_initializer.rb +0 -25
  107. data/test/settings +0 -0
  108. data/test/support/auto_tracing_test.rb +0 -50
  109. data/test/support/backcompat_test.rb +0 -276
  110. data/test/support/config_test.rb +0 -149
  111. data/test/support/dnt_test.rb +0 -98
  112. data/test/support/init_report_test.rb +0 -25
  113. data/test/support/liboboe_settings_test.rb +0 -110
  114. data/test/support/logging_test.rb +0 -130
  115. data/test/support/sql_sanitize_test.rb +0 -55
  116. data/test/support/tracing_mode_test.rb +0 -33
  117. data/test/support/tvalias_test.rb +0 -15
  118. data/test/support/xtrace_test.rb +0 -41
@@ -1,296 +0,0 @@
1
- # Copyright (c) 2016 SolarWinds, LLC.
2
- # All rights reserved.
3
-
4
- require 'minitest_helper'
5
-
6
- if defined?(::Redis)
7
- describe "Redis Sets" do
8
- attr_reader :entry_kvs, :exit_kvs, :redis, :redis_version
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
14
- end
15
-
16
- before do
17
- clear_all_traces
18
-
19
- @redis ||= Redis.new(:host => ENV['APPOPTICS_REDIS_SERVER'] || '127.0.0.1')
20
-
21
- @redis_version ||= @redis.info["redis_version"]
22
-
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
27
-
28
- it "should trace sadd" do
29
- min_server_version(1.0)
30
-
31
- AppOpticsAPM::API.start_trace('redis_test', '', {}) do
32
- @redis.sadd("shrimp", "fried")
33
- end
34
-
35
- traces = get_all_traces
36
- traces.count.must_equal 4
37
- traces[2]['KVOp'].must_equal "sadd"
38
- traces[2]['KVKey'].must_equal "shrimp"
39
- end
40
-
41
- it "should trace scard" do
42
- min_server_version(1.0)
43
-
44
- @redis.sadd("mother sauces", "bechamel")
45
- @redis.sadd("mother sauces", "veloute")
46
- @redis.sadd("mother sauces", "espagnole")
47
- @redis.sadd("mother sauces", "hollandaise")
48
- @redis.sadd("mother sauces", "classic tomate")
49
-
50
- AppOpticsAPM::API.start_trace('redis_test', '', {}) do
51
- @redis.scard("mother sauces")
52
- end
53
-
54
- traces = get_all_traces
55
- traces.count.must_equal 4
56
- traces[2]['KVOp'].must_equal "scard"
57
- traces[2]['KVKey'].must_equal "mother sauces"
58
- end
59
-
60
- it "should trace sdiff" do
61
- min_server_version(1.0)
62
-
63
- @redis.sadd("abc", "a")
64
- @redis.sadd("abc", "b")
65
- @redis.sadd("abc", "c")
66
- @redis.sadd("ab", "a")
67
- @redis.sadd("ab", "b")
68
-
69
- AppOpticsAPM::API.start_trace('redis_test', '', {}) do
70
- @redis.sdiff("abc", "ab")
71
- end
72
-
73
- traces = get_all_traces
74
- traces.count.must_equal 4
75
- traces[2]['KVOp'].must_equal "sdiff"
76
- traces[2].has_key?('KVKey').must_equal false
77
- end
78
-
79
- it "should trace sdiffstore" do
80
- min_server_version(1.0)
81
-
82
- @redis.sadd("abc", "a")
83
- @redis.sadd("abc", "b")
84
- @redis.sadd("abc", "c")
85
- @redis.sadd("ab", "a")
86
- @redis.sadd("ab", "b")
87
-
88
- AppOpticsAPM::API.start_trace('redis_test', '', {}) do
89
- @redis.sdiffstore("dest", "abc", "ab")
90
- end
91
-
92
- traces = get_all_traces
93
- traces.count.must_equal 4
94
- traces[2]['KVOp'].must_equal "sdiffstore"
95
- traces[2]['destination'].must_equal "dest"
96
- end
97
-
98
- it "should trace sinter" do
99
- min_server_version(1.0)
100
-
101
- @redis.sadd("abc", "a")
102
- @redis.sadd("abc", "b")
103
- @redis.sadd("abc", "c")
104
- @redis.sadd("ab", "a")
105
- @redis.sadd("ab", "b")
106
-
107
- AppOpticsAPM::API.start_trace('redis_test', '', {}) do
108
- @redis.sinter("abc", "ab")
109
- end
110
-
111
- traces = get_all_traces
112
- traces.count.must_equal 4
113
- traces[2]['KVOp'].must_equal "sinter"
114
- traces[2].has_key?('KVKey').must_equal false
115
- end
116
-
117
- it "should trace sinterstore" do
118
- min_server_version(1.0)
119
-
120
- @redis.sadd("abc", "a")
121
- @redis.sadd("abc", "b")
122
- @redis.sadd("abc", "c")
123
- @redis.sadd("ab", "a")
124
- @redis.sadd("ab", "b")
125
-
126
- AppOpticsAPM::API.start_trace('redis_test', '', {}) do
127
- @redis.sinterstore("dest", "abc", "ab")
128
- end
129
-
130
- traces = get_all_traces
131
- traces.count.must_equal 4
132
- traces[2]['KVOp'].must_equal "sinterstore"
133
- traces[2]['destination'].must_equal "dest"
134
- end
135
-
136
- it "should trace sismember" do
137
- min_server_version(1.0)
138
-
139
- @redis.sadd("fibonacci", "0")
140
- @redis.sadd("fibonacci", "1")
141
- @redis.sadd("fibonacci", "1")
142
- @redis.sadd("fibonacci", "2")
143
- @redis.sadd("fibonacci", "3")
144
- @redis.sadd("fibonacci", "5")
145
- @redis.sadd("fibonacci", "8")
146
-
147
- AppOpticsAPM::API.start_trace('redis_test', '', {}) do
148
- @redis.sismember("fibonacci", "5")
149
- end
150
-
151
- traces = get_all_traces
152
- traces.count.must_equal 4
153
- traces[2]['KVOp'].must_equal "sismember"
154
- traces[2]['KVKey'].must_equal "fibonacci"
155
- end
156
-
157
- it "should trace smembers" do
158
- min_server_version(1.0)
159
-
160
- @redis.sadd("fibonacci", "0")
161
- @redis.sadd("fibonacci", "1")
162
- @redis.sadd("fibonacci", "1")
163
- @redis.sadd("fibonacci", "2")
164
- @redis.sadd("fibonacci", "3")
165
-
166
- AppOpticsAPM::API.start_trace('redis_test', '', {}) do
167
- @redis.smembers("fibonacci")
168
- end
169
-
170
- traces = get_all_traces
171
- traces.count.must_equal 4
172
- traces[2]['KVOp'].must_equal "smembers"
173
- traces[2]['KVKey'].must_equal "fibonacci"
174
- end
175
-
176
- it "should trace smove" do
177
- min_server_version(1.0)
178
-
179
- @redis.sadd("numbers", "1")
180
- @redis.sadd("numbers", "2")
181
- @redis.sadd("alpha", "two")
182
-
183
- AppOpticsAPM::API.start_trace('redis_test', '', {}) do
184
- @redis.smove("alpha", "numbers", "two")
185
- end
186
-
187
- traces = get_all_traces
188
- traces.count.must_equal 4
189
- traces[2]['KVOp'].must_equal "smove"
190
- traces[2]['source'].must_equal "alpha"
191
- traces[2]['destination'].must_equal "numbers"
192
- end
193
-
194
- it "should trace spop" do
195
- min_server_version(1.0)
196
-
197
- @redis.sadd("fibonacci", "0")
198
- @redis.sadd("fibonacci", "1")
199
- @redis.sadd("fibonacci", "1")
200
-
201
- AppOpticsAPM::API.start_trace('redis_test', '', {}) do
202
- @redis.spop("fibonacci")
203
- end
204
-
205
- traces = get_all_traces
206
- traces.count.must_equal 4
207
- traces[2]['KVOp'].must_equal "spop"
208
- traces[2]['KVKey'].must_equal "fibonacci"
209
- end
210
-
211
- it "should trace srandmember" do
212
- min_server_version(1.0)
213
-
214
- @redis.sadd("fibonacci", "0")
215
- @redis.sadd("fibonacci", "1")
216
- @redis.sadd("fibonacci", "1")
217
-
218
- AppOpticsAPM::API.start_trace('redis_test', '', {}) do
219
- @redis.srandmember("fibonacci")
220
- end
221
-
222
- traces = get_all_traces
223
- traces.count.must_equal 4
224
- traces[2]['KVOp'].must_equal "srandmember"
225
- traces[2]['KVKey'].must_equal "fibonacci"
226
- end
227
-
228
- it "should trace srem" do
229
- min_server_version(1.0)
230
-
231
- @redis.sadd("fibonacci", "0")
232
- @redis.sadd("fibonacci", "1")
233
- @redis.sadd("fibonacci", "1")
234
-
235
- AppOpticsAPM::API.start_trace('redis_test', '', {}) do
236
- @redis.srem("fibonacci", "0")
237
- end
238
-
239
- traces = get_all_traces
240
- traces.count.must_equal 4
241
- traces[2]['KVOp'].must_equal "srem"
242
- traces[2]['KVKey'].must_equal "fibonacci"
243
- end
244
-
245
- it "should trace sunion" do
246
- min_server_version(1.0)
247
-
248
- @redis.sadd("group1", "moe")
249
- @redis.sadd("group1", "curly")
250
- @redis.sadd("group2", "larry")
251
-
252
- AppOpticsAPM::API.start_trace('redis_test', '', {}) do
253
- @redis.sunion("group1", "group2")
254
- end
255
-
256
- traces = get_all_traces
257
- traces.count.must_equal 4
258
- traces[2]['KVOp'].must_equal "sunion"
259
- traces[2].has_key?('KVKey').must_equal false
260
- end
261
-
262
- it "should trace sunionstore" do
263
- min_server_version(1.0)
264
-
265
- @redis.sadd("group1", "moe")
266
- @redis.sadd("group1", "curly")
267
- @redis.sadd("group2", "larry")
268
-
269
- AppOpticsAPM::API.start_trace('redis_test', '', {}) do
270
- @redis.sunionstore("dest", "group1", "group2")
271
- end
272
-
273
- traces = get_all_traces
274
- traces.count.must_equal 4
275
- traces[2]['KVOp'].must_equal "sunionstore"
276
- traces[2]['destination'].must_equal "dest"
277
- traces[2].has_key?('KVKey').must_equal false
278
- end
279
-
280
- it "should trace sscan" do
281
- min_server_version(2.8)
282
-
283
- @redis.sadd("group1", "moe")
284
- @redis.sadd("group1", "curly")
285
-
286
- AppOpticsAPM::API.start_trace('redis_test', '', {}) do
287
- @redis.sscan("group1", 1)
288
- end
289
-
290
- traces = get_all_traces
291
- traces.count.must_equal 4
292
- traces[2]['KVOp'].must_equal "sscan"
293
- traces[2]['KVKey'].must_equal "group1"
294
- end
295
- end
296
- end
@@ -1,328 +0,0 @@
1
- # Copyright (c) 2016 SolarWinds, LLC.
2
- # All rights reserved.
3
-
4
- require 'minitest_helper'
5
-
6
- if defined?(::Redis)
7
- describe "Redis Sorted Sets" do
8
- attr_reader :entry_kvs, :exit_kvs, :redis, :redis_version
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
14
- end
15
-
16
- before do
17
- clear_all_traces
18
-
19
- @redis ||= Redis.new(:host => ENV['APPOPTICS_REDIS_SERVER'] || '127.0.0.1')
20
-
21
- @redis_version ||= @redis.info["redis_version"]
22
-
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
27
-
28
- it "should trace zadd" do
29
- min_server_version(1.2)
30
-
31
- AppOpticsAPM::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"
39
- end
40
-
41
- it "should trace zcard" do
42
- min_server_version(1.2)
43
-
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")
49
-
50
- AppOpticsAPM::API.start_trace('redis_test', '', {}) do
51
- @redis.zcard("sauce")
52
- end
53
-
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"
58
- end
59
-
60
- it "should trace zcount" do
61
- min_server_version(2.0)
62
-
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")
68
-
69
- AppOpticsAPM::API.start_trace('redis_test', '', {}) do
70
- @redis.zcount("sauce", 1, 3)
71
- end
72
-
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"
77
- end
78
-
79
- it "should trace zincrby" do
80
- min_server_version(1.2)
81
-
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")
87
-
88
- AppOpticsAPM::API.start_trace('redis_test', '', {}) do
89
- @redis.zincrby("sauce", 1, "veloute")
90
- end
91
-
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"
96
- end
97
-
98
- it "should trace zinterstore" do
99
- min_server_version(2.0)
100
-
101
- @redis.zadd("sauce", 0, "bechamel")
102
- @redis.zadd("sauce", 1, "veloute")
103
- @redis.zadd("sauce", 2, "espagnole")
104
-
105
- @redis.zadd("beverage", 0, "milkshake")
106
- @redis.zadd("beverage", 1, "soda")
107
-
108
- AppOpticsAPM::API.start_trace('redis_test', '', {}) do
109
- @redis.zinterstore("zinterstore_dest", [ "sauce", "beverage" ], :weights => [2, 3])
110
- end
111
-
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
117
- end
118
-
119
- it "should trace zrange" do
120
- min_server_version(1.2)
121
-
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")
127
-
128
- AppOpticsAPM::API.start_trace('redis_test', '', {}) do
129
- @redis.zrange("sauce", 1, 3)
130
- end
131
-
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"
136
- end
137
-
138
- it "should trace zrangebyscore" do
139
- min_server_version(1.0)
140
-
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")
146
-
147
- AppOpticsAPM::API.start_trace('redis_test', '', {}) do
148
- @redis.zrangebyscore("sauce", "5", "(100")
149
- end
150
-
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"
155
- end
156
-
157
- it "should trace zrank" do
158
- min_server_version(2.0)
159
-
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")
165
-
166
- AppOpticsAPM::API.start_trace('redis_test', '', {}) do
167
- @redis.zrank("sauce", "veloute")
168
- end
169
-
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"
174
- end
175
-
176
- it "should trace zrem" do
177
- min_server_version(1.2)
178
-
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")
184
-
185
- AppOpticsAPM::API.start_trace('redis_test', '', {}) do
186
- @redis.zrem("sauce", "veloute")
187
- end
188
-
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"
193
- end
194
-
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
- AppOpticsAPM::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)
214
- end
215
-
216
- it "should trace zremrangebyscore" do
217
- min_server_version(1.2)
218
-
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")
224
-
225
- AppOpticsAPM::API.start_trace('redis_test', '', {}) do
226
- @redis.zremrangebyscore("sauce", -5, -1)
227
- end
228
-
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"
233
- end
234
-
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
- AppOpticsAPM::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)
254
- end
255
-
256
- it "should trace zrevrangebyscore" do
257
- min_server_version(1.2)
258
-
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")
264
-
265
- AppOpticsAPM::API.start_trace('redis_test', '', {}) do
266
- @redis.zrevrangebyscore("sauce", "(100", "5")
267
- end
268
-
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"
273
- end
274
-
275
- it "should trace zrevrank" do
276
- min_server_version(2.0)
277
-
278
- @redis.zadd("letters", 0, "a")
279
- @redis.zadd("letters", 1, "b")
280
- @redis.zadd("letters", 1, "c")
281
-
282
- AppOpticsAPM::API.start_trace('redis_test', '', {}) do
283
- @redis.zrevrank("letters", "c")
284
- end
285
-
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"
290
- end
291
-
292
- it "should trace zscore" do
293
- min_server_version(1.2)
294
-
295
- @redis.zadd("elements", 0, "fire")
296
- @redis.zadd("elements", 1, "water")
297
- @redis.zadd("elements", 1, "earth")
298
- @redis.zadd("elements", 1, "air")
299
-
300
- AppOpticsAPM::API.start_trace('redis_test', '', {}) do
301
- @redis.zscore("elements", "earth")
302
- end
303
-
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"
308
- end
309
-
310
- it "should trace zunionstore" do
311
- min_server_version(1.0)
312
-
313
- @redis.zadd("colors", 0, "blueish")
314
- @redis.zadd("colors", 1, "yellowish")
315
- @redis.zadd("codes", 0, "0xff")
316
-
317
- AppOpticsAPM::API.start_trace('redis_test', '', {}) do
318
- @redis.zunionstore("zdest", ["colors", "codes"])
319
- end
320
-
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
326
- end
327
- end
328
- end