redis 4.0.0 → 5.0.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 (137) hide show
  1. checksums.yaml +5 -5
  2. data/CHANGELOG.md +252 -1
  3. data/README.md +126 -88
  4. data/lib/redis/client.rb +79 -543
  5. data/lib/redis/commands/bitmaps.rb +66 -0
  6. data/lib/redis/commands/cluster.rb +28 -0
  7. data/lib/redis/commands/connection.rb +53 -0
  8. data/lib/redis/commands/geo.rb +84 -0
  9. data/lib/redis/commands/hashes.rb +254 -0
  10. data/lib/redis/commands/hyper_log_log.rb +37 -0
  11. data/lib/redis/commands/keys.rb +437 -0
  12. data/lib/redis/commands/lists.rb +285 -0
  13. data/lib/redis/commands/pubsub.rb +54 -0
  14. data/lib/redis/commands/scripting.rb +114 -0
  15. data/lib/redis/commands/server.rb +188 -0
  16. data/lib/redis/commands/sets.rb +214 -0
  17. data/lib/redis/commands/sorted_sets.rb +818 -0
  18. data/lib/redis/commands/streams.rb +384 -0
  19. data/lib/redis/commands/strings.rb +314 -0
  20. data/lib/redis/commands/transactions.rb +115 -0
  21. data/lib/redis/commands.rb +235 -0
  22. data/lib/redis/distributed.rb +301 -109
  23. data/lib/redis/errors.rb +19 -1
  24. data/lib/redis/hash_ring.rb +34 -33
  25. data/lib/redis/pipeline.rb +69 -77
  26. data/lib/redis/subscribe.rb +26 -19
  27. data/lib/redis/version.rb +3 -1
  28. data/lib/redis.rb +109 -2728
  29. metadata +37 -229
  30. data/.gitignore +0 -16
  31. data/.travis/Gemfile +0 -13
  32. data/.travis.yml +0 -73
  33. data/.yardopts +0 -3
  34. data/Gemfile +0 -3
  35. data/benchmarking/logging.rb +0 -71
  36. data/benchmarking/pipeline.rb +0 -51
  37. data/benchmarking/speed.rb +0 -21
  38. data/benchmarking/suite.rb +0 -24
  39. data/benchmarking/worker.rb +0 -71
  40. data/bors.toml +0 -14
  41. data/examples/basic.rb +0 -15
  42. data/examples/consistency.rb +0 -114
  43. data/examples/dist_redis.rb +0 -43
  44. data/examples/incr-decr.rb +0 -17
  45. data/examples/list.rb +0 -26
  46. data/examples/pubsub.rb +0 -37
  47. data/examples/sentinel/sentinel.conf +0 -9
  48. data/examples/sentinel/start +0 -49
  49. data/examples/sentinel.rb +0 -41
  50. data/examples/sets.rb +0 -36
  51. data/examples/unicorn/config.ru +0 -3
  52. data/examples/unicorn/unicorn.rb +0 -20
  53. data/lib/redis/connection/command_helper.rb +0 -38
  54. data/lib/redis/connection/hiredis.rb +0 -66
  55. data/lib/redis/connection/registry.rb +0 -12
  56. data/lib/redis/connection/ruby.rb +0 -409
  57. data/lib/redis/connection/synchrony.rb +0 -141
  58. data/lib/redis/connection.rb +0 -9
  59. data/makefile +0 -42
  60. data/redis.gemspec +0 -42
  61. data/test/bitpos_test.rb +0 -63
  62. data/test/blocking_commands_test.rb +0 -40
  63. data/test/client_test.rb +0 -59
  64. data/test/command_map_test.rb +0 -28
  65. data/test/commands_on_hashes_test.rb +0 -19
  66. data/test/commands_on_hyper_log_log_test.rb +0 -19
  67. data/test/commands_on_lists_test.rb +0 -18
  68. data/test/commands_on_sets_test.rb +0 -75
  69. data/test/commands_on_sorted_sets_test.rb +0 -150
  70. data/test/commands_on_strings_test.rb +0 -99
  71. data/test/commands_on_value_types_test.rb +0 -131
  72. data/test/connection_handling_test.rb +0 -275
  73. data/test/db/.gitkeep +0 -0
  74. data/test/distributed_blocking_commands_test.rb +0 -44
  75. data/test/distributed_commands_on_hashes_test.rb +0 -8
  76. data/test/distributed_commands_on_hyper_log_log_test.rb +0 -31
  77. data/test/distributed_commands_on_lists_test.rb +0 -20
  78. data/test/distributed_commands_on_sets_test.rb +0 -81
  79. data/test/distributed_commands_on_sorted_sets_test.rb +0 -16
  80. data/test/distributed_commands_on_strings_test.rb +0 -57
  81. data/test/distributed_commands_on_value_types_test.rb +0 -93
  82. data/test/distributed_commands_requiring_clustering_test.rb +0 -162
  83. data/test/distributed_connection_handling_test.rb +0 -21
  84. data/test/distributed_internals_test.rb +0 -68
  85. data/test/distributed_key_tags_test.rb +0 -50
  86. data/test/distributed_persistence_control_commands_test.rb +0 -24
  87. data/test/distributed_publish_subscribe_test.rb +0 -90
  88. data/test/distributed_remote_server_control_commands_test.rb +0 -64
  89. data/test/distributed_scripting_test.rb +0 -100
  90. data/test/distributed_sorting_test.rb +0 -18
  91. data/test/distributed_test.rb +0 -56
  92. data/test/distributed_transactions_test.rb +0 -30
  93. data/test/encoding_test.rb +0 -14
  94. data/test/error_replies_test.rb +0 -57
  95. data/test/fork_safety_test.rb +0 -60
  96. data/test/helper.rb +0 -201
  97. data/test/helper_test.rb +0 -22
  98. data/test/internals_test.rb +0 -429
  99. data/test/lint/blocking_commands.rb +0 -150
  100. data/test/lint/hashes.rb +0 -162
  101. data/test/lint/hyper_log_log.rb +0 -60
  102. data/test/lint/lists.rb +0 -143
  103. data/test/lint/sets.rb +0 -140
  104. data/test/lint/sorted_sets.rb +0 -316
  105. data/test/lint/strings.rb +0 -246
  106. data/test/lint/value_types.rb +0 -130
  107. data/test/persistence_control_commands_test.rb +0 -24
  108. data/test/pipelining_commands_test.rb +0 -238
  109. data/test/publish_subscribe_test.rb +0 -280
  110. data/test/remote_server_control_commands_test.rb +0 -175
  111. data/test/scanning_test.rb +0 -407
  112. data/test/scripting_test.rb +0 -76
  113. data/test/sentinel_command_test.rb +0 -78
  114. data/test/sentinel_test.rb +0 -253
  115. data/test/sorting_test.rb +0 -57
  116. data/test/ssl_test.rb +0 -69
  117. data/test/support/connection/hiredis.rb +0 -1
  118. data/test/support/connection/ruby.rb +0 -1
  119. data/test/support/connection/synchrony.rb +0 -17
  120. data/test/support/redis_mock.rb +0 -130
  121. data/test/support/ssl/gen_certs.sh +0 -31
  122. data/test/support/ssl/trusted-ca.crt +0 -25
  123. data/test/support/ssl/trusted-ca.key +0 -27
  124. data/test/support/ssl/trusted-cert.crt +0 -81
  125. data/test/support/ssl/trusted-cert.key +0 -28
  126. data/test/support/ssl/untrusted-ca.crt +0 -26
  127. data/test/support/ssl/untrusted-ca.key +0 -27
  128. data/test/support/ssl/untrusted-cert.crt +0 -82
  129. data/test/support/ssl/untrusted-cert.key +0 -28
  130. data/test/support/wire/synchrony.rb +0 -24
  131. data/test/support/wire/thread.rb +0 -5
  132. data/test/synchrony_driver.rb +0 -85
  133. data/test/test.conf.erb +0 -9
  134. data/test/thread_safety_test.rb +0 -60
  135. data/test/transactions_test.rb +0 -262
  136. data/test/unknown_commands_test.rb +0 -12
  137. 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.0
