rorvswild 1.5.13 → 1.5.14
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +9 -11
- data/lib/rorvswild/agent.rb +2 -2
- data/lib/rorvswild/plugin/net_http.rb +1 -4
- data/lib/rorvswild/plugin/redis.rb +1 -1
- data/lib/rorvswild/version.rb +1 -1
- data/lib/rorvswild.rb +4 -0
- metadata +9 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 46b5f40b58c450a91d4ccef20ecca01087c6a91ab5914fc15dacf98f759ba2ef
|
4
|
+
data.tar.gz: '094aaa9bccc0c1ba609407de5f253875ef86a537392cc740d5daea3b35b6b294'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d3f133b046fe451a3f2614a56db5b4581e74f1679ee1a5678f4e03ad070c1e57c14ae344d59126efe217aedaac9f27b9e09c19501bb5c1a64c395e5199352c74
|
7
|
+
data.tar.gz: ebf70177f6200fd0f2103e4cd2f2a3fe8378a6a02871c5d66de5299c2228c4906d17c23fc3185b6b0a3f7385abc3b28dd248f6554864ec93bbb21911a5499624
|
data/README.md
CHANGED
@@ -89,24 +89,22 @@ If you are using `Rack::Deflater` middleware you won't see the small button in t
|
|
89
89
|
*RoRvsWild.com* makes it easy to monitor requests, background jobs and errors in your production and staging environment.
|
90
90
|
It also comes with some extra options listed below.
|
91
91
|
|
92
|
-
#### Measure any code
|
92
|
+
#### Measure any section of code
|
93
93
|
|
94
|
-
|
94
|
+
RorVsWild measures a lot of events such as SQL queries. But it might not be enough for you. There is a solution to measure any section of code to help you find the most hidden bottlenecks.
|
95
95
|
|
96
96
|
```ruby
|
97
|
-
|
98
|
-
|
97
|
+
# Measure a code given as a string
|
98
|
+
RorVsWild.measure("bubble_sort(array)")
|
99
99
|
|
100
|
-
|
100
|
+
# Measure a code given as a block
|
101
|
+
RorVsWild.measure { bubble_sort(array) }
|
101
102
|
|
102
|
-
|
103
|
-
RorVsWild.
|
103
|
+
# Measure a code given as a block with an optional description
|
104
|
+
RorVsWild.measure("Optional description") { bubble_sort(array) }
|
104
105
|
```
|
105
106
|
|
106
|
-
|
107
|
-
|
108
|
-
Note that Calling `measure_code` or `measure_block` inside or a request or a job will add a section.
|
109
|
-
That is convenient to profile finely parts of your code.
|
107
|
+
For each custom measure, a section is added with the file name and line number where it has been called.
|
110
108
|
|
111
109
|
#### Send errors manually
|
112
110
|
|
data/lib/rorvswild/agent.rb
CHANGED
@@ -16,7 +16,7 @@ module RorVsWild
|
|
16
16
|
|
17
17
|
def self.default_ignored_exceptions
|
18
18
|
if defined?(Rails)
|
19
|
-
|
19
|
+
ActionDispatch::ExceptionWrapper.rescue_responses.keys
|
20
20
|
else
|
21
21
|
[]
|
22
22
|
end
|
@@ -49,7 +49,7 @@ module RorVsWild
|
|
49
49
|
measure_block(code) { eval(code) }
|
50
50
|
end
|
51
51
|
|
52
|
-
def measure_block(name, kind = "code".freeze, &block)
|
52
|
+
def measure_block(name = nil, kind = "code".freeze, &block)
|
53
53
|
current_data ? measure_section(name, kind: kind, &block) : measure_job(name, &block)
|
54
54
|
end
|
55
55
|
|
@@ -2,7 +2,6 @@ module RorVsWild
|
|
2
2
|
module Plugin
|
3
3
|
class NetHttp
|
4
4
|
HTTP = "http".freeze
|
5
|
-
HTTPS = "https".freeze
|
6
5
|
|
7
6
|
def self.setup
|
8
7
|
return if !defined?(Net::HTTP)
|
@@ -21,9 +20,7 @@ module RorVsWild
|
|
21
20
|
|
22
21
|
def request_with_rorvswild(req, body = nil, &block)
|
23
22
|
return request_without_rorvswild(req, body, &block) if request_called_twice?
|
24
|
-
|
25
|
-
url = "#{req.method} #{scheme}://#{address}#{req.path}"
|
26
|
-
RorVsWild.agent.measure_section(url, kind: HTTP) do
|
23
|
+
RorVsWild.agent.measure_section("#{req.method} #{address}", kind: HTTP) do
|
27
24
|
request_without_rorvswild(req, body, &block)
|
28
25
|
end
|
29
26
|
end
|
@@ -18,7 +18,7 @@ module RorVsWild
|
|
18
18
|
end
|
19
19
|
|
20
20
|
def self.commands_to_string(commands)
|
21
|
-
commands.map { |c| c[0]
|
21
|
+
commands.map { |c| c[0] }.join("\n".freeze)
|
22
22
|
end
|
23
23
|
|
24
24
|
APPENDABLE_COMMANDS = [:auth, :select]
|
data/lib/rorvswild/version.rb
CHANGED
data/lib/rorvswild.rb
CHANGED
@@ -23,6 +23,10 @@ module RorVsWild
|
|
23
23
|
@logger ||= initialize_logger
|
24
24
|
end
|
25
25
|
|
26
|
+
def self.measure(code_or_name = nil, &block)
|
27
|
+
block ? measure_block(code_or_name, &block) : measure_code(code_or_name)
|
28
|
+
end
|
29
|
+
|
26
30
|
def self.measure_code(code)
|
27
31
|
agent ? agent.measure_code(code) : eval(code)
|
28
32
|
end
|
metadata
CHANGED
@@ -1,15 +1,15 @@
|
|
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.14
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alexis Bernard
|
8
8
|
- Antoine Marguerie
|
9
|
-
autorequire:
|
9
|
+
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2022-07-15 00:00:00.000000000 Z
|
13
13
|
dependencies: []
|
14
14
|
description: Performances and errors insights for rails developers.
|
15
15
|
email:
|
@@ -62,8 +62,10 @@ files:
|
|
62
62
|
homepage: https://www.rorvswild.com
|
63
63
|
licenses:
|
64
64
|
- MIT
|
65
|
-
metadata:
|
66
|
-
|
65
|
+
metadata:
|
66
|
+
source_code_uri: https://github.com/BaseSecrete/rorvswild
|
67
|
+
changelog_uri: https://github.com/BaseSecrete/rorvswild/blob/master/CHANGELOG.md
|
68
|
+
post_install_message:
|
67
69
|
rdoc_options: []
|
68
70
|
require_paths:
|
69
71
|
- lib
|
@@ -78,8 +80,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
78
80
|
- !ruby/object:Gem::Version
|
79
81
|
version: '0'
|
80
82
|
requirements: []
|
81
|
-
rubygems_version: 3.
|
82
|
-
signing_key:
|
83
|
+
rubygems_version: 3.2.22
|
84
|
+
signing_key:
|
83
85
|
specification_version: 4
|
84
86
|
summary: Ruby on Rails applications monitoring
|
85
87
|
test_files: []
|