redis 4.0.3 → 4.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (157) hide show
  1. checksums.yaml +5 -5
  2. data/CHANGELOG.md +110 -0
  3. data/README.md +126 -17
  4. data/lib/redis/client.rb +130 -82
  5. data/lib/redis/cluster/command_loader.rb +8 -7
  6. data/lib/redis/cluster/node.rb +5 -1
  7. data/lib/redis/cluster/node_key.rb +3 -7
  8. data/lib/redis/cluster/node_loader.rb +2 -0
  9. data/lib/redis/cluster/option.rb +31 -14
  10. data/lib/redis/cluster/slot.rb +30 -13
  11. data/lib/redis/cluster/slot_loader.rb +6 -4
  12. data/lib/redis/cluster.rb +23 -17
  13. data/lib/redis/connection/command_helper.rb +5 -2
  14. data/lib/redis/connection/hiredis.rb +4 -3
  15. data/lib/redis/connection/registry.rb +2 -1
  16. data/lib/redis/connection/ruby.rb +139 -106
  17. data/lib/redis/connection/synchrony.rb +9 -4
  18. data/lib/redis/connection.rb +2 -0
  19. data/lib/redis/distributed.rb +171 -70
  20. data/lib/redis/errors.rb +2 -0
  21. data/lib/redis/hash_ring.rb +15 -14
  22. data/lib/redis/pipeline.rb +46 -8
  23. data/lib/redis/subscribe.rb +11 -12
  24. data/lib/redis/version.rb +3 -1
  25. data/lib/redis.rb +1239 -426
  26. metadata +16 -262
  27. data/.gitignore +0 -19
  28. data/.travis/Gemfile +0 -18
  29. data/.travis.yml +0 -61
  30. data/.yardopts +0 -3
  31. data/Gemfile +0 -8
  32. data/benchmarking/logging.rb +0 -71
  33. data/benchmarking/pipeline.rb +0 -51
  34. data/benchmarking/speed.rb +0 -21
  35. data/benchmarking/suite.rb +0 -24
  36. data/benchmarking/worker.rb +0 -71
  37. data/bin/build +0 -71
  38. data/bors.toml +0 -14
  39. data/examples/basic.rb +0 -15
  40. data/examples/consistency.rb +0 -114
  41. data/examples/dist_redis.rb +0 -43
  42. data/examples/incr-decr.rb +0 -17
  43. data/examples/list.rb +0 -26
  44. data/examples/pubsub.rb +0 -37
  45. data/examples/sentinel/sentinel.conf +0 -9
  46. data/examples/sentinel/start +0 -49
  47. data/examples/sentinel.rb +0 -41
  48. data/examples/sets.rb +0 -36
  49. data/examples/unicorn/config.ru +0 -3
  50. data/examples/unicorn/unicorn.rb +0 -20
  51. data/makefile +0 -74
  52. data/redis.gemspec +0 -43
  53. data/test/bitpos_test.rb +0 -63
  54. data/test/blocking_commands_test.rb +0 -40
  55. data/test/client_test.rb +0 -76
  56. data/test/cluster_abnormal_state_test.rb +0 -38
  57. data/test/cluster_blocking_commands_test.rb +0 -15
  58. data/test/cluster_client_internals_test.rb +0 -77
  59. data/test/cluster_client_key_hash_tags_test.rb +0 -88
  60. data/test/cluster_client_options_test.rb +0 -147
  61. data/test/cluster_client_pipelining_test.rb +0 -59
  62. data/test/cluster_client_replicas_test.rb +0 -36
  63. data/test/cluster_client_slots_test.rb +0 -94
  64. data/test/cluster_client_transactions_test.rb +0 -71
  65. data/test/cluster_commands_on_cluster_test.rb +0 -165
  66. data/test/cluster_commands_on_connection_test.rb +0 -40
  67. data/test/cluster_commands_on_geo_test.rb +0 -74
  68. data/test/cluster_commands_on_hashes_test.rb +0 -11
  69. data/test/cluster_commands_on_hyper_log_log_test.rb +0 -17
  70. data/test/cluster_commands_on_keys_test.rb +0 -134
  71. data/test/cluster_commands_on_lists_test.rb +0 -15
  72. data/test/cluster_commands_on_pub_sub_test.rb +0 -101
  73. data/test/cluster_commands_on_scripting_test.rb +0 -56
  74. data/test/cluster_commands_on_server_test.rb +0 -221
  75. data/test/cluster_commands_on_sets_test.rb +0 -39
  76. data/test/cluster_commands_on_sorted_sets_test.rb +0 -35
  77. data/test/cluster_commands_on_streams_test.rb +0 -196
  78. data/test/cluster_commands_on_strings_test.rb +0 -15
  79. data/test/cluster_commands_on_transactions_test.rb +0 -41
  80. data/test/cluster_commands_on_value_types_test.rb +0 -14
  81. data/test/command_map_test.rb +0 -28
  82. data/test/commands_on_geo_test.rb +0 -116
  83. data/test/commands_on_hashes_test.rb +0 -7
  84. data/test/commands_on_hyper_log_log_test.rb +0 -7
  85. data/test/commands_on_lists_test.rb +0 -7
  86. data/test/commands_on_sets_test.rb +0 -7
  87. data/test/commands_on_sorted_sets_test.rb +0 -7
  88. data/test/commands_on_strings_test.rb +0 -7
  89. data/test/commands_on_value_types_test.rb +0 -207
  90. data/test/connection_handling_test.rb +0 -275
  91. data/test/connection_test.rb +0 -57
  92. data/test/db/.gitkeep +0 -0
  93. data/test/distributed_blocking_commands_test.rb +0 -52
  94. data/test/distributed_commands_on_hashes_test.rb +0 -21
  95. data/test/distributed_commands_on_hyper_log_log_test.rb +0 -26
  96. data/test/distributed_commands_on_lists_test.rb +0 -19
  97. data/test/distributed_commands_on_sets_test.rb +0 -105
  98. data/test/distributed_commands_on_sorted_sets_test.rb +0 -59
  99. data/test/distributed_commands_on_strings_test.rb +0 -79
  100. data/test/distributed_commands_on_value_types_test.rb +0 -129
  101. data/test/distributed_commands_requiring_clustering_test.rb +0 -162
  102. data/test/distributed_connection_handling_test.rb +0 -21
  103. data/test/distributed_internals_test.rb +0 -68
  104. data/test/distributed_key_tags_test.rb +0 -50
  105. data/test/distributed_persistence_control_commands_test.rb +0 -24
  106. data/test/distributed_publish_subscribe_test.rb +0 -90
  107. data/test/distributed_remote_server_control_commands_test.rb +0 -64
  108. data/test/distributed_scripting_test.rb +0 -100
  109. data/test/distributed_sorting_test.rb +0 -18
  110. data/test/distributed_test.rb +0 -56
  111. data/test/distributed_transactions_test.rb +0 -30
  112. data/test/encoding_test.rb +0 -14
  113. data/test/error_replies_test.rb +0 -57
  114. data/test/fork_safety_test.rb +0 -60
  115. data/test/helper.rb +0 -345
  116. data/test/helper_test.rb +0 -22
  117. data/test/internals_test.rb +0 -408
  118. data/test/lint/blocking_commands.rb +0 -174
  119. data/test/lint/hashes.rb +0 -203
  120. data/test/lint/hyper_log_log.rb +0 -74
  121. data/test/lint/lists.rb +0 -159
  122. data/test/lint/sets.rb +0 -282
  123. data/test/lint/sorted_sets.rb +0 -497
  124. data/test/lint/strings.rb +0 -348
  125. data/test/lint/value_types.rb +0 -130
  126. data/test/persistence_control_commands_test.rb +0 -24
  127. data/test/pipelining_commands_test.rb +0 -246
  128. data/test/publish_subscribe_test.rb +0 -280
  129. data/test/remote_server_control_commands_test.rb +0 -175
  130. data/test/scanning_test.rb +0 -407
  131. data/test/scripting_test.rb +0 -76
  132. data/test/sentinel_command_test.rb +0 -78
  133. data/test/sentinel_test.rb +0 -253
  134. data/test/sorting_test.rb +0 -57
  135. data/test/ssl_test.rb +0 -69
  136. data/test/support/cluster/orchestrator.rb +0 -199
  137. data/test/support/connection/hiredis.rb +0 -1
  138. data/test/support/connection/ruby.rb +0 -1
  139. data/test/support/connection/synchrony.rb +0 -17
  140. data/test/support/redis_mock.rb +0 -130
  141. data/test/support/ssl/gen_certs.sh +0 -31
  142. data/test/support/ssl/trusted-ca.crt +0 -25
  143. data/test/support/ssl/trusted-ca.key +0 -27
  144. data/test/support/ssl/trusted-cert.crt +0 -81
  145. data/test/support/ssl/trusted-cert.key +0 -28
  146. data/test/support/ssl/untrusted-ca.crt +0 -26
  147. data/test/support/ssl/untrusted-ca.key +0 -27
  148. data/test/support/ssl/untrusted-cert.crt +0 -82
  149. data/test/support/ssl/untrusted-cert.key +0 -28
  150. data/test/support/wire/synchrony.rb +0 -24
  151. data/test/support/wire/thread.rb +0 -5
  152. data/test/synchrony_driver.rb +0 -85
  153. data/test/test.conf.erb +0 -9
  154. data/test/thread_safety_test.rb +0 -60
  155. data/test/transactions_test.rb +0 -272
  156. data/test/unknown_commands_test.rb +0 -12
  157. data/test/url_param_test.rb +0 -136
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: redis
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.3
4
+ version: 4.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ezra Zygmuntowicz
@@ -13,27 +13,13 @@ authors:
13
13
  - Michel Martens
