graphite: Separate out configuration from the statsd classes.

The new version of the statsd classes should be created using an instance of
the new Statsd class which sets up some defaults without having to specify
them over and over. This makes it essentially compatible with the existing
usage in autotest, but will allow chromite to configure things differently and
avoid having side effects from importing the module or global state.

BUG=chromium:446291
TEST=Ran unit tests, ran stats_es_functionaltest.py, ran the
stats_mock_unittest, ran a butterfly-paladin tryjob with --hwtest, testing by
fdeng.
DEPLOY=apache,scheduler,host-scheduler

Change-Id: I1071813db197c0e5e035b4d8db615030386f1c1c
Reviewed-on: https://chromium-review.googlesource.com/246428
Reviewed-by: Fang Deng <fdeng@chromium.org>
Reviewed-by: Dan Shi <dshi@chromium.org>
Commit-Queue: Gabe Black <gabeblack@chromium.org>
Tested-by: Gabe Black <gabeblack@chromium.org>
diff --git a/scheduler/monitor_db_cleanup.py b/scheduler/monitor_db_cleanup.py
index 3114cf4..8136933 100644
--- a/scheduler/monitor_db_cleanup.py
+++ b/scheduler/monitor_db_cleanup.py
@@ -8,7 +8,7 @@
 from autotest_lib.frontend.afe import models
 from autotest_lib.scheduler import email_manager, scheduler_config
 from autotest_lib.client.common_lib import host_protections
-from autotest_lib.client.common_lib.cros.graphite import stats
+from autotest_lib.client.common_lib.cros.graphite import autotest_stats
 
 class PeriodicCleanup(object):
 
@@ -43,7 +43,7 @@
     """User cleanup that is controlled by the global config variable
        clean_interval_minutes in the SCHEDULER section.
     """
-    timer = stats.Timer('monitor_db_cleanup.user_cleanup')
+    timer = autotest_stats.Timer('monitor_db_cleanup.user_cleanup')
 
 
     def __init__(self, db, clean_interval_minutes):
@@ -219,7 +219,7 @@
     """Cleanup that runs at the startup of monitor_db and every subsequent
        twenty four hours.
     """
-    timer = stats.Timer('monitor_db_cleanup.twentyfourhour_cleanup')
+    timer = autotest_stats.Timer('monitor_db_cleanup.twentyfourhour_cleanup')
 
 
     def __init__(self, db, run_at_initialize=True):