rails_performance 1.4.0.alpha1 → 1.4.0.alpha2

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: 524031a11cbbe218cd746b2469a34b05e0867fa33f2f87dc06377a9a6ee983da
4
- data.tar.gz: 69ea547a8574ed29550d28057d6d7369f8598509104fdcad002408be71533af6
3
+ metadata.gz: 18e73549ed108a15ec8ac15641e9d32f88fd983e45bc9b037dea9a3d3174d664
4
+ data.tar.gz: b46d599ee93ef032afba6808ec00d33022882ff0f1c490b78751e2b606251220
5
5
  SHA512:
6
- metadata.gz: '0122738b6f1fde35c2bca00783e26e1c0f65b84896b4e22130e79dfffd2e59d211d7aec34f9b9b7718c239a713993e8d05656bc87294e253d7695462b9f477ea'
7
- data.tar.gz: 5170e8f7e24ce9a9904bf7d9163dbf34eca2063da745fb9824f808793a12e9940b618b5b64ebe8f2fe39e6e12bebcc98f560c9fdd3fd51fb6fc973f880417a8e
6
+ metadata.gz: dab951067c8a7be7e2810cfb79b46c33712f909f03d21e9c0a5fbdded446c7f4fb5c9550fc1a44ead21b455c3f7dd558684e97446d55f4db2c772b2c26c85fb6
7
+ data.tar.gz: 14f55178c78f0e0f1b741e068a596a28060067e4503b9b2f4f8f779f256a7c8eb3f3aad6096ff0c50761691ad3e34c56b93c09841bbc847ad26eab1b57d2890c
data/README.md CHANGED
@@ -185,6 +185,31 @@ gem "sys-cpu"
185
185
  gem "get_process_mem"
186
186
  ```
187
187
 
188
+ Once you add these gems, it will track and show you the system resources on the dashboard.
189
+
190
+ If you have multiple servers running the same app, it will use store metrics per server. You can configure the the env variable ENV["RAILS_PERFORMANCE_SERVER_ID"] or using `hostname` command.
191
+
192
+ Basically using this code:
193
+
194
+ ```ruby
195
+ def server_id
196
+ @server_id ||= ENV["RAILS_PERFORMANCE_SERVER_ID"] || `hostname`.strip
197
+ end
198
+ ```
199
+
200
+ You can also specifify custom "context" and "role" for monitoring, by changing the env variables:
201
+
202
+ ```ruby
203
+ RailsPerformance::Extensions::ResourceMonitor.new(
204
+ ENV["RAILS_PERFORMANCE_SERVER_CONTEXT"].presence || "rails",
205
+ ENV["RAILS_PERFORMANCE_SERVER_ROLE"].presence || "web"
206
+ )
207
+ ```
208
+
209
+ More information here: `lib/rails_performance/engine.rb`.
210
+
211
+ PS: right now it can only distinguish between web app servers and the sidekiq servers.
212
+
188
213
  ### Custom events
189
214
 
190
215
  ```ruby
@@ -269,6 +294,7 @@ The idea of this gem grew from curiosity how many RPM my app receiving per day.
269
294
  - searchkiq
270
295
  - sinatra?
271
296
  - tests to check what is actually stored in redis db after request
297
+ - upgrade bulma
272
298
 
273
299
  ## Contributing
274
300
 
@@ -25,9 +25,9 @@
25
25
 
26
26
  <div class="card">
27
27
  <div class="card-content">
28
- <h2 class="subtitle">Disk</h2>
28
+ <h2 class="subtitle">Storage</h2>
29
29
  <div id="disk_report_<%= server_key.parameterize %>" class="chart"></div>
30
- <p class="content is-small">Available disk size</p>
30
+ <p class="content is-small">Available storage size (local disk size)</p>
31
31
  </div>
32
32
  </div>
33
33
 
@@ -16,7 +16,10 @@ module RailsPerformance
16
16
  next if $rails_performance_running_mode == :console # rubocop:disable Style/GlobalVars
17
17
 
18
18
  # start monitoring
19
- RailsPerformance._resource_monitor = RailsPerformance::Extensions::ResourceMonitor.new("rails", "web")
19
+ RailsPerformance._resource_monitor = RailsPerformance::Extensions::ResourceMonitor.new(
20
+ ENV["RAILS_PERFORMANCE_SERVER_CONTEXT"].presence || "rails",
21
+ ENV["RAILS_PERFORMANCE_SERVER_ROLE"].presence || "web"
22
+ )
20
23
  end
21
24
 
22
25
  initializer "rails_performance.middleware" do |app|
@@ -96,7 +96,7 @@ module RailsPerformance
96
96
  end
97
97
 
98
98
  def server_id
99
- @server_id ||= ENV["SERVER_ID"] || `hostname`.strip
99
+ @server_id ||= ENV["RAILS_PERFORMANCE_SERVER_ID"] || `hostname`.strip
100
100
  end
101
101
  end
102
102
  end
@@ -1,4 +1,4 @@
1
1
  module RailsPerformance
2
- VERSION = "1.4.0.alpha1"
2
+ VERSION = "1.4.0.alpha2"
3
3
  SCHEMA = "1.0.1"
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails_performance
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.0.alpha1
4
+ version: 1.4.0.alpha2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Igor Kasyanchuk