14
14
  - Damian Janowski
15
15
  - Pieter Noordhuis
16
- autorequire:
16
+ autorequire:
17
17
  bindir: bin
18
18
  cert_chain: []
19
- date: 2018-10-31 00:00:00.000000000 Z
19
+ date: 2021-10-14 00:00:00.000000000 Z
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
22
- name: test-unit
23
- requirement: !ruby/object:Gem::Requirement
24
- requirements:
25
- - - ">="
26
- - !ruby/object:Gem::Version
27
- version: 3.1.5
28
- type: :development
29
- prerelease: false
30
- version_requirements: !ruby/object:Gem::Requirement
31
- requirements:
32
- - - ">="
33
- - !ruby/object:Gem::Version
34
- version: 3.1.5
35
- - !ruby/object:Gem::Dependency
36
- name: mocha
22
+ name: em-synchrony
37
23
  requirement: !ruby/object:Gem::Requirement
38
24
  requirements:
39
25
  - - ">="
@@ -61,7 +47,7 @@ dependencies:
61
47
  - !ruby/object:Gem::Version
62
48
  version: '0'
63
49
  - !ruby/object:Gem::Dependency
64
- name: em-synchrony
50
+ name: mocha
65
51
  requirement: !ruby/object:Gem::Requirement
66
52
  requirements:
