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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 32aa3a39198facc9dc8a8a7d841922e8bdbfd539
4
- data.tar.gz: 64ece18593944af62e3c625eff499b6c885648e9
3
+ metadata.gz: 5d2f558aa24ed692b92657bca03260f2b16c4dcb
4
+ data.tar.gz: 951c07c6590528a64ec2b689f2f6a7e7af6cdc9b
5
5
  SHA512:
6
- metadata.gz: 30e746e4f8a0e04d2b799b6d95769653daa7a8e80abcab0220def11d103cc8cf6985f61ee7de3ef4af87ce276959ff096bc43015e5f03eda6571d89946a8e4a3
7
- data.tar.gz: 410394aef801e12c85a6ac220dffe4c51b183a029c93ed7281281a9ae2262b3cdd373e74200be35cbf9eb8206bd76a17763e0ac12a339dfff037ee7d12c80f90
6
+ metadata.gz: c72ce0bac76d767f0d92a11c3687e14af5a1ff9829d9daf5c85c10ac8d0fd8e339648c0e358ac532fcca043165e476733fc4b3ebe40c07251e936e23b4153624
7
+ data.tar.gz: 23cd4a512529aca82144f698f03bf1ce7739a66e293ca0e5fe6d1bffccf6ff659ee91897600d92f6e905a54cea9ccc11be1779d47cdfdd91b20727ef779f8412
@@ -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 defined?(Rails)
10
- last_executed_controller = controller&.controller_name&.presence || controller&['controller_name']&.presence || 'NoController'
11
- last_executed_action = controller&.action_name&.presence || controller&['action_name']&.presence || 'NoAction'
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 = controller&.controller_name || 'NoController'
14
- last_executed_action = controller&.action_name || 'NoAction'
13
+ last_executed_controller = 'NoController'
14
+ last_executed_action = 'NoAction'
15
15
  end
16
16
 
17
17
  data = {
@@ -1,3 +1,3 @@
1
1
  module ResourceMonitor
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: resource_monitor
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lazaro Herrera