tem_mr_search 0.3.3 → 0.3.4

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG CHANGED
@@ -1,3 +1,5 @@
1
+ v0.3.4. More detailed per-TEM timings.
2
+
1
3
  v0.3.3. Map-Reduce scheduler tweak.
2
4
 
3
5
  v0.3.2. Map-Reduce timing statistics available in the results.
@@ -47,9 +47,9 @@ class MapReduceExecutor
47
47
  @outputs = {}
48
48
 
49
49
  # Protected by @lock
50
- @timings = { :tems => Array.new(@tems.length, 0.0),
51
- :tasks => { :map => 0.0, :reduce => 0.0, :finalize => 0.0,
52
- :migrate => 0.0, :tem_ids => 0.0 } }
50
+ tasks = { :map => 0.0, :reduce => 0.0, :finalize => 0.0,
51
+ :migrate => 0.0, :tem_ids => 0.0 }
52
+ @timings = { :tems => Array.new(@tems.length) { tasks.dup } }
53
53
 
54
54
  # Thread-safe.
55
55
  @thread_queues = tems.map { |tem| Queue.new }
@@ -92,8 +92,7 @@ class MapReduceExecutor
92
92
  time_delta = Time.now - t0
93
93
  @lock.synchronize do
94
94
  @tem_certs[index] = ecert
95
- @timings[:tasks][:tem_ids] += time_delta
96
- @timings[:tems][index] += time_delta
95
+ @timings[:tems][index][:tem_ids] += time_delta
97
96
  end
98
97
  end
99
98
  end
@@ -128,8 +127,7 @@ class MapReduceExecutor
128
127
 
129
128
  @lock.synchronize do
130
129
  @tem_parts[action[:secpack]][action[:to]] = out_part
131
- @timings[:tems][tem_index] += time_delta
132
- @timings[:tasks][:migrate] += time_delta
130
+ @timings[:tems][tem_index][:migrate] += time_delta
133
131
  end
134
132
 
135
133
  when :map
@@ -145,8 +143,7 @@ class MapReduceExecutor
145
143
 
146
144
  @lock.synchronize do
147
145
  @outputs[action[:output_id]] = output
148
- @timings[:tems][tem_index] += time_delta
149
- @timings[:tasks][:map] += time_delta
146
+ @timings[:tems][tem_index][:map] += time_delta
150
147
  end
151
148
 
152
149
  when :reduce
@@ -163,8 +160,7 @@ class MapReduceExecutor
163
160
 
164
161
  @lock.synchronize do
165
162
  @outputs[action[:output_id]] = output
166
- @timings[:tems][tem_index] += time_delta
167
- @timings[:tasks][:reduce] += time_delta
163
+ @timings[:tems][tem_index][:reduce] += time_delta
168
164
  end
169
165
 
170
166
  when :finalize
@@ -180,8 +176,7 @@ class MapReduceExecutor
180
176
 
181
177
  @lock.synchronize do
182
178
  @outputs[action[:final_id]] = final_output
183
- @timings[:tems][tem_index] += time_delta
184
- @timings[:tasks][:finalize] += time_delta
179
+ @timings[:tems][tem_index][:finalize] += time_delta
185
180
  end
186
181
  end
187
182
  end
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{tem_mr_search}
5
- s.version = "0.3.3"
5
+ s.version = "0.3.4"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Victor Costan"]
@@ -34,12 +34,13 @@ class MapReduceExecutorTest < MrTestCase
34
34
  'Incorrect Map-Reduce result (score)'
35
35
 
36
36
  assert data[:timings], 'No timings returned'
37
- assert data[:timings][:tasks], 'No tasks data in the timings'
38
- [:tem_ids, :migrate, :map, :reduce, :finalize].each do |task|
39
- assert data[:timings][:tasks][task], "No data on #{task} in the timings"
37
+ assert_equal tems.length, data[:timings][:tems].length,
38
+ 'No TEM data in the timings'
39
+ data[:timings][:tems].each do |tem_data|
40
+ [:tem_ids, :migrate, :map, :reduce, :finalize].each do |task|
41
+ assert tem_data[task], "No data on #{task} in the per-TEM timings"
42
+ end
40
43
  end
41
- assert_operator data[:timings][:tems], :kind_of?, Array,
42
- 'No per-TEM data in the timings'
43
44
  assert data[:timings][:total], 'No total time in the timings'
44
45
 
45
46
  # Dump timing stats to show scheduler performance.
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tem_mr_search
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.3
4
+ version: 0.3.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Victor Costan