67
53
  - - ">="
@@ -83,33 +69,9 @@ executables: []
83
69
  extensions: []
84
70
  extra_rdoc_files: []
85
71
  files:
86
- - ".gitignore"
87
- - ".travis.yml"
88
- - ".travis/Gemfile"
89
- - ".yardopts"
90
72
  - CHANGELOG.md
91
- - Gemfile
92
73
  - LICENSE
93
74
  - README.md
94
- - benchmarking/logging.rb
95
- - benchmarking/pipeline.rb
96
- - benchmarking/speed.rb
97
- - benchmarking/suite.rb
98
- - benchmarking/worker.rb
99
- - bin/build
100
- - bors.toml
101
- - examples/basic.rb
102
- - examples/consistency.rb
103
- - examples/dist_redis.rb
104
- - examples/incr-decr.rb
105
- - examples/list.rb
106
- - examples/pubsub.rb
107
- - examples/sentinel.rb
108
- - examples/sentinel/sentinel.conf
109
- - examples/sentinel/start
110
- - examples/sets.rb
111
- - examples/unicorn/config.ru
112
- - examples/unicorn/unicorn.rb
113
75
  - lib/redis.rb
114
76
  - lib/redis/client.rb
115
77
  - lib/redis/cluster.rb
@@ -134,118 +96,16 @@ files:
134
96
  - lib/redis/pipeline.rb
135
97
  - lib/redis/subscribe.rb
136
98
  - lib/redis/version.rb
