OLD | NEW |
---|---|
1 # Copyright 2012 the V8 project authors. All rights reserved. | 1 # Copyright 2012 the V8 project authors. All rights reserved. |
2 # Redistribution and use in source and binary forms, with or without | 2 # Redistribution and use in source and binary forms, with or without |
3 # modification, are permitted provided that the following conditions are | 3 # modification, are permitted provided that the following conditions are |
4 # met: | 4 # met: |
5 # | 5 # |
6 # * Redistributions of source code must retain the above copyright | 6 # * Redistributions of source code must retain the above copyright |
7 # notice, this list of conditions and the following disclaimer. | 7 # notice, this list of conditions and the following disclaimer. |
8 # * Redistributions in binary form must reproduce the above | 8 # * Redistributions in binary form must reproduce the above |
9 # copyright notice, this list of conditions and the following | 9 # copyright notice, this list of conditions and the following |
10 # disclaimer in the documentation and/or other materials provided | 10 # disclaimer in the documentation and/or other materials provided |
(...skipping 15 matching lines...) Expand all Loading... | |
26 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 26 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
27 | 27 |
28 | 28 |
29 import os | 29 import os |
30 import socket | 30 import socket |
31 import subprocess | 31 import subprocess |
32 import threading | 32 import threading |
33 import time | 33 import time |
34 | 34 |
35 from . import distro | 35 from . import distro |
36 from . import perfdata | 36 from ..local import perfdata |
37 from ..local import execution | 37 from ..local import execution |
Jakob Kummerow
2014/05/14 17:41:42
nit: alpha-sort please
Michael Achenbach
2014/05/15 07:16:36
Was moving the file in the end... didn't see the o
| |
38 from ..objects import peer | 38 from ..objects import peer |
39 from ..objects import workpacket | 39 from ..objects import workpacket |
40 from ..server import compression | 40 from ..server import compression |
41 from ..server import constants | 41 from ..server import constants |
42 from ..server import local_handler | 42 from ..server import local_handler |
43 from ..server import signatures | 43 from ..server import signatures |
44 | 44 |
45 | 45 |
46 def GetPeers(): | 46 def GetPeers(): |
47 data = local_handler.LocalQuery([constants.REQUEST_PEERS]) | 47 data = local_handler.LocalQuery([constants.REQUEST_PEERS]) |
48 if not data: return [] | 48 if not data: return [] |
49 return [ peer.Peer.Unpack(p) for p in data ] | 49 return [ peer.Peer.Unpack(p) for p in data ] |
50 | 50 |
51 | 51 |
52 class NetworkedRunner(execution.Runner): | 52 class NetworkedRunner(execution.Runner): |
53 def __init__(self, suites, progress_indicator, context, peers, workspace): | 53 def __init__(self, suites, progress_indicator, context, peers, workspace): |
54 self.suites = suites | 54 self.suites = suites |
55 num_tests = 0 | 55 num_tests = 0 |
56 datapath = os.path.join("out", "testrunner_data") | 56 datapath = os.path.join("out", "testrunner_data") |
57 # TODO(machenbach): These fields should exist now in the superclass. | |
58 # But there is no super constructor call. Check if this is a problem. | |
Jakob Kummerow
2014/05/14 17:41:42
Shouldn't be a problem :-)
Unifying Runner and Net
Michael Achenbach
2014/05/15 07:16:36
This TODO is just a remainder for when I might do
| |
57 self.perf_data_manager = perfdata.PerfDataManager(datapath) | 59 self.perf_data_manager = perfdata.PerfDataManager(datapath) |
58 self.perfdata = self.perf_data_manager.GetStore(context.arch, context.mode) | 60 self.perfdata = self.perf_data_manager.GetStore(context.arch, context.mode) |
59 for s in suites: | 61 for s in suites: |
60 for t in s.tests: | 62 for t in s.tests: |
61 t.duration = self.perfdata.FetchPerfData(t) or 1.0 | 63 t.duration = self.perfdata.FetchPerfData(t) or 1.0 |
62 num_tests += len(s.tests) | 64 num_tests += len(s.tests) |
63 self._CommonInit(num_tests, progress_indicator, context) | 65 self._CommonInit(num_tests, progress_indicator, context) |
64 self.tests = [] # Only used if we need to fall back to local execution. | 66 self.tests = [] # Only used if we need to fall back to local execution. |
65 self.tests_lock = threading.Lock() | 67 self.tests_lock = threading.Lock() |
66 self.peers = peers | 68 self.peers = peers |
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
245 total_work += p.assigned_work | 247 total_work += p.assigned_work |
246 for p in self.peers: | 248 for p in self.peers: |
247 p.assigned_work /= total_work | 249 p.assigned_work /= total_work |
248 p.runtime /= total_runtime | 250 p.runtime /= total_runtime |
249 perf_correction = p.assigned_work / p.runtime | 251 perf_correction = p.assigned_work / p.runtime |
250 old_perf = p.relative_performance | 252 old_perf = p.relative_performance |
251 p.relative_performance = (old_perf + perf_correction) / 2.0 | 253 p.relative_performance = (old_perf + perf_correction) / 2.0 |
252 compression.Send([constants.UPDATE_PERF, p.address, | 254 compression.Send([constants.UPDATE_PERF, p.address, |
253 p.relative_performance], | 255 p.relative_performance], |
254 self.local_socket) | 256 self.local_socket) |
OLD | NEW |