delete chromiumos-build-stats code and callers

CQ-DEPEND=CL:450846
BUG=chromium:698105
TEST=None
Change-Id: Ib0d2c10b35873eb768bd98f8946380ea7939012a
Reviewed-on: https://chromium-review.googlesource.com/449018
Commit-Ready: Aviv Keshet <akeshet@chromium.org>
Tested-by: Aviv Keshet <akeshet@chromium.org>
Reviewed-by: Aviv Keshet <akeshet@chromium.org>
Reviewed-by: David James <davidjames@chromium.org>
diff --git a/scripts/cros.py b/scripts/cros.py
index 5ecb413..c2838f3 100644
--- a/scripts/cros.py
+++ b/scripts/cros.py
@@ -15,12 +15,9 @@
 
 from __future__ import print_function
 
-import sys
-
 from chromite.cli import command
 from chromite.lib import commandline
 from chromite.lib import cros_logging as logging
-from chromite.lib import stats
 
 
 def GetOptions(my_commands):
@@ -64,31 +61,22 @@
 
     namespace = parser.parse_args(argv)
     subcommand = namespace.command_class(namespace)
-    with stats.UploadContext() as queue:
-      if subcommand.upload_stats:
-        cmd_base = subcommand.options.command_class.command_name
-        cmd_stats = stats.Stats.SafeInit(cmd_line=sys.argv, cmd_base=cmd_base)
-        if cmd_stats:
-          queue.put([cmd_stats, stats.StatsUploader.URL,
-                     subcommand.upload_stats_timeout])
-      # TODO: to make command completion faster, send an interrupt signal to the
-      # stats uploader task after the subcommand completes.
-      try:
-        code = _RunSubCommand(subcommand)
-      except (commandline.ChrootRequiredError, commandline.ExecRequiredError):
-        # The higher levels want these passed back, so oblige.
+    try:
+      code = _RunSubCommand(subcommand)
+    except (commandline.ChrootRequiredError, commandline.ExecRequiredError):
+      # The higher levels want these passed back, so oblige.
+      raise
+    except Exception as e:
+      code = 1
+      logging.error('cros %s failed before completing.',
+                    subcommand.command_name)
+      if namespace.debug:
         raise
-      except Exception as e:
-        code = 1
-        logging.error('cros %s failed before completing.',
-                      subcommand.command_name)
-        if namespace.debug:
-          raise
-        else:
-          logging.error(e)
+      else:
+        logging.error(e)
 
-      if code is not None:
-        return code
+    if code is not None:
+      return code
 
     return 0
   except KeyboardInterrupt: