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

Unified Diff: appengine/chromium_try_flakes/issue_tracker/issue_tracker_api.py

Issue 2186673003: Remove logging and metrics from builder alerts code (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@master
Patch Set: Also remove in chromium_try_flakes Created 4 years, 5 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | infra/services/builder_alerts/__main__.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: appengine/chromium_try_flakes/issue_tracker/issue_tracker_api.py
diff --git a/appengine/chromium_try_flakes/issue_tracker/issue_tracker_api.py b/appengine/chromium_try_flakes/issue_tracker/issue_tracker_api.py
index 9de66446208dca49a0d64ae0c4b677fffee79117..79f339aa5eb3b55429e48e0b2d90819bc2cf7d48 100644
--- a/appengine/chromium_try_flakes/issue_tracker/issue_tracker_api.py
+++ b/appengine/chromium_try_flakes/issue_tracker/issue_tracker_api.py
@@ -10,8 +10,6 @@ from issue_tracker.issue import Issue
from issue_tracker.comment import Comment
from oauth2client.appengine import AppAssertionCredentials
-import gae_ts_mon
-
# TODO(akuegel): Do we want to use a different timeout? Do we want to use a
# cache? See documentation here:
@@ -53,10 +51,6 @@ def _buildClient(api_name, api_version, http,
class IssueTrackerAPI(object): # pragma: no cover
CAN_ALL = 'all'
- issue_tracker_requests = gae_ts_mon.CounterMetric(
- 'flakiness_pipeline/issue_tracker_requests',
- description='Number of requests to the issue tracker')
-
"""A wrapper around the issue tracker api."""
def __init__(self, project_name):
self.project_name = project_name
@@ -98,8 +92,6 @@ class IssueTrackerAPI(object): # pragma: no cover
request = self.client.issues().insert(
projectId=self.project_name, sendEmail=send_email, body=body)
tmp = self._retry_api_call(request)
- self.issue_tracker_requests.increment(
- {'source': 'chromium-try-flakes', 'operation': 'issues_insert'})
issue.id = int(tmp['id'])
issue.dirty = False
return issue
@@ -138,8 +130,6 @@ class IssueTrackerAPI(object): # pragma: no cover
projectId=self.project_name, issueId=issue.id, sendEmail=send_email,
body=body)
self._retry_api_call(request)
- self.issue_tracker_requests.increment(
- {'source': 'chromium-try-flakes', 'operation': 'comments_insert'})
if issue.owner == '----':
issue.owner = ''
@@ -156,8 +146,6 @@ class IssueTrackerAPI(object): # pragma: no cover
projectId=self.project_name, issueId=issue_id, startIndex=1,
maxResults=0)
feed = self._retry_api_call(request)
- self.issue_tracker_requests.increment(
- {'source': 'chromium-try-flakes', 'operation': 'comments_list'})
return feed.get('totalResults', '0')
def getComments(self, issue_id):
@@ -166,8 +154,6 @@ class IssueTrackerAPI(object): # pragma: no cover
request = self.client.issues().comments().list(
projectId=self.project_name, issueId=issue_id)
feed = self._retry_api_call(request)
- self.issue_tracker_requests.increment(
- {'source': 'chromium-try-flakes', 'operation': 'comments_list'})
rtn.extend([Comment(entry) for entry in feed['items']])
total_results = feed['totalResults']
if not total_results:
@@ -177,8 +163,6 @@ class IssueTrackerAPI(object): # pragma: no cover
request = self.client.issues().comments().list(
projectId=self.project_name, issueId=issue_id, startIndex=len(rtn))
feed = self._retry_api_call(request)
- self.issue_tracker_requests.increment(
- {'source': 'chromium-try-flakes', 'operation': 'comments_list'})
rtn.extend([Comment(entry) for entry in feed['items']])
return rtn
@@ -188,8 +172,6 @@ class IssueTrackerAPI(object): # pragma: no cover
projectId=self.project_name, issueId=issue_id, startIndex=0,
maxResults=1)
feed = self._retry_api_call(request)
- self.issue_tracker_requests.increment(
- {'source': 'chromium-try-flakes', 'operation': 'comments_list'})
if 'items' in feed and len(feed['items']) > 0:
return Comment(feed['items'][0])
return None
@@ -200,8 +182,6 @@ class IssueTrackerAPI(object): # pragma: no cover
projectId=self.project_name, issueId=issue_id,
startIndex=total_results-1, maxResults=1)
feed = self._retry_api_call(request)
- self.issue_tracker_requests.increment(
- {'source': 'chromium-try-flakes', 'operation': 'comments_list'})
if 'items' in feed and len(feed['items']) > 0:
return Comment(feed['items'][0])
return None
@@ -210,7 +190,5 @@ class IssueTrackerAPI(object): # pragma: no cover
"""Retrieve a set of issues in a project."""
request = self.client.issues().get(
projectId=self.project_name, issueId=issue_id)
- self.issue_tracker_requests.increment(
- {'source': 'chromium-try-flakes', 'operation': 'issues_get'})
entry = self._retry_api_call(request)
return Issue(entry)
« no previous file with comments | « no previous file | infra/services/builder_alerts/__main__.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698