time_bandits 0.12.7 → 0.13.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Appraisals +6 -3
- data/CHANGELOG.md +4 -1
- data/Gemfile +2 -0
- data/docker-compose.yml +1 -1
- data/lib/time_bandits/monkey_patches/redis.rb +30 -6
- data/lib/time_bandits/time_consumers/redis.rb +1 -1
- data/lib/time_bandits/version.rb +1 -1
- data/test/unit/redis_test.rb +4 -4
- data/time_bandits.gemspec +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b008edd801936f7287a5cfd453ed13af7c883ec9780731e78a490da3ddaa3c6f
|
4
|
+
data.tar.gz: f062f276b88df3b380e8dc6b9ddda4c81e164c878f6e5867167e43bf9155ab06
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9c60df11a4defd9f8764d267575b72918077fd51f0380a3f655af5f6f5b9b7c9e15a43621869f6f34623ee859d04feb35f91427fd60a50d33ec4fae97e6a8196
|
7
|
+
data.tar.gz: f862c5684068b9ba85bfac90a4472639a3e3c72f1b0ea63e83824f4b635bbb8e853e79706015ceb633c12ad636bdcdc7c8bff2821b4f894846bcd61def5da757
|
data/Appraisals
CHANGED
@@ -7,8 +7,11 @@ appraisals.insert(0, "5.2.6") if Gem::Version.new(RUBY_VERSION) < Gem::Version.n
|
|
7
7
|
appraisals << "7.0.2.3" if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new("2.7.0")
|
8
8
|
|
9
9
|
appraisals.each do |rails_version|
|
10
|
-
|
11
|
-
|
12
|
-
|
10
|
+
%w(4.0 5.0).each do |redis_version|
|
11
|
+
appraise "activesupport-#{rails_version}-redis-#{redis_version}" do
|
12
|
+
gem "redis", "~> #{redis_version}"
|
13
|
+
gem "activesupport", rails_version
|
14
|
+
gem "activerecord", rails_version
|
15
|
+
end
|
13
16
|
end
|
14
17
|
end
|
data/CHANGELOG.md
CHANGED
data/Gemfile
CHANGED
data/docker-compose.yml
CHANGED
@@ -1,12 +1,36 @@
|
|
1
1
|
require 'redis'
|
2
|
-
class Redis
|
3
|
-
class Client
|
4
|
-
alias :old_logging :logging
|
5
2
|
|
6
|
-
|
7
|
-
|
8
|
-
|
3
|
+
if Redis::VERSION < "5.0"
|
4
|
+
|
5
|
+
class Redis
|
6
|
+
class Client
|
7
|
+
alias :old_logging :logging
|
8
|
+
|
9
|
+
def logging(commands, &block)
|
10
|
+
ActiveSupport::Notifications.instrument('request.redis', commands: commands) do
|
11
|
+
old_logging(commands, &block)
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
else
|
18
|
+
|
19
|
+
module TimeBandits
|
20
|
+
module RedisInstrumentation
|
21
|
+
def call(command, redis_config)
|
22
|
+
ActiveSupport::Notifications.instrument("request.redis", commands: [command]) do
|
23
|
+
super
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
def call_pipelined(commands, redis_config)
|
28
|
+
ActiveSupport::Notifications.instrument("request.redis", commands: commands) do
|
29
|
+
super
|
30
|
+
end
|
9
31
|
end
|
10
32
|
end
|
11
33
|
end
|
34
|
+
RedisClient.register(TimeBandits::RedisInstrumentation)
|
35
|
+
|
12
36
|
end
|
data/lib/time_bandits/version.rb
CHANGED
data/test/unit/redis_test.rb
CHANGED
@@ -54,10 +54,10 @@ class RedisTest < Test::Unit::TestCase
|
|
54
54
|
private
|
55
55
|
def pipelined_work(type = :pipelined)
|
56
56
|
TimeBandits.reset
|
57
|
-
@redis.send(type) do
|
58
|
-
|
59
|
-
|
60
|
-
|
57
|
+
@redis.send(type) do |transaction|
|
58
|
+
transaction.get("foo")
|
59
|
+
transaction.set("bar", 1)
|
60
|
+
transaction.hgetall("baz")
|
61
61
|
end
|
62
62
|
end
|
63
63
|
|
data/time_bandits.gemspec
CHANGED
@@ -33,7 +33,7 @@ Gem::Specification.new do |s|
|
|
33
33
|
s.add_development_dependency("mocha")
|
34
34
|
s.add_development_dependency("mysql2")
|
35
35
|
s.add_development_dependency("rake")
|
36
|
-
s.add_development_dependency("redis"
|
36
|
+
s.add_development_dependency("redis")
|
37
37
|
s.add_development_dependency("sequel")
|
38
38
|
s.add_development_dependency("activerecord")
|
39
39
|
s.add_development_dependency("beetle", ">= 3.4.1")
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: time_bandits
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.13.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stefan Kaes
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-09-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thread_variables
|
@@ -168,16 +168,16 @@ dependencies:
|
|
168
168
|
name: redis
|
169
169
|
requirement: !ruby/object:Gem::Requirement
|
170
170
|
requirements:
|
171
|
-
- - "
|
171
|
+
- - ">="
|
172
172
|
- !ruby/object:Gem::Version
|
173
|
-
version: '
|
173
|
+
version: '0'
|
174
174
|
type: :development
|
175
175
|
prerelease: false
|
176
176
|
version_requirements: !ruby/object:Gem::Requirement
|
177
177
|
requirements:
|
178
|
-
- - "
|
178
|
+
- - ">="
|
179
179
|
- !ruby/object:Gem::Version
|
180
|
-
version: '
|
180
|
+
version: '0'
|
181
181
|
- !ruby/object:Gem::Dependency
|
182
182
|
name: sequel
|
183
183
|
requirement: !ruby/object:Gem::Requirement
|