137
- - makefile
138
- - redis.gemspec
139
- - test/bitpos_test.rb
140
- - test/blocking_commands_test.rb
141
- - test/client_test.rb
142
- - test/cluster_abnormal_state_test.rb
143
- - test/cluster_blocking_commands_test.rb
144
- - test/cluster_client_internals_test.rb
145
- - test/cluster_client_key_hash_tags_test.rb
146
- - test/cluster_client_options_test.rb
147
- - test/cluster_client_pipelining_test.rb
148
- - test/cluster_client_replicas_test.rb
149
- - test/cluster_client_slots_test.rb
150
- - test/cluster_client_transactions_test.rb
151
- - test/cluster_commands_on_cluster_test.rb
152
- - test/cluster_commands_on_connection_test.rb
153
- - test/cluster_commands_on_geo_test.rb
154
- - test/cluster_commands_on_hashes_test.rb
155
- - test/cluster_commands_on_hyper_log_log_test.rb
156
- - test/cluster_commands_on_keys_test.rb
157
- - test/cluster_commands_on_lists_test.rb
158
- - test/cluster_commands_on_pub_sub_test.rb
159
- - test/cluster_commands_on_scripting_test.rb
160
- - test/cluster_commands_on_server_test.rb
161
- - test/cluster_commands_on_sets_test.rb
162
- - test/cluster_commands_on_sorted_sets_test.rb
163
- - test/cluster_commands_on_streams_test.rb
164
- - test/cluster_commands_on_strings_test.rb
165
- - test/cluster_commands_on_transactions_test.rb
166
- - test/cluster_commands_on_value_types_test.rb
167
- - test/command_map_test.rb
168
- - test/commands_on_geo_test.rb
169
- - test/commands_on_hashes_test.rb
170
- - test/commands_on_hyper_log_log_test.rb
171
- - test/commands_on_lists_test.rb
172
- - test/commands_on_sets_test.rb
173
- - test/commands_on_sorted_sets_test.rb
174
- - test/commands_on_strings_test.rb
175
- - test/commands_on_value_types_test.rb
176
- - test/connection_handling_test.rb
177
- - test/connection_test.rb
178
- - test/db/.gitkeep
179
- - test/distributed_blocking_commands_test.rb
180
- - test/distributed_commands_on_hashes_test.rb
181
- - test/distributed_commands_on_hyper_log_log_test.rb
182
- - test/distributed_commands_on_lists_test.rb
183
- - test/distributed_commands_on_sets_test.rb
184
- - test/distributed_commands_on_sorted_sets_test.rb
185
- - test/distributed_commands_on_strings_test.rb
186
- - test/distributed_commands_on_value_types_test.rb
187
- - test/distributed_commands_requiring_clustering_test.rb
188
- - test/distributed_connection_handling_test.rb
189
- - test/distributed_internals_test.rb
190
- - test/distributed_key_tags_test.rb
191
- - test/distributed_persistence_control_commands_test.rb
192
- - test/distributed_publish_subscribe_test.rb
193
- - test/distributed_remote_server_control_commands_test.rb
194
- - test/distributed_scripting_test.rb
195
- - test/distributed_sorting_test.rb
196
- - test/distributed_test.rb
197
- - test/distributed_transactions_test.rb
198
- - test/encoding_test.rb
199
- - test/error_replies_test.rb
200
- - test/fork_safety_test.rb
201
- - test/helper.rb
202
- - test/helper_test.rb
203
- - test/internals_test.rb
204
- - test/lint/blocking_commands.rb
205
- - test/lint/hashes.rb
206
- - test/lint/hyper_log_log.rb
207
- - test/lint/lists.rb
208
- - test/lint/sets.rb
209
- - test/lint/sorted_sets.rb
210
- - test/lint/strings.rb
211
- - test/lint/value_types.rb
212
- - test/persistence_control_commands_test.rb
213
- - test/pipelining_commands_test.rb
214
- - test/publish_subscribe_test.rb
215
- - test/remote_server_control_commands_test.rb
216
- - test/scanning_test.rb
217
- - test/scripting_test.rb
218
- - test/sentinel_command_test.rb
219
- - test/sentinel_test.rb
220
- - test/sorting_test.rb
221
- - test/ssl_test.rb
222
- - test/support/cluster/orchestrator.rb
223
- - test/support/connection/hiredis.rb
224
- - test/support/connection/ruby.rb
225
- - test/support/connection/synchrony.rb
226
- - test/support/redis_mock.rb
227
- - test/support/ssl/gen_certs.sh
228
- - test/support/ssl/trusted-ca.crt
229
- - test/support/ssl/trusted-ca.key
230
- - test/support/ssl/trusted-cert.crt
231
- - test/support/ssl/trusted-cert.key
232
- - test/support/ssl/untrusted-ca.crt
233
- - test/support/ssl/untrusted-ca.key
234
- - test/support/ssl/untrusted-cert.crt
235
- - test/support/ssl/untrusted-cert.key
236
- - test/support/wire/synchrony.rb
237
- - test/support/wire/thread.rb
238
- - test/synchrony_driver.rb
239
- - test/test.conf.erb
240
- - test/thread_safety_test.rb
241
- - test/transactions_test.rb
242
- - test/unknown_commands_test.rb
243
- - test/url_param_test.rb
244
99
  homepage: https://github.com/redis/redis-rb
