| OLD | NEW |
| 1 # Copyright 2015 The Chromium Authors. All rights reserved. | 1 # Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 """Classes representing the monitoring interface for tasks or devices.""" | 5 """Classes representing the monitoring interface for tasks or devices.""" |
| 6 | 6 |
| 7 | 7 |
| 8 import base64 | 8 import base64 |
| 9 import json | 9 import json |
| 10 import logging | 10 import logging |
| 11 | 11 |
| 12 from apiclient import discovery | 12 from googleapiclient import discovery |
| 13 from oauth2client import gce | 13 from oauth2client import gce |
| 14 from oauth2client.client import GoogleCredentials | 14 from oauth2client.client import GoogleCredentials |
| 15 from oauth2client.file import Storage | 15 from oauth2client.file import Storage |
| 16 import httplib2 | 16 import httplib2 |
| 17 | 17 |
| 18 from infra_libs import httplib2_utils | 18 from infra_libs import httplib2_utils |
| 19 from infra_libs.ts_mon.common import http_metrics | 19 from infra_libs.ts_mon.common import http_metrics |
| 20 from infra_libs.ts_mon.protos import metrics_pb2 | 20 from infra_libs.ts_mon.protos import metrics_pb2 |
| 21 | 21 |
| 22 | 22 |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 163 logging.info('Flushing monitoring metrics:\n%s', text) | 163 logging.info('Flushing monitoring metrics:\n%s', text) |
| 164 if self._fh is not None: | 164 if self._fh is not None: |
| 165 self._fh.write(text + '\n\n') | 165 self._fh.write(text + '\n\n') |
| 166 self._fh.flush() | 166 self._fh.flush() |
| 167 | 167 |
| 168 | 168 |
| 169 class NullMonitor(Monitor): | 169 class NullMonitor(Monitor): |
| 170 """Class that doesn't send metrics anywhere.""" | 170 """Class that doesn't send metrics anywhere.""" |
| 171 def send(self, metric_pb): | 171 def send(self, metric_pb): |
| 172 pass | 172 pass |
| OLD | NEW |