rails_performance 1.4.0.alpha1 → 1.4.0.alpha2
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: 18e73549ed108a15ec8ac15641e9d32f88fd983e45bc9b037dea9a3d3174d664
|
4
|
+
data.tar.gz: b46d599ee93ef032afba6808ec00d33022882ff0f1c490b78751e2b606251220
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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">
|
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|
|