autotest: remove a few old autotest_stats callers
There are still a few more left behind after this (which appear at quick
examination to be related to rpc instrumentation). I've left them in
place for now, while deleting ones that I'm very confident are not used.
BUG=chromium:667171
TEST=None
Change-Id: I6a38fc7946fe985bdbfd4f8b9de110abc38d945d
Reviewed-on: https://chromium-review.googlesource.com/452641
Commit-Ready: Aviv Keshet <akeshet@chromium.org>
Tested-by: Aviv Keshet <akeshet@chromium.org>
Reviewed-by: Aviv Keshet <akeshet@chromium.org>
diff --git a/scheduler/pidfile_monitor.py b/scheduler/pidfile_monitor.py
index 7cccc44..1b61e1c 100644
--- a/scheduler/pidfile_monitor.py
+++ b/scheduler/pidfile_monitor.py
@@ -12,7 +12,6 @@
from autotest_lib.client.common_lib import utils
from autotest_lib.client.common_lib import global_config
-from autotest_lib.client.common_lib.cros.graphite import autotest_stats
from autotest_lib.scheduler import drone_manager
from autotest_lib.scheduler import scheduler_config
@@ -114,12 +113,6 @@
def _handle_pidfile_error(self, error, message=''):
- metadata = {'_type': 'scheduler_error',
- 'error': 'autoserv died without writing exit code',
- 'process': str(self._state.process),
- 'pidfile_id': str(self.pidfile_id)}
- autotest_stats.Counter('autoserv_died_without_writing_exit_code',
- metadata=metadata).increment()
self.on_lost_process(self._state.process)
diff --git a/site_utils/collect_suite_time_stats.py b/site_utils/collect_suite_time_stats.py
index e786d9d..bc6c5f8 100755
--- a/site_utils/collect_suite_time_stats.py
+++ b/site_utils/collect_suite_time_stats.py
@@ -66,7 +66,6 @@
from autotest_lib.client.common_lib import host_queue_entry_states
from autotest_lib.client.common_lib import time_utils
from autotest_lib.client.common_lib.cros.graphite import autotest_es
-from autotest_lib.client.common_lib.cros.graphite import autotest_stats
from autotest_lib.frontend import setup_django_environment
from autotest_lib.frontend.afe import models
from autotest_lib.frontend.tko import models as tko_models
@@ -396,13 +395,6 @@
suite_name, suite_job_id, suite_runtime)),
print_suite_stats(suite_stats)
- if _options.cron_mode:
- key = utils.get_data_key(
- 'suite_time_stats', suite_name, hit['build'],
- hit['board'])
- autotest_stats.Timer(key).send('suite_runtime', suite_runtime)
- for stat, val in suite_stats.iteritems():
- autotest_stats.Timer(key).send(stat, val)
except Exception as e:
print('ERROR: Exception is raised while processing suite %s' % (
suite_job_id))
diff --git a/site_utils/run_suite.py b/site_utils/run_suite.py
index 3b8b625..0b429a9 100755
--- a/site_utils/run_suite.py
+++ b/site_utils/run_suite.py
@@ -59,7 +59,6 @@
from autotest_lib.client.common_lib import global_config, enum
from autotest_lib.client.common_lib import priorities
from autotest_lib.client.common_lib import time_utils
-from autotest_lib.client.common_lib.cros.graphite import autotest_stats
from autotest_lib.client.common_lib.cros import retry
from autotest_lib.frontend.afe.json_rpc import proxy
from autotest_lib.server import utils
@@ -649,57 +648,6 @@
self.tests_end_time))
- def SendResultsToStatsd(self, suite, build, board):
- """
- Sends data to statsd.
-
- 1. Makes a data_key of the form: run_suite.$board.$branch.$suite
- eg: stats/gauges/<hostname>/run_suite/<board>/<branch>/<suite>/
- 2. Computes timings for several start and end event pairs.
- 3. Sends all timing values to statsd.
-
- @param suite: scheduled suite that we want to record the results of.
- @param build: the build that this suite ran on.
- eg: 'lumpy-release/R26-3570.0.0'
- @param board: the board that this suite ran on.
- """
- if sys.version_info < (2, 7):
- logging.error('Sending run_suite perf data to statsd requires'
- 'python 2.7 or greater.')
- return
-
- # Constructs the key used for logging statsd timing data.
- data_key = utils.get_data_key('run_suite', suite, build, board)
-
- # Since we don't want to try subtracting corrupted datetime values
- # we catch TypeErrors in time_utils.time_string_to_datetime and insert
- # None instead. This means that even if, say,
- # keyvals.get(constants.ARTIFACT_FINISHED_TIME) returns a corrupt
- # value the member artifact_end_time is set to None.
- if self.download_start_time:
- if self.payload_end_time:
- autotest_stats.Timer(data_key).send('payload_download_time',
- (self.payload_end_time -
- self.download_start_time).total_seconds())
-
- if self.artifact_end_time:
- autotest_stats.Timer(data_key).send('artifact_download_time',
- (self.artifact_end_time -
- self.download_start_time).total_seconds())
-
- if self.tests_end_time:
- if self.suite_start_time:
- autotest_stats.Timer(data_key).send('suite_run_time',
- (self.tests_end_time -
- self.suite_start_time).total_seconds())
-
- if self.tests_start_time:
- autotest_stats.Timer(data_key).send('tests_run_time',
- (self.tests_end_time -
- self.tests_start_time).total_seconds())
-
-
-
def instance_for_pool(pool_name):
"""
Return the hostname of the server that should be used to service a suite
@@ -1529,10 +1477,6 @@
def gather_timing_stats(self):
"""Collect timing related statistics."""
- # Send timings to statsd.
- self.timings.SendResultsToStatsd(
- self._original_suite_name, self._build, self._board)
-
# Record suite runtime in metadata db.
# Some failure modes can leave times unassigned, report sentinel value
# in that case.
@@ -1877,8 +1821,6 @@
logging.info('Will return from run_suite with status: %s',
RETURN_CODES.get_string(code))
- autotest_stats.Counter('run_suite.%s' %
- RETURN_CODES.get_string(code)).increment()
return code