autotest: Drop old feature to time individual tests.
This is an old experimental feature that we aren't actively using.
By removing this feature, we remove an unnecessary stat, and also reduce
a call from autoserv to AFE.
The feature was originally introduced for crbug.com/237811
BUG=chromium:667171
TEST=Run job on moblab.
Change-Id: Ieefffae38469327b1df664b3eec8f17f702591b1
Reviewed-on: https://chromium-review.googlesource.com/414307
Commit-Ready: Prathmesh Prabhu <pprabhu@chromium.org>
Tested-by: Prathmesh Prabhu <pprabhu@chromium.org>
Reviewed-by: Prathmesh Prabhu <pprabhu@chromium.org>
Reviewed-by: Aviv Keshet <akeshet@chromium.org>
diff --git a/server/autoserv b/server/autoserv
index 758195b..f347123 100755
--- a/server/autoserv
+++ b/server/autoserv
@@ -71,7 +71,6 @@
from autotest_lib.site_utils import lxc
from autotest_lib.site_utils import lxc_utils
from autotest_lib.client.common_lib import pidfile, logging_manager
-from autotest_lib.client.common_lib.cros.graphite import autotest_stats
# Control segment to stage server-side package.
@@ -621,14 +620,6 @@
def main():
start_time = datetime.datetime.now()
- # White list of tests with run time measurement enabled.
- measure_run_time_tests_names = _CONFIG.get_config_value(
- 'AUTOSERV', 'measure_run_time_tests', type=str)
- if measure_run_time_tests_names:
- measure_run_time_tests = [t.strip() for t in
- measure_run_time_tests_names.split(',')]
- else:
- measure_run_time_tests = []
# grab the parser
parser = autoserv_parser.autoserv_parser
parser.parse_args()
@@ -726,11 +717,9 @@
autotest.BaseAutotest.set_install_in_tmpdir(
parser.options.install_in_tmpdir)
- timer = None
try:
# Take the first argument as control file name, get the test name from
- # the control file. If the test name exists in the list of tests with
- # run time measurement enabled, start a timer to begin measurement.
+ # the control file.
if (len(parser.args) > 0 and parser.args[0] != '' and
parser.options.machines):
try:
@@ -739,18 +728,6 @@
except control_data.ControlVariableException:
logging.debug('Failed to retrieve test name from control file.')
test_name = None
- if test_name in measure_run_time_tests:
- machines = parser.options.machines.replace(',', ' '
- ).strip().split()
- try:
- afe = frontend.AFE()
- board = server_utils.get_board_from_afe(machines[0], afe)
- timer = autotest_stats.Timer('autoserv_run_time.%s.%s' %
- (board, test_name))
- timer.start()
- except (urllib2.HTTPError, urllib2.URLError):
- # Ignore error if RPC failed to get board
- pass
except control_data.ControlVariableException as e:
logging.error(str(e))
exit_code = 0
@@ -806,8 +783,6 @@
finally:
if pid_file_manager:
pid_file_manager.close_file(exit_code)
- if timer:
- timer.stop()
# Record the autoserv duration time. Must be called
# just before the system exits to ensure accuracy.
duration_secs = (datetime.datetime.now() - start_time).total_seconds()