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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 262b40730d9fc77d334a2f3b4da10d4ddaea1cbd06b5c6c7da320d214ce18715
4
- data.tar.gz: abe5d9f0bcda336c7ced3a1eee9071c3d9fdef32c9c49c45914fb483d093ed2f
3
+ metadata.gz: 46b5f40b58c450a91d4ccef20ecca01087c6a91ab5914fc15dacf98f759ba2ef
4
+ data.tar.gz: '094aaa9bccc0c1ba609407de5f253875ef86a537392cc740d5daea3b35b6b294'
5
5
  SHA512:
6
- metadata.gz: 2b809c27a4e650398c384ee828026381828d145393ea13f31d02cedc9b17be540dd0bec22845b293526d33658b33e5118faddaebf21866016c902f233e30a722
7
- data.tar.gz: 9c75b3789da4f450ee58bd47b9bdbb536b6076a28af82366b2c18f4546e5e2d04cbe8df5c4db1362731b83719e1713a2525bc03b25cb5108eab56827056717a5
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
- You can measure any code like this (useful to monitor cronjobs):
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
- RorVsWild.measure_code("User.all.do_something_great")
98
- ```
97
+ # Measure a code given as a string
98
+ RorVsWild.measure("bubble_sort(array)")
99
99
 
100
- Or like that:
100
+ # Measure a code given as a block
101
+ RorVsWild.measure { bubble_sort(array) }
101
102
 
102
- ```ruby
103
- RorVsWild.measure_block("A great job name") { User.all.do_something_great }
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
- Then it will appear in the jobs page.
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
 
@@ -16,7 +16,7 @@ module RorVsWild
16
16
 
17
17
  def self.default_ignored_exceptions
18
18
  if defined?(Rails)
19
- %w[ActionController::RoutingError] + Rails.application.config.action_dispatch.rescue_responses.map { |(key,value)| key }
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
- scheme = use_ssl? ? HTTPS : HTTP
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] == :auth ? "auth *****".freeze : c.join(" ".freeze) }.join("\n".freeze)
21
+ commands.map { |c| c[0] }.join("\n".freeze)
22
22
  end
23
23
 
24
24
  APPENDABLE_COMMANDS = [:auth, :select]
@@ -1,3 +1,3 @@
1
1
  module RorVsWild
2
- VERSION = "1.5.13".freeze
2
+ VERSION = "1.5.14".freeze
3
3
  end
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.13
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: 2021-12-01 00:00:00.000000000 Z
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
- post_install_message:
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.0.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: []