4
+ version: 5.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ezra Zygmuntowicz
@@ -13,53 +13,25 @@ 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: 2017-08-25 00:00:00.000000000 Z
19
+ date: 2022-08-29 00:00:00.000000000 Z
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
22
- name: test-unit
22
+ name: redis-client
23
23
  requirement: !ruby/object:Gem::Requirement
24
24
  requirements:
25
- - - ">="
25
+ - - "~>"
26
26
  - !ruby/object:Gem::Version
27
- version: 3.1.5
28
- type: :development
27
+ version: '0.7'
28
+ type: :runtime
29
29
  prerelease: false
30
30
  version_requirements: !ruby/object:Gem::Requirement
31
31
  requirements:
32
- - - ">="
32
+ - - "~>"
33
33
  - !ruby/object:Gem::Version
34
- version: 3.1.5
35
- - !ruby/object:Gem::Dependency
36
- name: hiredis
37
- requirement: !ruby/object:Gem::Requirement
38
- requirements:
39
- - - ">="
40
- - !ruby/object:Gem::Version
41
- version: '0'
42
- type: :development
43
- prerelease: false
44
- version_requirements: !ruby/object:Gem::Requirement
45
- requirements:
46
- - - ">="
47
- - !ruby/object:Gem::Version
48
- version: '0'
49
- - !ruby/object:Gem::Dependency
50
- name: em-synchrony
51
- requirement: !ruby/object:Gem::Requirement
52
- requirements:
53
- - - ">="
54
- - !ruby/object:Gem::Version
55
- version: '0'
56
- type: :development
57
- prerelease: false
58
- version_requirements: !ruby/object:Gem::Requirement
59
- requirements:
60
- - - ">="
61
- - !ruby/object:Gem::Version
62
- version: '0'
34
+ version: '0.7'
63
35
  description: |2
