cacheflow 0.2.1 → 0.3.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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/README.md +0 -2
- data/lib/cacheflow/redis.rb +30 -1
- data/lib/cacheflow/version.rb +1 -1
- data/lib/cacheflow.rb +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: dc96e1e878dacf8275f2113b546cfab2d64baa98df3187c6b828c6f5397e9d6a
|
4
|
+
data.tar.gz: 181f8cd6e5c6c0f1abd5a349d5ebef1892c31e609148577c6a262b1c4ba2c9f7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f174f62627d4c487ca492cf416cefa2369f713bfaefcac323ab6d0db8eae60aa29730af6d999db188f7a41c8413a4162fe6f4ed5a63aa773d72e9bfa1c1c17be
|
7
|
+
data.tar.gz: 1a58a047b78cc91760e7336bd3b014d716d01c7ccc8312ef5c8a045fdeaf5ebb1647a7b97b7e8136475a624215c4ba5e5dca8e13fba13333517d878203ab25df
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -2,8 +2,6 @@
|
|
2
2
|
|
3
3
|
Colorized logging for Memcached and Redis
|
4
4
|
|
5
|
-

|
6
|
-
|
7
5
|
Works with the Rails cache, as well as [Dalli](https://github.com/petergoldstein/dalli) and [Redis](https://github.com/redis/redis-rb) clients directly
|
8
6
|
|
9
7
|
[](https://github.com/ankane/cacheflow/actions)
|
data/lib/cacheflow/redis.rb
CHANGED
@@ -1,5 +1,27 @@
|
|
1
1
|
module Cacheflow
|
2
2
|
module Redis
|
3
|
+
# redis 5 / redis-client
|
4
|
+
module ClientNotifications
|
5
|
+
def call(command, redis_config)
|
6
|
+
payload = {
|
7
|
+
commands: [command]
|
8
|
+
}
|
9
|
+
ActiveSupport::Notifications.instrument("query.redis", payload) do
|
10
|
+
super
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
def call_pipelined(commands, redis_config)
|
15
|
+
payload = {
|
16
|
+
commands: commands
|
17
|
+
}
|
18
|
+
ActiveSupport::Notifications.instrument("query.redis", payload) do
|
19
|
+
super
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
# redis 4
|
3
25
|
module Notifications
|
4
26
|
def logging(commands)
|
5
27
|
payload = {
|
@@ -28,5 +50,12 @@ module Cacheflow
|
|
28
50
|
end
|
29
51
|
end
|
30
52
|
|
31
|
-
|
53
|
+
if defined?(RedisClient)
|
54
|
+
RedisClient.register(Cacheflow::Redis::ClientNotifications)
|
55
|
+
end
|
56
|
+
|
57
|
+
if Redis::VERSION.to_i < 5
|
58
|
+
Redis::Client.prepend(Cacheflow::Redis::Notifications)
|
59
|
+
end
|
60
|
+
|
32
61
|
Cacheflow::Redis::Instrumenter.attach_to(:redis)
|
data/lib/cacheflow/version.rb
CHANGED
data/lib/cacheflow.rb
CHANGED
@@ -7,7 +7,7 @@ require "cacheflow/version"
|
|
7
7
|
module Cacheflow
|
8
8
|
def self.activate
|
9
9
|
require "cacheflow/memcached" if defined?(Dalli)
|
10
|
-
require "cacheflow/redis" if defined?(Redis)
|
10
|
+
require "cacheflow/redis" if defined?(Redis) || defined?(RedisClient)
|
11
11
|
end
|
12
12
|
|
13
13
|
def self.silenced?
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cacheflow
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew Kane
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-09-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '6'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '
|
26
|
+
version: '6'
|
27
27
|
description:
|
28
28
|
email: andrew@ankane.org
|
29
29
|
executables: []
|
@@ -50,14 +50,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
50
50
|
requirements:
|
51
51
|
- - ">="
|
52
52
|
- !ruby/object:Gem::Version
|
53
|
-
version: '2.
|
53
|
+
version: '2.7'
|
54
54
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
55
55
|
requirements:
|
56
56
|
- - ">="
|
57
57
|
- !ruby/object:Gem::Version
|
58
58
|
version: '0'
|
59
59
|
requirements: []
|
60
|
-
rubygems_version: 3.3.
|
60
|
+
rubygems_version: 3.3.7
|
61
61
|
signing_key:
|
62
62
|
specification_version: 4
|
63
63
|
summary: Colorized logging for Memcached and Redis
|