rails_performance 1.4.0.alpha1 → 1.4.0.alpha3

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: 05d2e2b2c1b69d3c41d7208b746af12d1ae6e8ae2c305c35e066636f9fc6946f
4
+ data.tar.gz: 3b6611e09e42154d80151466badef9b98060e6215d959ffccc6f271023193c45
5
5
  SHA512:
6
- metadata.gz: '0122738b6f1fde35c2bca00783e26e1c0f65b84896b4e22130e79dfffd2e59d211d7aec34f9b9b7718c239a713993e8d05656bc87294e253d7695462b9f477ea'
7
- data.tar.gz: 5170e8f7e24ce9a9904bf7d9163dbf34eca2063da745fb9824f808793a12e9940b618b5b64ebe8f2fe39e6e12bebcc98f560c9fdd3fd51fb6fc973f880417a8e
6
+ metadata.gz: 054226e9584b58d19ab43773da49cbf7d1d4ee7c2358808ed7f749d786efb8f95a10aa6cfa4976b2b6fadfa143828dcd98f5408b209d89dd3855fa4bd5e4352e
7
+ data.tar.gz: fc7e826a68e0ed7d17ab48bd391a97daa2e06a8b12aac47000dfc29c4217acd59118e0b5fe0ce65111dff5ce6b6b31838f98736855994b2a3b69cae9e6f2cef7
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|
@@ -49,7 +52,10 @@ module RailsPerformance
49
52
  RailsPerformance._resource_monitor.stop_monitoring
50
53
  RailsPerformance._resource_monitor = nil
51
54
  # start background monitoring
52
- RailsPerformance._resource_monitor = RailsPerformance::Extensions::ResourceMonitor.new("sidekiq", "background")
55
+ RailsPerformance._resource_monitor = RailsPerformance::Extensions::ResourceMonitor.new(
56
+ ENV["RAILS_PERFORMANCE_SERVER_CONTEXT"].presence || "sidekiq",
57
+ ENV["RAILS_PERFORMANCE_SERVER_ROLE"].presence || "background"
58
+ )
53
59
  end
54
60
  end
55
61
  end
@@ -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.alpha3"
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.alpha3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Igor Kasyanchuk