server_metrics 0.0.8.3 → 0.0.8.4

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.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## 0.0.8.4
2
+
3
+ * normalize load (last minute, etc) by number of CPUs. This keeps the metrics in sync with Scout's server load plugin.
4
+
1
5
  ## 0.0.8.3
2
6
 
3
7
  * fall back to assumption of 100 jiffies/sec if /proc/timer_list isn't available
@@ -1,4 +1,5 @@
1
1
  require "time"
2
+ require 'server_metrics/system_info'
2
3
 
3
4
  class ServerMetrics::Cpu < ServerMetrics::Collector
4
5
 
@@ -25,9 +26,11 @@ class ServerMetrics::Cpu < ServerMetrics::Collector
25
26
  uptime_output = `uptime`
26
27
  matches = uptime_output.match(/load averages?: ([\d.]+),? ([\d.]+),? ([\d.]+)\Z/)
27
28
 
28
- report(:last_minute => matches[1].to_f,
29
- :last_five_minutes => matches[2].to_f,
30
- :last_fifteen_minutes => matches[3].to_f)
29
+ number_of_processors = ServerMetrics::SystemInfo.num_processors
30
+
31
+ report(:last_minute => matches[1].to_f / number_of_processors,
32
+ :last_five_minutes => matches[2].to_f / number_of_processors,
33
+ :last_fifteen_minutes => matches[3].to_f / number_of_processors)
31
34
  end
32
35
 
33
36
  # Helper class
@@ -1,3 +1,3 @@
1
1
  module ServerMetrics
2
- VERSION = "0.0.8.3"
2
+ VERSION = "0.0.8.4"
3
3
  end
@@ -32,7 +32,6 @@ class TestWithFixtures < Test::Unit::TestCase
32
32
  assert c.data[:idle]
33
33
  end
34
34
 
35
-
36
35
  # First run we get size info
37
36
  def test_disk
38
37
  ServerMetrics::Disk.any_instance.stubs("linux?").returns(true)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: server_metrics
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.8.3
4
+ version: 0.0.8.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-12-04 00:00:00.000000000 Z
12
+ date: 2013-12-11 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: sys-proctable
@@ -172,7 +172,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
172
172
  version: '0'
173
173
  segments:
174
174
  - 0
175
- hash: 3865381402127672943
175
+ hash: 3571060902029865156
176
176
  required_rubygems_version: !ruby/object:Gem::Requirement
177
177
  none: false
178
178
  requirements:
@@ -181,7 +181,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
181
181
  version: '0'
182
182
  segments:
183
183
  - 0
184
- hash: 3865381402127672943
184
+ hash: 3571060902029865156
185
185
  requirements: []
186
186
  rubyforge_project:
187
187
  rubygems_version: 1.8.25