Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(488)

Side by Side Diff: appengine/findit/crash/crash_pipeline.py

Issue 2514413003: [Predator] Monitor found_suspects, has_regression_range and found_components using ts_mon (Closed)
Patch Set: Update docs. Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 copy 5 import copy
6 import json 6 import json
7 import logging 7 import logging
8 8
9 from crash import monitoring
10
9 from common import appengine_util 11 from common import appengine_util
10 from common import pubsub_util 12 from common import pubsub_util
11 from common.http_client_appengine import HttpClientAppengine 13 from common.http_client_appengine import HttpClientAppengine
12 from common.pipeline_wrapper import BasePipeline 14 from common.pipeline_wrapper import BasePipeline
13 from common.pipeline_wrapper import pipeline 15 from common.pipeline_wrapper import pipeline
14 from crash import findit_for_chromecrash 16 from crash import findit_for_chromecrash
15 from crash import findit_for_clusterfuzz 17 from crash import findit_for_clusterfuzz
16 from crash.type_enums import CrashClient 18 from crash.type_enums import CrashClient
17 from lib import time_util 19 from lib import time_util
18 from lib.gitiles import gitiles_repository 20 from lib.gitiles import gitiles_repository
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 } 153 }
152 154
153 # Update model's status to say we're done, and save the results. 155 # Update model's status to say we're done, and save the results.
154 analysis.completed_time = time_util.GetUTCNow() 156 analysis.completed_time = time_util.GetUTCNow()
155 analysis.result = result 157 analysis.result = result
156 for tag_name, tag_value in tags.iteritems(): 158 for tag_name, tag_value in tags.iteritems():
157 # TODO(http://crbug.com/602702): make it possible to add arbitrary tags. 159 # TODO(http://crbug.com/602702): make it possible to add arbitrary tags.
158 # TODO(http://crbug.com/659346): we misplaced the coverage test; find it! 160 # TODO(http://crbug.com/659346): we misplaced the coverage test; find it!
159 if hasattr(analysis, tag_name): # pragma: no cover 161 if hasattr(analysis, tag_name): # pragma: no cover
160 setattr(analysis, tag_name, tag_value) 162 setattr(analysis, tag_name, tag_value)
163
164 if hasattr(monitoring, tag_name):
165 metric = getattr(monitoring, tag_name)
166 metric.increment({tag_name: tag_value,
167 'client_id': self.client_id})
168
161 analysis.status = analysis_status.COMPLETED 169 analysis.status = analysis_status.COMPLETED
162 analysis.put() 170 analysis.put()
163 171
164 172
165 class PublishResultPipeline(CrashBasePipeline): 173 class PublishResultPipeline(CrashBasePipeline):
166 def finalized(self): 174 def finalized(self):
167 if self.was_aborted: # pragma: no cover. 175 if self.was_aborted: # pragma: no cover.
168 logging.error('Failed to publish %s analysis result for %s', 176 logging.error('Failed to publish %s analysis result for %s',
169 repr(self._crash_identifiers), self.client_id) 177 repr(self._crash_identifiers), self.client_id)
170 178
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
215 N.B., due to the structure of AppEngine pipelines, this method must 223 N.B., due to the structure of AppEngine pipelines, this method must
216 accept the same arguments as are passed to ``__init__``; however, 224 accept the same arguments as are passed to ``__init__``; however,
217 because they were already passed to ``__init__`` there's no use in 225 because they were already passed to ``__init__`` there's no use in
218 recieving them here. Thus, we discard all the arguments to this method 226 recieving them here. Thus, we discard all the arguments to this method
219 (except for ``self``, naturally). 227 (except for ``self``, naturally).
220 """ 228 """
221 run_analysis = yield CrashAnalysisPipeline( 229 run_analysis = yield CrashAnalysisPipeline(
222 self._client_id, self._crash_identifiers) 230 self._client_id, self._crash_identifiers)
223 with pipeline.After(run_analysis): 231 with pipeline.After(run_analysis):
224 yield PublishResultPipeline(self._client_id, self._crash_identifiers) 232 yield PublishResultPipeline(self._client_id, self._crash_identifiers)
OLDNEW
« no previous file with comments | « no previous file | appengine/findit/crash/monitoring.py » ('j') | appengine/findit/crash/monitoring.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698