245
100
  licenses:
246
101
  - MIT
247
- metadata: {}
248
- post_install_message:
102
+ metadata:
103
+ bug_tracker_uri: https://github.com/redis/redis-rb/issues
104
+ changelog_uri: https://github.com/redis/redis-rb/blob/master/CHANGELOG.md
105
+ documentation_uri: https://www.rubydoc.info/gems/redis/4.5.0
106
+ homepage_uri: https://github.com/redis/redis-rb
107
+ source_code_uri: https://github.com/redis/redis-rb/tree/v4.5.0
108
+ post_install_message:
249
109
  rdoc_options: []
250
110
  require_paths:
251
111
  - lib
@@ -253,121 +113,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
253
113
  requirements:
254
114
  - - ">="
255
115
  - !ruby/object:Gem::Version
256
- version: 2.2.2
116
+ version: 2.4.0
257
117
  required_rubygems_version: !ruby/object:Gem::Requirement
258
118
  requirements:
259
119
  - - ">="
260
120
  - !ruby/object:Gem::Version
261
121
  version: '0'
262
122
  requirements: []
263
- rubyforge_project:
264
- rubygems_version: 2.5.1
265
- signing_key:
123
+ rubygems_version: 3.1.2
124
+ signing_key:
266
125
  specification_version: 4
267
126
  summary: A Ruby client library for Redis
