rorvswild 1.5.16 → 1.5.17

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ffb6ec6265892f727afe8fe18df63993e111da43c2e9cace51a3836c478988ca
4
- data.tar.gz: e13d2690d2b9a9cfd771542092e22d88759f8cf554d2480e18edc8277f204a1d
3
+ metadata.gz: 6ce241e0d917e560c8a5683bdc210dbd4f5158cd7bf49444ced9548d85b61e5e
4
+ data.tar.gz: b354848c0048368c615e4c2dd5231864a164c127af0aaf590fbfcd5c2a1cb36c
5
5
  SHA512:
6
- metadata.gz: 85df854f496092f2438769c82a6d1ab568743f47a0d684d9db564289cd8b022412e0cf9ec9629cfb5652a1666f5ec15c054f4ce6dba3da2af067141d4343a9c8
7
- data.tar.gz: 736abc9c08a7970086daabc8c29c2272745a4cc37df53fe90362000fbcdbe61d4e2272f1b9db9d01a04e912bcc1b34f81281ce025ce13d75142fb6d35c87f2b7
6
+ metadata.gz: fc3e48e9328b450bfb3cb7e7e4536e249470bcf7cb1fd2b3c7f67416daa66e1c281e742446a97f868276ac3028a573a84247b80b7f3053fbaeb9f9dfe4209c57
7
+ data.tar.gz: eab70d88fd705bdd5d679b625a9b6e06b6612cff6eaa6dc5080d6cd80a38f6f28e1a198f475b683cecdb25be7ac98d54a67eecfb8ee8cea230d987248e846823
@@ -1,31 +1,45 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module RorVsWild
2
4
  module Plugin
3
5
  class Redis
4
6
  def self.setup
5
7
  return if !defined?(::Redis)
6
- return if ::Redis::Client.method_defined?(:process_without_rorvswild)
7
- ::Redis::Client.class_eval do
8
- alias_method :process_without_rorvswild, :process
8
+ if ::Redis::Client.method_defined?(:process)
9
+ ::Redis::Client.prepend(V4)
10
+ else
11
+ ::Redis.prepend(V5)
12
+ end
13
+ end
9
14
 
10
- def process(commands, &block)
11
- string = RorVsWild::Plugin::Redis.commands_to_string(commands)
12
- appendable = RorVsWild::Plugin::Redis.appendable_commands?(commands)
13
- RorVsWild.agent.measure_section(string, appendable_command: appendable, kind: "redis".freeze) do
14
- process_without_rorvswild(commands, &block)
15
- end
15
+ module V4
16
+ def process(commands, &block)
17
+ string = commands.map(&:first).join("\n")
18
+ appendable = APPENDABLE_COMMANDS.include?(commands[0][0])
19
+ RorVsWild.agent.measure_section(string, appendable_command: appendable, kind: "redis") do
20
+ super(commands, &block)
16
21
  end
17
22
  end
18
23
  end
19
24
 
20
- def self.commands_to_string(commands)
21
- commands.map { |c| c[0] }.join("\n".freeze)
22
- end
25
+ module V5
26
+ def send_command(command, &block)
27
+ appendable = APPENDABLE_COMMANDS.include?(command)
28
+ RorVsWild.agent.measure_section(command[0], appendable_command: appendable, kind: "redis") do
29
+ super(command, &block)
30
+ end
31
+ end
23
32
 
24
- APPENDABLE_COMMANDS = [:auth, :select]
33
+ def pipelined
34
+ RorVsWild.agent.measure_section("pipeline", kind: "redis") { super }
35
+ end
25
36
 
26
- def self.appendable_commands?(commands)
27
- commands.size == 1 && APPENDABLE_COMMANDS.include?(commands.first.first)
37
+ def multi
38
+ RorVsWild.agent.measure_section("multi", kind: "redis") { super }
39
+ end
28
40
  end
41
+
42
+ APPENDABLE_COMMANDS = [:auth, :select]
29
43
  end
30
44
  end
31
45
  end
@@ -1,3 +1,3 @@
1
1
  module RorVsWild
2
- VERSION = "1.5.16".freeze
2
+ VERSION = "1.5.17".freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rorvswild
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.16
4
+ version: 1.5.17
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexis Bernard
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2022-10-03 00:00:00.000000000 Z
12
+ date: 2022-10-25 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: Performances and errors insights for rails developers.
15
15
  email: