rorvswild 1.6.0 → 1.6.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +49 -8
- data/lib/rorvswild/agent.rb +2 -0
- data/lib/rorvswild/deployment.rb +14 -9
- data/lib/rorvswild/host.rb +5 -1
- data/lib/rorvswild/installer.rb +29 -21
- 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: f0d7eae69ceb93804c2297b8fb97a400e09d183eeeb46ac879dc02873ba7f5b0
|
4
|
+
data.tar.gz: 0bfe3e2d48fcecd010eeb399ad896d6e4e519073aa6ae0fc160ebcb9e1cf554c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5bf001a094bfa234414b8247c18d57159b734f1a829ef62997cdf66b7265fdc40e9cdad0530ecac8bc108459b202930487f0cad30b610cc4ebd7b00326ef17af
|
7
|
+
data.tar.gz: 25ace108524d491befd74c9682c92f2a95e17c4ee4b8e11174143bb29425685074d81923f4cf981e0f0dc313ab7c493731206037d6036d2d74ff633411519ffd
|
data/README.md
CHANGED
@@ -218,30 +218,71 @@ In the case you want a custom logger such as Syslog, you can only do it by initi
|
|
218
218
|
RorVsWild.start(api_key: "API_KEY", logger: Logger::Syslog.new)
|
219
219
|
```
|
220
220
|
|
221
|
-
|
221
|
+
### Deployment tracking
|
222
222
|
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
It
|
223
|
+
Since version 1.6.0, RorVsWild compares performances between each deployment.
|
224
|
+
That is convenient to detect quickly a performance deterioration.
|
225
|
+
|
226
|
+
It is working without any actions from your part if the application is :
|
227
|
+
|
228
|
+
- Deployed via Capistrano
|
229
|
+
- Inside a Git repositoriy
|
230
|
+
- Hosted on Heroku if [Dyno metadata](https://devcenter.heroku.com/articles/dyno-metadata) is enabled
|
231
|
+
- Hosted on Scalingo
|
232
|
+
|
233
|
+
Because we are not aware of all cloud hosting providers, there is a generic method to provide these data via the configuration :
|
227
234
|
|
228
235
|
```yaml
|
229
236
|
# config/rorvswild.yml
|
230
237
|
production:
|
231
238
|
api_key: API_KEY
|
232
|
-
|
233
|
-
|
239
|
+
deployment:
|
240
|
+
revision: <%= "Anything that will return the deployment version" %> # Mandatory
|
241
|
+
description: <%= "Eventually if you have a description such as a Git message" %>
|
242
|
+
author: <%= "Author's name of the deployment" %>
|
243
|
+
email: <%= "emailOf@theAuthor.com" %>
|
234
244
|
```
|
235
245
|
|
236
246
|
Here is the equivalent if you prefer initialising RorVsWild manually :
|
237
247
|
|
238
248
|
```ruby
|
239
249
|
# config/initializers/rorvswild.rb
|
240
|
-
RorVsWild.start(api_key: "API_KEY",
|
250
|
+
RorVsWild.start(api_key: "API_KEY", deployment: {
|
251
|
+
revision: "Unique version number such as Git commit ID",
|
252
|
+
description: "Message such as in Git",
|
253
|
+
author: "Deployer's name",
|
254
|
+
email: "Deployer's email"
|
255
|
+
})
|
241
256
|
```
|
242
257
|
|
258
|
+
Only the revision is mandatory, but it's better if you are able to provide more information.
|
259
|
+
|
260
|
+
|
261
|
+
#### Server metrics monitoring
|
262
|
+
|
263
|
+
Since version 1.6.0 RorVsWild monitors server metrics such as load average, CPU, memory, swap and disk space.
|
264
|
+
For now, only Linux is supported.
|
243
265
|
The data are available in a server tab beside requests and jobs.
|
244
266
|
|
267
|
+
Metrics are grouped by hostnames.
|
268
|
+
Cloud providers give random hostnames which change on every deployment.
|
269
|
+
You can manually define them:
|
270
|
+
|
271
|
+
```yaml
|
272
|
+
# config/rorvswild.yml
|
273
|
+
production:
|
274
|
+
api_key: API_KEY
|
275
|
+
server:
|
276
|
+
name: <%= "Some code that return a relevant hostname" %>
|
277
|
+
```
|
278
|
+
|
279
|
+
Here is the equivalent if you prefer initialising RorVsWild manually :
|
280
|
+
|
281
|
+
```ruby
|
282
|
+
# config/initializers/rorvswild.rb
|
283
|
+
RorVsWild.start(api_key: "API_KEY", server: {name: "host.name"})
|
284
|
+
```
|
285
|
+
|
245
286
|
## Contributing
|
246
287
|
|
247
288
|
1. Fork it ( https://github.com/[my-github-username]/rorvswild/fork )
|
data/lib/rorvswild/agent.rb
CHANGED
@@ -30,6 +30,8 @@ module RorVsWild
|
|
30
30
|
@client = Client.new(@config)
|
31
31
|
@queue = config[:queue] || Queue.new(client)
|
32
32
|
@locator = RorVsWild::Locator.new
|
33
|
+
Host.load_config(config)
|
34
|
+
Deployment.load_config(config)
|
33
35
|
|
34
36
|
RorVsWild.logger.debug("Start RorVsWild #{RorVsWild::VERSION}")
|
35
37
|
setup_plugins
|
data/lib/rorvswild/deployment.rb
CHANGED
@@ -2,20 +2,30 @@
|
|
2
2
|
|
3
3
|
module RorVsWild
|
4
4
|
module Deployment
|
5
|
+
def self.load_config(config)
|
6
|
+
read
|
7
|
+
if hash = config[:deployment]
|
8
|
+
@description = hash[:description]
|
9
|
+
@revision = hash[:revision]
|
10
|
+
@author = hash[:author]
|
11
|
+
@email = hash[:email]
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
5
15
|
def self.revision
|
6
|
-
|
16
|
+
@revision
|
7
17
|
end
|
8
18
|
|
9
19
|
def self.description
|
10
|
-
|
20
|
+
@description
|
11
21
|
end
|
12
22
|
|
13
23
|
def self.author
|
14
|
-
|
24
|
+
@author
|
15
25
|
end
|
16
26
|
|
17
27
|
def self.email
|
18
|
-
|
28
|
+
@email
|
19
29
|
end
|
20
30
|
|
21
31
|
def self.ruby
|
@@ -38,11 +48,6 @@ module RorVsWild
|
|
38
48
|
read_from_heroku || read_from_scalingo || read_from_git || read_from_capistrano
|
39
49
|
end
|
40
50
|
|
41
|
-
def self.read_once
|
42
|
-
@already_read || read
|
43
|
-
@already_read = true
|
44
|
-
end
|
45
|
-
|
46
51
|
private
|
47
52
|
|
48
53
|
def self.read_from_heroku
|
data/lib/rorvswild/host.rb
CHANGED
@@ -2,6 +2,10 @@
|
|
2
2
|
|
3
3
|
module RorVsWild
|
4
4
|
module Host
|
5
|
+
def self.load_config(config)
|
6
|
+
@name = config.dig(:server, :name)
|
7
|
+
end
|
8
|
+
|
5
9
|
def self.os
|
6
10
|
@os_description ||= `uname -sr`.strip
|
7
11
|
rescue Exception => ex
|
@@ -21,7 +25,7 @@ module RorVsWild
|
|
21
25
|
end
|
22
26
|
|
23
27
|
def self.name
|
24
|
-
if gae_instance = ENV["GAE_INSTANCE"] || ENV["CLOUD_RUN_EXECUTION"]
|
28
|
+
@name ||= if gae_instance = ENV["GAE_INSTANCE"] || ENV["CLOUD_RUN_EXECUTION"]
|
25
29
|
gae_instance
|
26
30
|
elsif dyno = ENV["DYNO"] # Heroku
|
27
31
|
dyno.start_with?("run.") ? "run.*" :
|
data/lib/rorvswild/installer.rb
CHANGED
@@ -4,7 +4,7 @@ module RorVsWild
|
|
4
4
|
|
5
5
|
def self.create_rails_config(api_key)
|
6
6
|
if File.directory?("config")
|
7
|
-
if !File.
|
7
|
+
if !File.exist?(PATH)
|
8
8
|
File.write(PATH, template(api_key))
|
9
9
|
puts "File #{PATH} has been created. Restart / deploy your app to start collecting data."
|
10
10
|
else
|
@@ -19,26 +19,34 @@ module RorVsWild
|
|
19
19
|
<<YAML
|
20
20
|
production:
|
21
21
|
api_key: #{api_key}
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
22
|
+
# ignore_requests: # Do not monitor the following actions
|
23
|
+
# - SecretController#index
|
24
|
+
# ignore_jobs: # Do not monitor the following jobs
|
25
|
+
# - SecretJob
|
26
|
+
# ignore_exceptions: # Do not record the following exceptions
|
27
|
+
# - ActionController::RoutingError # By default to ignore 404
|
28
|
+
# ignore_plugins:
|
29
|
+
# - ActionController
|
30
|
+
# - ActionMailer
|
31
|
+
# - ActionView
|
32
|
+
# - ActiveJob
|
33
|
+
# - ActiveRecord
|
34
|
+
# - DelayedJob
|
35
|
+
# - Elasticsearch
|
36
|
+
# - Mongo
|
37
|
+
# - NetHttp
|
38
|
+
# - Redis
|
39
|
+
# - Resque
|
40
|
+
# - Sidekiq
|
41
|
+
# logger: log/rorvswild.log # By default it uses Rails.logger or Logger.new(STDOUT)
|
42
|
+
# # Deployment tracking is working without any actions from your part if the Rails app
|
43
|
+
# # is inside a Git repositoriy, is deployed via Capistrano.
|
44
|
+
# # In the other cases, you can provide the following details.
|
45
|
+
# deployment:
|
46
|
+
# revision: <%= "Anything that will return the deployment version" %> # Mandatory
|
47
|
+
# description: <%= "Eventually if you have a description such as a Git message" %>
|
48
|
+
# author: <%= "Author's name of the deployment" %>
|
49
|
+
# email: <%= "emailOf@theAuthor.com" %>
|
42
50
|
YAML
|
43
51
|
end
|
44
52
|
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.6.
|
4
|
+
version: 1.6.1
|
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: 2023-
|
12
|
+
date: 2023-02-07 00:00:00.000000000 Z
|
13
13
|
dependencies: []
|
14
14
|
description: Performances and errors insights for rails developers.
|
15
15
|
email:
|