def __init__(self, rate_limiter):
super(LogApiCallCount, self).__init__()
if self.stats:
tags = ['version:'+str(Config.API_VERSION_MINOR),
'application:rest-api',
'api-key:'+rate_limiter._auth_key.id,
'method:'+request.environ['REQUEST_METHOD'],
'endpoint:'+request.url_rule.rule.split('<')[0].split(request.blueprint)[1]]
ip = get_remote_addr()
self.stats.track(get_remote_addr(),
'api_call_count',
properties=dict(tags=tags,
ip=ip,
ignore_time = True,
))
# self.stats.increment('api.call.count',
# tags=tags,)
评论列表
文章目录