resource_monitor 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/resource_monitor.rb +5 -5
- data/lib/resource_monitor/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5d2f558aa24ed692b92657bca03260f2b16c4dcb
|
4
|
+
data.tar.gz: 951c07c6590528a64ec2b689f2f6a7e7af6cdc9b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c72ce0bac76d767f0d92a11c3687e14af5a1ff9829d9daf5c85c10ac8d0fd8e339648c0e358ac532fcca043165e476733fc4b3ebe40c07251e936e23b4153624
|
7
|
+
data.tar.gz: 23cd4a512529aca82144f698f03bf1ce7739a66e293ca0e5fe6d1bffccf6ff659ee91897600d92f6e905a54cea9ccc11be1779d47cdfdd91b20727ef779f8412
|
data/lib/resource_monitor.rb
CHANGED
@@ -6,12 +6,12 @@ module ResourceMonitor
|
|
6
6
|
# Recover the process id and memory usage in KB (http://stackoverflow.com/questions/7220896/get-current-ruby-process-memory-usage)
|
7
7
|
pid, size, cpu_per, mem_per = `ps ax -o pid,rss,%cpu,%mem | grep -E "^[[:space:]]*#{$$}"`.strip.split.map(&:to_i)
|
8
8
|
|
9
|
-
if
|
10
|
-
last_executed_controller = controller
|
11
|
-
last_executed_action = controller
|
9
|
+
if controller
|
10
|
+
last_executed_controller = controller.controller_name || 'NoController'
|
11
|
+
last_executed_action = controller.action_name || 'NoAction'
|
12
12
|
else
|
13
|
-
last_executed_controller =
|
14
|
-
last_executed_action =
|
13
|
+
last_executed_controller = 'NoController'
|
14
|
+
last_executed_action = 'NoAction'
|
15
15
|
end
|
16
16
|
|
17
17
|
data = {
|