jstorimer-deep-test 1.2.0 → 1.3.0
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/VERSION +1 -1
- data/jstorimer-deep-test.gemspec +1 -1
- data/lib/deep_test/options.rb +14 -1
- metadata +1 -1
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.
|
1
|
+
1.3.0
|
data/jstorimer-deep-test.gemspec
CHANGED
data/lib/deep_test/options.rb
CHANGED
@@ -17,7 +17,7 @@ module DeepTest
|
|
17
17
|
attr_accessor *VALID_OPTIONS.map {|o| o.name}
|
18
18
|
|
19
19
|
def number_of_agents
|
20
|
-
|
20
|
+
cpu_count unless @number_of_agents
|
21
21
|
@number_of_agents
|
22
22
|
end
|
23
23
|
|
@@ -101,6 +101,19 @@ module DeepTest
|
|
101
101
|
def server
|
102
102
|
Server.remote_reference(origin_hostname, server_port)
|
103
103
|
end
|
104
|
+
|
105
|
+
def cpu_count
|
106
|
+
case RUBY_PLATFORM
|
107
|
+
when /darwin/
|
108
|
+
output = `sysctl -n hw.ncpu`
|
109
|
+
output.strip.to_i
|
110
|
+
when /linux/
|
111
|
+
File.readlines("/proc/cpuinfo").inject(0) do |count, line|
|
112
|
+
next count + 1 if line =~ /processor\s*:\s*\d+/
|
113
|
+
count
|
114
|
+
end
|
115
|
+
end
|
116
|
+
end
|
104
117
|
|
105
118
|
protected
|
106
119
|
|