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/query_managers.py b/scheduler/query_managers.py
index 9cf0cdf..488490c 100644
--- a/scheduler/query_managers.py
+++ b/scheduler/query_managers.py
@@ -12,7 +12,7 @@
 
 import common
 
-from autotest_lib.client.common_lib.cros.graphite import stats
+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.server.cros.dynamic_suite import constants
@@ -20,7 +20,7 @@
 from autotest_lib.scheduler import scheduler_lib
 
 
-_job_timer = stats.Timer('scheduler.job_query_manager')
+_job_timer = autotest_stats.Timer('scheduler.job_query_manager')
 class AFEJobQueryManager(object):
     """Query manager for AFE Jobs."""
 
@@ -210,7 +210,7 @@
         return dict((keyval.job_id, int(keyval.value)) for keyval in query)
 
 
-_host_timer = stats.Timer('scheduler.host_query_manager')
+_host_timer = autotest_stats.Timer('scheduler.host_query_manager')
 class AFEHostQueryManager(object):
     """Query manager for AFE Hosts."""