| OLD | NEW |
| 1 # Copyright 2016 The Chromium Authors. All rights reserved. | 1 # Copyright 2016 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 import json | 5 import json |
| 6 import uuid | 6 import uuid |
| 7 | 7 |
| 8 from googleapiclient import errors | 8 from googleapiclient import errors |
| 9 | 9 |
| 10 from common.loading_trace_database import LoadingTraceDatabase |
| 10 import common.google_error_helper as google_error_helper | 11 import common.google_error_helper as google_error_helper |
| 11 from failure_database import FailureDatabase | 12 from failure_database import FailureDatabase |
| 12 from loading_trace import LoadingTrace | 13 from loading_trace import LoadingTrace |
| 13 from loading_trace_database import LoadingTraceDatabase | |
| 14 from report import LoadingReport | 14 from report import LoadingReport |
| 15 | 15 |
| 16 | 16 |
| 17 def LoadRemoteTrace(storage_accessor, remote_trace_path, logger): | 17 def LoadRemoteTrace(storage_accessor, remote_trace_path, logger): |
| 18 """Loads and returns the LoadingTrace located at the remote trace path. | 18 """Loads and returns the LoadingTrace located at the remote trace path. |
| 19 | 19 |
| 20 Args: | 20 Args: |
| 21 storage_accessor: (GoogleStorageAccessor) Used to download the trace from | 21 storage_accessor: (GoogleStorageAccessor) Used to download the trace from |
| 22 CloudStorage. | 22 CloudStorage. |
| 23 remote_trace_path: (str) Path to the trace file. | 23 remote_trace_path: (str) Path to the trace file. |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 self._failure_database.AddFailure('report_generation_failed', path) | 131 self._failure_database.AddFailure('report_generation_failed', path) |
| 132 continue | 132 continue |
| 133 rows.append(report) | 133 rows.append(report) |
| 134 | 134 |
| 135 if rows: | 135 if rows: |
| 136 tag = clovis_task.BackendParams()['tag'] | 136 tag = clovis_task.BackendParams()['tag'] |
| 137 # BigQuery table names can contain only alpha numeric characters and | 137 # BigQuery table names can contain only alpha numeric characters and |
| 138 # underscores. | 138 # underscores. |
| 139 table_id = ''.join(c for c in tag if c.isalnum() or c == '_') | 139 table_id = ''.join(c for c in tag if c.isalnum() or c == '_') |
| 140 self._StreamRowsToBigQuery(rows, table_id) | 140 self._StreamRowsToBigQuery(rows, table_id) |
| OLD | NEW |