268
- test_files:
269
- - test/bitpos_test.rb
270
- - test/blocking_commands_test.rb
271
- - test/client_test.rb
272
- - test/cluster_abnormal_state_test.rb
273
- - test/cluster_blocking_commands_test.rb
274
- - test/cluster_client_internals_test.rb
275
- - test/cluster_client_key_hash_tags_test.rb
276
- - test/cluster_client_options_test.rb
277
- - test/cluster_client_pipelining_test.rb
278
- - test/cluster_client_replicas_test.rb
279
- - test/cluster_client_slots_test.rb
280
- - test/cluster_client_transactions_test.rb
281
- - test/cluster_commands_on_cluster_test.rb
282
- - test/cluster_commands_on_connection_test.rb
283
- - test/cluster_commands_on_geo_test.rb
284
- - test/cluster_commands_on_hashes_test.rb
285
- - test/cluster_commands_on_hyper_log_log_test.rb
286
- - test/cluster_commands_on_keys_test.rb
287
- - test/cluster_commands_on_lists_test.rb
288
- - test/cluster_commands_on_pub_sub_test.rb
289
- - test/cluster_commands_on_scripting_test.rb
290
- - test/cluster_commands_on_server_test.rb
291
- - test/cluster_commands_on_sets_test.rb
292
- - test/cluster_commands_on_sorted_sets_test.rb
293
- - test/cluster_commands_on_streams_test.rb
294
- - test/cluster_commands_on_strings_test.rb
295
- - test/cluster_commands_on_transactions_test.rb
296
- - test/cluster_commands_on_value_types_test.rb
297
- - test/command_map_test.rb
298
- - test/commands_on_geo_test.rb
299
- - test/commands_on_hashes_test.rb
300
- - test/commands_on_hyper_log_log_test.rb
301
- - test/commands_on_lists_test.rb
302
- - test/commands_on_sets_test.rb
303
- - test/commands_on_sorted_sets_test.rb
304
- - test/commands_on_strings_test.rb
305
- - test/commands_on_value_types_test.rb
306
- - test/connection_handling_test.rb
307
- - test/connection_test.rb
308
- - test/db/.gitkeep
309
- - test/distributed_blocking_commands_test.rb
310
- - test/distributed_commands_on_hashes_test.rb
311
- - test/distributed_commands_on_hyper_log_log_test.rb
312
- - test/distributed_commands_on_lists_test.rb
313
- - test/distributed_commands_on_sets_test.rb
314
- - test/distributed_commands_on_sorted_sets_test.rb
315
- - test/distributed_commands_on_strings_test.rb
316
- - test/distributed_commands_on_value_types_test.rb
317
- - test/distributed_commands_requiring_clustering_test.rb
318
- - test/distributed_connection_handling_test.rb
319
- - test/distributed_internals_test.rb
320
- - test/distributed_key_tags_test.rb
321
- - test/distributed_persistence_control_commands_test.rb
322
- - test/distributed_publish_subscribe_test.rb
323
- - test/distributed_remote_server_control_commands_test.rb
324
- - test/distributed_scripting_test.rb
325
- - test/distributed_sorting_test.rb
326
- - test/distributed_test.rb
327
- - test/distributed_transactions_test.rb
328
- - test/encoding_test.rb
329
- - test/error_replies_test.rb
330
- - test/fork_safety_test.rb
331
- - test/helper.rb
332
- - test/helper_test.rb
333
- - test/internals_test.rb
334
- - test/lint/blocking_commands.rb
335
- - test/lint/hashes.rb
336
- - test/lint/hyper_log_log.rb
337
- - test/lint/lists.rb
338
- - test/lint/sets.rb
339
- - test/lint/sorted_sets.rb
340
- - test/lint/strings.rb
341
- - test/lint/value_types.rb
342
- - test/persistence_control_commands_test.rb
343
- - test/pipelining_commands_test.rb
344
- - test/publish_subscribe_test.rb
345
- - test/remote_server_control_commands_test.rb
346
- - test/scanning_test.rb
347
- - test/scripting_test.rb
348
- - test/sentinel_command_test.rb
349
- - test/sentinel_test.rb
350
- - test/sorting_test.rb
351
- - test/ssl_test.rb
352
- - test/support/cluster/orchestrator.rb
353
- - test/support/connection/hiredis.rb
354
- - test/support/connection/ruby.rb
355
- - test/support/connection/synchrony.rb
356
- - test/support/redis_mock.rb
357
- - test/support/ssl/gen_certs.sh
358
- - test/support/ssl/trusted-ca.crt
359
- - test/support/ssl/trusted-ca.key
360
- - test/support/ssl/trusted-cert.crt
361
- - test/support/ssl/trusted-cert.key
362
- - test/support/ssl/untrusted-ca.crt
363
- - test/support/ssl/untrusted-ca.key
364
- - test/support/ssl/untrusted-cert.crt
365
- - test/support/ssl/untrusted-cert.key
366
- - test/support/wire/synchrony.rb
367
- - test/support/wire/thread.rb
368
- - test/synchrony_driver.rb
369
- - test/test.conf.erb
370
- - test/thread_safety_test.rb
371
- - test/transactions_test.rb
372
- - test/unknown_commands_test.rb
373
- - test/url_param_test.rb
127
+ test_files: []
data/.gitignore DELETED
@@ -1,19 +0,0 @@
1
- *.rdb
2
- *.swp
3
- Gemfile.lock
4
- *.gem
5
- /tmp/
6
- /.idea
7
- /.yardoc
8
- /.bundle
9
- /coverage/*
10
- /doc/
11
- /examples/sentinel/sentinel.conf
12
- /nohup.out
13
- /pkg/*
14
- /rdsrv
15
- /redis/*
16
- /test/db
17
- /test/test.conf
18
- appendonly.aof
19
- temp-rewriteaof-*.aof
data/.travis/Gemfile DELETED
@@ -1,18 +0,0 @@
1
- source "https://rubygems.org"
2
-
3
- gemspec :path => "../"
4
-
5
- # Using jruby-openssl 0.10.0, we get NPEs in jruby tests: https://github.com/redis/redis-rb/issues/756
6
- platform :jruby do
7
- gem 'jruby-openssl', '<0.10.0'
8
- end
9
-
10
- case ENV["DRIVER"]
11
- when "hiredis"
12
- gem "hiredis"
13
- when "synchrony"
14
- gem "hiredis"
15
- gem "em-synchrony"
16
- end
17
-
18
- gem 'test-unit', '>= 3.2.5'
data/.travis.yml DELETED
@@ -1,61 +0,0 @@
1
- language: ruby
2
- cache:
3
- directories:
4
- - tmp/cache
5
- before_install:
6
- - gem update --system 2.6.14
7
- - gem --version
8
-
9
- script: make
10
-
11
- rvm:
12
- - 2.2.2
13
- - 2.3.3
14
- - 2.4.1
15
- - 2.5.0
16
- - jruby-9.1.17.0
17
-
18
- gemfile: ".travis/Gemfile"
19
-
20
- sudo: false
21
-
22
- before_script:
23
- - if (ruby -e "exit RUBY_VERSION.to_f >= 2.4"); then export RUBYOPT="--enable-frozen-string-literal"; fi; echo $RUBYOPT
24
-
25
- env:
26
- global:
27
- - VERBOSE=true
28
- - TIMEOUT=9
29
- matrix:
30
- - DRIVER=ruby REDIS_BRANCH=3.0
31
- - DRIVER=ruby REDIS_BRANCH=3.2
32
- - DRIVER=hiredis REDIS_BRANCH=3.0
33
- - DRIVER=hiredis REDIS_BRANCH=3.2
34
- - DRIVER=synchrony REDIS_BRANCH=3.0
35
- - DRIVER=synchrony REDIS_BRANCH=3.2
36
- - DRIVER=ruby REDIS_BRANCH=4.0
37
-
38
- branches:
39
- only:
40
- - staging
41
- - trying
42
- - master
43
-
44
- matrix:
45
- exclude:
46
- # hiredis
47
- - rvm: jruby-9.1.17.0
48
- env: DRIVER=hiredis REDIS_BRANCH=3.0
49
- - rvm: jruby-9.1.17.0
50
- env: DRIVER=hiredis REDIS_BRANCH=3.2
51
-
52
- # synchrony
53
- - rvm: jruby-9.1.17.0
54
- env: DRIVER=synchrony REDIS_BRANCH=3.0
55
- - rvm: jruby-9.1.17.0
56
- env: DRIVER=synchrony REDIS_BRANCH=3.2
57
-
58
- notifications:
59
- irc:
60
- - irc.freenode.net#redis-rb
61
- email: false
data/.yardopts DELETED
@@ -1,3 +0,0 @@
1
- --exclude redis/connection
2
- --exclude redis/compat
3
- --markup markdown
data/Gemfile DELETED
@@ -1,8 +0,0 @@
1
- source 'https://rubygems.org'
2
-
3
- gemspec
4
-
5
- # Using jruby-openssl 0.10.0, we get NPEs in jruby tests: https://github.com/redis/redis-rb/issues/756
6
- platform :jruby do
7
- gem 'jruby-openssl', '<0.10.0'
8
- end
@@ -1,71 +0,0 @@
1
- # Run with
2
- #
3
- # $ ruby -Ilib benchmarking/logging.rb
4
- #
5
-
6
- begin
7
- require "bench"
8
- rescue LoadError
9
- $stderr.puts "`gem install bench` and try again."
10
- exit 1
11
- end
12
-
13
- require "redis"
14
- require "logger"
15
-
16
- def log(level, namespace = nil)
17
- logger = (namespace || Kernel).const_get(:Logger).new("/dev/null")
18
- logger.level = (namespace || Logger).const_get(level)
19
- logger
20
- end
21
-
22
- def stress(redis)
23
- redis.flushdb
24
-
25
- n = (ARGV.shift || 2000).to_i
26
-
27
- n.times do |i|
28
- key = "foo:#{i}"
29
- redis.set key, i
30
- redis.get key
31
- end
32
- end
33
-
34
- default = Redis.new
35
-
36
- logging_redises = [
37
- Redis.new(:logger => log(:DEBUG)),
38
- Redis.new(:logger => log(:INFO)),
39
- ]
40
-
41
- begin
42
- require "log4r"
43
-
44
- logging_redises += [
45
- Redis.new(:logger => log(:DEBUG, Log4r)),
46
- Redis.new(:logger => log(:INFO, Log4r)),
47
- ]
48
- rescue LoadError
49
- $stderr.puts "Log4r not installed. `gem install log4r` if you want to compare it against Ruby's Logger (spoiler: it's much faster)."
50
- end
51
-
52
- benchmark "Default options (no logger)" do
53
- stress(default)
54
- end
55
-
56
- logging_redises.each do |redis|
57
- logger = redis._client.logger
58
-
59
- case logger
60
- when Logger
61
- level = Logger::SEV_LABEL[logger.level]
62
- when Log4r::Logger
63
- level = logger.levels[logger.level]
64
- end
65
-
66
- benchmark "#{logger.class} on #{level}" do
67
- stress(redis)
68
- end
69
- end
70
-
71
- run 10
@@ -1,51 +0,0 @@
1
- require "benchmark"
2
-
3
- $:.push File.join(File.dirname(__FILE__), 'lib')
4
-
5
- require 'redis'
6
-
7
- ITERATIONS = 10000
8
-
9
- @r = Redis.new
10
-
11
- Benchmark.bmbm do |benchmark|
12
- benchmark.report("set") do
13
- @r.flushdb
14
-
15
- ITERATIONS.times do |i|
16
- @r.set("foo#{i}", "Hello world!")
17
- @r.get("foo#{i}")
18
- end
19
- end
20
-
21
- benchmark.report("set (pipelined)") do
22
- @r.flushdb
23
-
24
- @r.pipelined do
25
- ITERATIONS.times do |i|
26
- @r.set("foo#{i}", "Hello world!")
27
- @r.get("foo#{i}")
28
- end
29
- end
30
- end
31
-
32
- benchmark.report("lpush+ltrim") do
33
- @r.flushdb
34
-
35
- ITERATIONS.times do |i|
36
- @r.lpush "lpush#{i}", i
37
- @r.ltrim "ltrim#{i}", 0, 30
38
- end
39
- end
40
-
41
- benchmark.report("lpush+ltrim (pipelined)") do
42
- @r.flushdb
43
-
44
- @r.pipelined do
45
- ITERATIONS.times do |i|
46
- @r.lpush "lpush#{i}", i
47
- @r.ltrim "ltrim#{i}", 0, 30
48
- end
49
- end
50
- end
51
- end
@@ -1,21 +0,0 @@
1
- # Run with
2
- #
3
- # $ ruby -Ilib benchmarking/speed.rb
4
- #
5
-
6
- require "benchmark"
7
- require "redis"
8
-
9
- r = Redis.new
10
- n = (ARGV.shift || 20000).to_i
11
-
12
- elapsed = Benchmark.realtime do
13
- # n sets, n gets
14
- n.times do |i|
15
- key = "foo#{i}"
16
- r[key] = key * 10
17
- r[key]
18
- end
19
- end
20
-
21
- puts '%.2f Kops' % (2 * n / 1000 / elapsed)
@@ -1,24 +0,0 @@
1
- require 'fileutils'
2
-
3
- def run_in_background(command)
4
- fork { system command }
5
- end
6
-
7
- def with_all_segments(&block)
8
- 0.upto(9) do |segment_number|
9
- block_size = 100000
10
- start_index = segment_number * block_size
11
- end_index = start_index + block_size - 1
12
- block.call(start_index, end_index)
13
- end
14
- end
15
-
16
- #with_all_segments do |start_index, end_index|
17
- # puts "Initializing keys from #{start_index} to #{end_index}"
18
- # system "ruby worker.rb initialize #{start_index} #{end_index} 0"
19
- #end
20
-
21
- with_all_segments do |start_index, end_index|
22
- run_in_background "ruby worker.rb write #{start_index} #{end_index} 10"
23
- run_in_background "ruby worker.rb read #{start_index} #{end_index} 1"
24
- end
@@ -1,71 +0,0 @@
1
- BENCHMARK_ROOT = File.dirname(__FILE__)
2
- REDIS_ROOT = File.join(BENCHMARK_ROOT, "..", "lib")
3
-
4
- $: << REDIS_ROOT
5
- require 'redis'
6
- require 'benchmark'
7
-
8
- def show_usage
9
- puts <<-EOL
10
- Usage: worker.rb [read:write] <start_index> <end_index> <sleep_msec>
11
- EOL
12
- end
13
-
14
- def shift_from_argv
15
- value = ARGV.shift
16
- unless value
17
- show_usage
18
- exit -1
19
- end
20
- value
21
- end
22
-
23
- operation = shift_from_argv.to_sym
24
- start_index = shift_from_argv.to_i
25
- end_index = shift_from_argv.to_i
26
- sleep_msec = shift_from_argv.to_i
27
- sleep_duration = sleep_msec/1000.0
28
-
29
- redis = Redis.new
30
-
31
- case operation
32
- when :initialize
33
-
34
- start_index.upto(end_index) do |i|
35
- redis[i] = 0
36
- end
37
-
38
- when :clear
39
-
40
- start_index.upto(end_index) do |i|
41
- redis.delete(i)
42
- end
43
-
44
- when :read, :write
45
-
46
- puts "Starting to #{operation} at segment #{end_index + 1}"
47
-
48
- loop do
49
- t1 = Time.now
50
- start_index.upto(end_index) do |i|
51
- case operation
52
- when :read
53
- redis.get(i)
54
- when :write
55
- redis.incr(i)
56
- else
57
- raise "Unknown operation: #{operation}"
58
- end
59
- sleep sleep_duration
60
- end
61
- t2 = Time.now
62
-
63
- requests_processed = end_index - start_index
64
- time = t2 - t1
65
- puts "#{t2.strftime("%H:%M")} [segment #{end_index + 1}] : Processed #{requests_processed} requests in #{time} seconds - #{(requests_processed/time).round} requests/sec"
66
- end
67
-
68
- else
69
- raise "Unknown operation: #{operation}"
70
- end
71
-