64
36
  A Ruby client that tries to match Redis' API one-to-one, while still
65
37
  providing an idiomatic interface.
@@ -69,130 +41,44 @@ executables: []
69
41
  extensions: []
70
42
  extra_rdoc_files: []
71
43
  files:
72
- - ".gitignore"
73
- - ".travis.yml"
74
- - ".travis/Gemfile"
75
- - ".yardopts"
76
44
  - CHANGELOG.md
77
- - Gemfile
78
45
  - LICENSE
79
46
  - README.md
80
- - benchmarking/logging.rb
81
- - benchmarking/pipeline.rb
82
- - benchmarking/speed.rb
83
- - benchmarking/suite.rb
84
- - benchmarking/worker.rb
85
- - bors.toml
86
- - examples/basic.rb
87
- - examples/consistency.rb
88
- - examples/dist_redis.rb
89
- - examples/incr-decr.rb
90
- - examples/list.rb
91
- - examples/pubsub.rb
92
- - examples/sentinel.rb
93
- - examples/sentinel/sentinel.conf
94
- - examples/sentinel/start
95
- - examples/sets.rb
96
- - examples/unicorn/config.ru
97
- - examples/unicorn/unicorn.rb
98
47
  - lib/redis.rb
99
48
  - lib/redis/client.rb
100
- - lib/redis/connection.rb
101
- - lib/redis/connection/command_helper.rb
102
- - lib/redis/connection/hiredis.rb
103
- - lib/redis/connection/registry.rb
104
- - lib/redis/connection/ruby.rb
105
- - lib/redis/connection/synchrony.rb
49
+ - lib/redis/commands.rb
50
+ - lib/redis/commands/bitmaps.rb
51
+ - lib/redis/commands/cluster.rb
52
+ - lib/redis/commands/connection.rb
53
+ - lib/redis/commands/geo.rb
54
+ - lib/redis/commands/hashes.rb
55
+ - lib/redis/commands/hyper_log_log.rb
56
+ - lib/redis/commands/keys.rb
57
+ - lib/redis/commands/lists.rb
58
+ - lib/redis/commands/pubsub.rb
59
+ - lib/redis/commands/scripting.rb
60
+ - lib/redis/commands/server.rb
61
+ - lib/redis/commands/sets.rb
62
+ - lib/redis/commands/sorted_sets.rb
63
+ - lib/redis/commands/streams.rb
64
+ - lib/redis/commands/strings.rb
65
+ - lib/redis/commands/transactions.rb
106
66
  - lib/redis/distributed.rb
107
67
  - lib/redis/errors.rb
108
68
  - lib/redis/hash_ring.rb
109
69
  - lib/redis/pipeline.rb
110
70
  - lib/redis/subscribe.rb
111
71
  - lib/redis/version.rb
