rorvswild 1.5.15 → 1.5.17
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/rorvswild/agent.rb +11 -0
- data/lib/rorvswild/metrics.rb +1 -1
- data/lib/rorvswild/plugin/redis.rb +29 -15
- data/lib/rorvswild/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6ce241e0d917e560c8a5683bdc210dbd4f5158cd7bf49444ced9548d85b61e5e
|
4
|
+
data.tar.gz: b354848c0048368c615e4c2dd5231864a164c127af0aaf590fbfcd5c2a1cb36c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fc3e48e9328b450bfb3cb7e7e4536e249470bcf7cb1fd2b3c7f67416daa66e1c281e742446a97f868276ac3028a573a84247b80b7f3053fbaeb9f9dfe4209c57
|
7
|
+
data.tar.gz: eab70d88fd705bdd5d679b625a9b6e06b6612cff6eaa6dc5080d6cd80a38f6f28e1a198f475b683cecdb25be7ac98d54a67eecfb8ee8cea230d987248e846823
|
data/lib/rorvswild/agent.rb
CHANGED
@@ -159,6 +159,17 @@ module RorVsWild
|
|
159
159
|
@os_description = RbConfig::CONFIG["host_os"]
|
160
160
|
end
|
161
161
|
|
162
|
+
def hostname
|
163
|
+
if gae_instance = ENV["GAE_INSTANCE"] || ENV["CLOUD_RUN_EXECUTION"]
|
164
|
+
gae_instance
|
165
|
+
elsif dyno = ENV["DYNO"] # Heroku
|
166
|
+
dyno.start_with?("run.") ? "run.*" :
|
167
|
+
dyno.start_with?("release.") ? "release.*" : dyno
|
168
|
+
else
|
169
|
+
Socket.gethostname
|
170
|
+
end
|
171
|
+
end
|
172
|
+
|
162
173
|
#######################
|
163
174
|
### Private methods ###
|
164
175
|
#######################
|
data/lib/rorvswild/metrics.rb
CHANGED
@@ -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
|
-
|
7
|
-
|
8
|
-
|
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
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
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
|
-
|
21
|
-
|
22
|
-
|
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
|
-
|
33
|
+
def pipelined
|
34
|
+
RorVsWild.agent.measure_section("pipeline", kind: "redis") { super }
|
35
|
+
end
|
25
36
|
|
26
|
-
|
27
|
-
|
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
|
data/lib/rorvswild/version.rb
CHANGED
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.
|
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-
|
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:
|