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

Unified Diff: appengine/cr-buildbucket/api.py

Issue 1893233003: buildbucket: instrument endpoints with gae_ts_mon (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@master
Patch Set: specify time fn Created 4 years, 8 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: appengine/cr-buildbucket/api.py
diff --git a/appengine/cr-buildbucket/api.py b/appengine/cr-buildbucket/api.py
index 13f66d7103bdeadf5148d3b147206d6e4b39f908..0dca1a3f6c4e91219c001d29686a7c42a98fccc0 100644
--- a/appengine/cr-buildbucket/api.py
+++ b/appengine/cr-buildbucket/api.py
@@ -2,7 +2,6 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
-import datetime
import functools
import json
import logging
@@ -14,6 +13,7 @@ from components import utils
from protorpc import messages
from protorpc import message_types
from protorpc import remote
+import gae_ts_mon
import endpoints
import errors
@@ -172,6 +172,9 @@ def buildbucket_api_method(
request_message_class, response_message_class, **kwargs)
def decorator(fn):
+ def ts_mon_time():
+ return utils.datetime_to_timestamp(utils.utcnow()) / 1000000.0
+ fn = gae_ts_mon.instrument_endpoint(time_fn=ts_mon_time)(fn)
Sergey Berezin 2016/04/18 22:45:16 You shouldn't need to specify time here - it's onl
fn = catch_errors(fn, response_message_class)
fn = endpoints_decorator(fn)
fn = ndb.toplevel(fn)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698