112
- - makefile
113
- - redis.gemspec
114
- - test/bitpos_test.rb
115
- - test/blocking_commands_test.rb
116
- - test/client_test.rb
117
- - test/command_map_test.rb
118
- - test/commands_on_hashes_test.rb
119
- - test/commands_on_hyper_log_log_test.rb
120
- - test/commands_on_lists_test.rb
121
- - test/commands_on_sets_test.rb
122
- - test/commands_on_sorted_sets_test.rb
123
- - test/commands_on_strings_test.rb
124
- - test/commands_on_value_types_test.rb
125
- - test/connection_handling_test.rb
126
- - test/db/.gitkeep
127
- - test/distributed_blocking_commands_test.rb
128
- - test/distributed_commands_on_hashes_test.rb
129
- - test/distributed_commands_on_hyper_log_log_test.rb
130
- - test/distributed_commands_on_lists_test.rb
131
- - test/distributed_commands_on_sets_test.rb
132
- - test/distributed_commands_on_sorted_sets_test.rb
133
- - test/distributed_commands_on_strings_test.rb
134
- - test/distributed_commands_on_value_types_test.rb
135
- - test/distributed_commands_requiring_clustering_test.rb
136
- - test/distributed_connection_handling_test.rb
137
- - test/distributed_internals_test.rb
138
- - test/distributed_key_tags_test.rb
139
- - test/distributed_persistence_control_commands_test.rb
140
- - test/distributed_publish_subscribe_test.rb
141
- - test/distributed_remote_server_control_commands_test.rb
142
- - test/distributed_scripting_test.rb
143
- - test/distributed_sorting_test.rb
144
- - test/distributed_test.rb
145
- - test/distributed_transactions_test.rb
146
- - test/encoding_test.rb
147
- - test/error_replies_test.rb
148
- - test/fork_safety_test.rb
149
- - test/helper.rb
150
- - test/helper_test.rb
151
- - test/internals_test.rb
152
- - test/lint/blocking_commands.rb
153
- - test/lint/hashes.rb
154
- - test/lint/hyper_log_log.rb
155
- - test/lint/lists.rb
156
- - test/lint/sets.rb
157
- - test/lint/sorted_sets.rb
158
- - test/lint/strings.rb
159
- - test/lint/value_types.rb
160
- - test/persistence_control_commands_test.rb
161
- - test/pipelining_commands_test.rb
162
- - test/publish_subscribe_test.rb
163
- - test/remote_server_control_commands_test.rb
164
- - test/scanning_test.rb
165
- - test/scripting_test.rb
166
- - test/sentinel_command_test.rb
167
- - test/sentinel_test.rb
168
- - test/sorting_test.rb
169
- - test/ssl_test.rb
170
- - test/support/connection/hiredis.rb
171
- - test/support/connection/ruby.rb
172
- - test/support/connection/synchrony.rb
173
- - test/support/redis_mock.rb
174
- - test/support/ssl/gen_certs.sh
175
- - test/support/ssl/trusted-ca.crt
176
- - test/support/ssl/trusted-ca.key
177
- - test/support/ssl/trusted-cert.crt
178
- - test/support/ssl/trusted-cert.key
179
- - test/support/ssl/untrusted-ca.crt
180
- - test/support/ssl/untrusted-ca.key
181
- - test/support/ssl/untrusted-cert.crt
182
- - test/support/ssl/untrusted-cert.key
183
- - test/support/wire/synchrony.rb
184
- - test/support/wire/thread.rb
185
- - test/synchrony_driver.rb
186
- - test/test.conf.erb
187
- - test/thread_safety_test.rb
188
- - test/transactions_test.rb
189
- - test/unknown_commands_test.rb
190
- - test/url_param_test.rb
191
72
  homepage: https://github.com/redis/redis-rb
192
73
  licenses:
193
74
  - MIT
194
- metadata: {}
195
- post_install_message:
75
+ metadata:
76
+ bug_tracker_uri: https://github.com/redis/redis-rb/issues
77
+ changelog_uri: https://github.com/redis/redis-rb/blob/master/CHANGELOG.md
78
+ documentation_uri: https://www.rubydoc.info/gems/redis/5.0.0
79
+ homepage_uri: https://github.com/redis/redis-rb
80
+ source_code_uri: https://github.com/redis/redis-rb/tree/v5.0.0
81
+ post_install_message:
196
82
  rdoc_options: []
197
83
  require_paths:
198
84
  - lib
@@ -200,93 +86,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
200
86
  requirements:
201
87
  - - ">="
202
88
  - !ruby/object:Gem::Version
203
- version: 2.2.2
89
+ version: 2.5.0
204
90
  required_rubygems_version: !ruby/object:Gem::Requirement
205
91
  requirements:
206
92
  - - ">="
