示例#1
0
文件: main.py 项目: emfcamp/Website
 def after_request(response):
     try:
         request_duration.labels(request.endpoint, request.method).observe(
             time.time() - request._start_time)
     except AttributeError:
         logging.exception("Request without _start_time - check app.before_request ordering")
     request_total.labels(request.endpoint, request.method, response.status_code).inc()
     return response
示例#2
0
文件: main.py 项目: dominicgs/Website
 def after_request(response):
     try:
         request_duration.labels(request.endpoint, request.method).observe(
             time.time() - request._start_time)
     except AttributeError:
         # In some cases this isn't present?
         logging.exception("Request without _start_time")
     request_total.labels(request.endpoint, request.method, response.status_code).inc()
     return response
示例#3
0
 def after_request(response):
     try:
         request_duration.labels(request.endpoint, request.method).observe(
             time.time() - request._start_time)
     except AttributeError:
         # In some cases this isn't present?
         logging.exception("Request without _start_time")
     request_total.labels(request.endpoint, request.method, response.status_code).inc()
     return response
示例#4
0
 def after_request(response):
     try:
         request_duration.labels(
             request.endpoint,
             request.method).observe(time.time() - request._start_time)
     except AttributeError:
         logging.exception(
             "Request without _start_time - check app.before_request ordering"
         )
     request_total.labels(request.endpoint, request.method,
                          response.status_code).inc()
     return response