rails_performance 1.4.0.alpha1 → 1.4.0.alpha3
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 05d2e2b2c1b69d3c41d7208b746af12d1ae6e8ae2c305c35e066636f9fc6946f
|
4
|
+
data.tar.gz: 3b6611e09e42154d80151466badef9b98060e6215d959ffccc6f271023193c45
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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">
|
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(
|
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(
|
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
|