207
93
  - !ruby/object:Gem::Version
208
94
  version: '0'
209
95
  requirements: []
210
- rubyforge_project:
211
- rubygems_version: 2.5.1
212
- signing_key:
96
+ rubygems_version: 3.1.2
97
+ signing_key:
213
98
  specification_version: 4
214
99
  summary: A Ruby client library for Redis
215
- test_files:
216
- - test/bitpos_test.rb
217
- - test/blocking_commands_test.rb
218
- - test/client_test.rb
219
- - test/command_map_test.rb
220
- - test/commands_on_hashes_test.rb
221
- - test/commands_on_hyper_log_log_test.rb
222
- - test/commands_on_lists_test.rb
223
- - test/commands_on_sets_test.rb
224
- - test/commands_on_sorted_sets_test.rb
225
- - test/commands_on_strings_test.rb
226
- - test/commands_on_value_types_test.rb
227
- - test/connection_handling_test.rb
228
- - test/db/.gitkeep
229
- - test/distributed_blocking_commands_test.rb
230
- - test/distributed_commands_on_hashes_test.rb
231
- - test/distributed_commands_on_hyper_log_log_test.rb
232
- - test/distributed_commands_on_lists_test.rb
233
- - test/distributed_commands_on_sets_test.rb
234
- - test/distributed_commands_on_sorted_sets_test.rb
235
- - test/distributed_commands_on_strings_test.rb
236
- - test/distributed_commands_on_value_types_test.rb
237
- - test/distributed_commands_requiring_clustering_test.rb
238
- - test/distributed_connection_handling_test.rb
239
- - test/distributed_internals_test.rb
240
- - test/distributed_key_tags_test.rb
241
- - test/distributed_persistence_control_commands_test.rb
242
- - test/distributed_publish_subscribe_test.rb
243
- - test/distributed_remote_server_control_commands_test.rb
244
- - test/distributed_scripting_test.rb
245
- - test/distributed_sorting_test.rb
246
- - test/distributed_test.rb
247
- - test/distributed_transactions_test.rb
248
- - test/encoding_test.rb
249
- - test/error_replies_test.rb
250
- - test/fork_safety_test.rb
251
- - test/helper.rb
252
- - test/helper_test.rb
253
- - test/internals_test.rb
254
- - test/lint/blocking_commands.rb
255
- - test/lint/hashes.rb
256
- - test/lint/hyper_log_log.rb
257
- - test/lint/lists.rb
258
- - test/lint/sets.rb
259
- - test/lint/sorted_sets.rb
260
- - test/lint/strings.rb
261
- - test/lint/value_types.rb
262
- - test/persistence_control_commands_test.rb
263
- - test/pipelining_commands_test.rb
264
- - test/publish_subscribe_test.rb
265
- - test/remote_server_control_commands_test.rb
266
- - test/scanning_test.rb
267
- - test/scripting_test.rb
268
- - test/sentinel_command_test.rb
269
- - test/sentinel_test.rb
270
- - test/sorting_test.rb
271
- - test/ssl_test.rb
272
- - test/support/connection/hiredis.rb
273
- - test/support/connection/ruby.rb
274
- - test/support/connection/synchrony.rb
275
- - test/support/redis_mock.rb
276
- - test/support/ssl/gen_certs.sh
277
- - test/support/ssl/trusted-ca.crt
278
- - test/support/ssl/trusted-ca.key
279
- - test/support/ssl/trusted-cert.crt
280
- - test/support/ssl/trusted-cert.key
281
- - test/support/ssl/untrusted-ca.crt
282
- - test/support/ssl/untrusted-ca.key
283
- - test/support/ssl/untrusted-cert.crt
284
- - test/support/ssl/untrusted-cert.key
285
- - test/support/wire/synchrony.rb
286
- - test/support/wire/thread.rb
287
- - test/synchrony_driver.rb
288
- - test/test.conf.erb
289
- - test/thread_safety_test.rb
290
- - test/transactions_test.rb
291
- - test/unknown_commands_test.rb
292
- - test/url_param_test.rb
100
+ test_files: []
data/.gitignore DELETED
@@ -1,16 +0,0 @@
1
- *.rdb
2
- *.swp
3
- Gemfile.lock
4
- *.gem
5
- /tmp/
6
- /.idea
7
- /.yardoc
8
- /coverage/*
9
- /doc/
10
- /examples/sentinel/sentinel.conf
11
- /nohup.out
12
- /pkg/*
13
- /rdsrv
14
- /redis/*
15
- /test/db
16
- /test/test.conf
data/.travis/Gemfile DELETED
@@ -1,13 +0,0 @@
1
- source "https://rubygems.org"
2
-
3
- gemspec :path => "../"
4
-
5
- case ENV["DRIVER"]
6
- when "hiredis"
7
- gem "hiredis"
8
- when "synchrony"
9
- gem "hiredis"
10
- gem "em-synchrony"
11
- end
12
-
13
- gem 'test-unit', '>= 3.2.5'
data/.travis.yml DELETED
@@ -1,73 +0,0 @@
1
- language: ruby
2
-
3
- script: make test
4
-
5
- rvm:
6
- - 2.2.2
7
- - 2.3.3
8
- - 2.4.1
9
- - jruby-9
10
- - rbx-3
11
-
12
- gemfile: ".travis/Gemfile"
13
-
14
- sudo: false
15
-
16
- before_script:
17
- - if (ruby -e "exit RUBY_VERSION.to_f >= 2.4"); then export RUBYOPT="--enable-frozen-string-literal"; fi; echo $RUBYOPT
18
-
19
- env:
20
- global:
21
- - VERBOSE=true
22
- - TIMEOUT=1
23
- matrix:
24
- - DRIVER=ruby REDIS_BRANCH=3.0
25
- - DRIVER=ruby REDIS_BRANCH=3.2
26
- - DRIVER=hiredis REDIS_BRANCH=3.0
27
- - DRIVER=hiredis REDIS_BRANCH=3.2
28
- - DRIVER=synchrony REDIS_BRANCH=3.0
29
- - DRIVER=synchrony REDIS_BRANCH=3.2
30
- - DRIVER=ruby REDIS_BRANCH=unstable
31
-
32
- branches:
33
- only:
34
- - staging
35
- - trying
36
- - master
37
-
38
- matrix:
39
- exclude:
40
- # hiredis
41
- - rvm: jruby-9
42
- gemfile: .travis/Gemfile
43
- env: DRIVER=hiredis REDIS_BRANCH=3.0
44
- - rvm: jruby-9
45
- gemfile: .travis/Gemfile
46
- env: DRIVER=hiredis REDIS_BRANCH=3.2
47
- - rvm: jruby-9
48
- gemfile: .travis/Gemfile
49
- env: DRIVER=hiredis REDIS_BRANCH=3.0
50
- - rvm: jruby-9
51
- gemfile: .travis/Gemfile
52
- env: DRIVER=hiredis REDIS_BRANCH=3.2
53
-
54
- # synchrony
55
- - rvm: jruby-9
56
- gemfile: .travis/Gemfile
57
- env: DRIVER=synchrony REDIS_BRANCH=3.0
58
- - rvm: jruby-9
59
- gemfile: .travis/Gemfile
60
- env: DRIVER=synchrony REDIS_BRANCH=3.2
61
- - rvm: jruby-9
62
- gemfile: .travis/Gemfile
63
- env: DRIVER=synchrony REDIS_BRANCH=3.0
64
- - rvm: jruby-9
65
- gemfile: .travis/Gemfile
66
- env: DRIVER=synchrony REDIS_BRANCH=3.2
67
- allow_failures:
68
- - rvm: rbx-3
69
-
70
- notifications:
71
- irc:
72
- - irc.freenode.net#redis-rb
73
- email: false
data/.yardopts DELETED
@@ -1,3 +0,0 @@
1
- --exclude redis/connection
2
- --exclude redis/compat
3
- --markup markdown
data/Gemfile DELETED
@@ -1,3 +0,0 @@
1
- source 'https://rubygems.org'
2
-
3
- gemspec
@@ -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
-
data/bors.toml DELETED
@@ -1,14 +0,0 @@
1
- # Gate on Travis CI
2
- status = ["continuous-integration/travis-ci/push"]
3
-
4
- # Set bors's timeout to 6 hours
5
- #
6
- # bors's timeout should always be twice a long as the test suite takes.
7
- # This is to allow Travis to fast-fail a test; if one of the builders
8
- # immediately reports a failure, then bors will move on to the next batch,
9
- # leaving the slower builders to work through the already-doomed run and
10
- # the next one.
11
- #
12
- # At the time it was written, a run had taken 3 hours.
13
- # bors's default timeout is 4 hours.
14
- timeout_sec = 14400