scout_rails 1.0.2.pre2 → 1.0.2.pre3
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.
- data/CHANGELOG.markdown +1 -0
- data/lib/scout_rails/agent.rb +2 -2
- data/lib/scout_rails/environment.rb +13 -0
- data/lib/scout_rails/version.rb +1 -1
- metadata +2 -2
data/CHANGELOG.markdown
CHANGED
data/lib/scout_rails/agent.rb
CHANGED
@@ -37,7 +37,7 @@ module ScoutRails
|
|
37
37
|
@layaway = ScoutRails::Layaway.new
|
38
38
|
@config = ScoutRails::Config.new(options[:config_path])
|
39
39
|
@metric_lookup = Hash.new
|
40
|
-
@process_cpu=ScoutRails::Instruments::Process::ProcessCpu.new(
|
40
|
+
@process_cpu=ScoutRails::Instruments::Process::ProcessCpu.new(environment.processors)
|
41
41
|
@process_memory=ScoutRails::Instruments::Process::ProcessMemory.new
|
42
42
|
end
|
43
43
|
|
@@ -191,7 +191,7 @@ module ScoutRails
|
|
191
191
|
def run_samplers
|
192
192
|
begin
|
193
193
|
cpu_util=@process_cpu.run # returns a hash
|
194
|
-
logger.debug "Process CPU: #{cpu_util.inspect}"
|
194
|
+
logger.debug "Process CPU: #{cpu_util.inspect} [#{environment.processors} CPU(s)]"
|
195
195
|
store.track!("CPU/Utilization",cpu_util) if cpu_util
|
196
196
|
rescue => e
|
197
197
|
logger.info "Error reading ProcessCpu"
|
@@ -23,6 +23,19 @@ module ScoutRails
|
|
23
23
|
end
|
24
24
|
end
|
25
25
|
|
26
|
+
def processors
|
27
|
+
return @processors if @processors
|
28
|
+
unless @processors
|
29
|
+
if `cat /proc/cpuinfo | grep 'model name' | wc -l` =~ /(\d+)/
|
30
|
+
@processors = $1.to_i
|
31
|
+
end
|
32
|
+
if @processors < 1
|
33
|
+
@processors = 1
|
34
|
+
end
|
35
|
+
end
|
36
|
+
@processors
|
37
|
+
end
|
38
|
+
|
26
39
|
def root
|
27
40
|
if framework == :rails
|
28
41
|
RAILS_ROOT.to_s
|
data/lib/scout_rails/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: scout_rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.2.
|
4
|
+
version: 1.0.2.pre3
|
5
5
|
prerelease: 6
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2012-07-
|
13
|
+
date: 2012-07-30 00:00:00.000000000 Z
|
14
14
|
dependencies: []
|
15
15
|
description: Monitors a Ruby on Rails application and reports detailed metrics on
|
16
16
|
performance to Scout, a hosted monitoring service.
|