Merge branch 'master' of https://github.com/coreos-inc/quay
This commit is contained in:
commit
5e9d9eb6cd
2 changed files with 12 additions and 6 deletions
|
@ -22,7 +22,7 @@ proxy_set_header Transfer-Encoding $http_transfer_encoding;
|
||||||
location / {
|
location / {
|
||||||
proxy_pass http://web_app_server;
|
proxy_pass http://web_app_server;
|
||||||
|
|
||||||
limit_req zone=webapp burst=10 nodelay;
|
#limit_req zone=webapp burst=10 nodelay;
|
||||||
}
|
}
|
||||||
|
|
||||||
location /realtime {
|
location /realtime {
|
||||||
|
@ -42,7 +42,7 @@ location /v1/ {
|
||||||
|
|
||||||
client_max_body_size 20G;
|
client_max_body_size 20G;
|
||||||
|
|
||||||
limit_req zone=api burst=5 nodelay;
|
#limit_req zone=api burst=5 nodelay;
|
||||||
}
|
}
|
||||||
|
|
||||||
location /c1/ {
|
location /c1/ {
|
||||||
|
@ -54,7 +54,7 @@ location /c1/ {
|
||||||
proxy_read_timeout 2000;
|
proxy_read_timeout 2000;
|
||||||
proxy_temp_path /var/log/nginx/proxy_temp 1 2;
|
proxy_temp_path /var/log/nginx/proxy_temp 1 2;
|
||||||
|
|
||||||
limit_req zone=api burst=5 nodelay;
|
#limit_req zone=api burst=5 nodelay;
|
||||||
}
|
}
|
||||||
|
|
||||||
location /static/ {
|
location /static/ {
|
||||||
|
|
|
@ -12,6 +12,7 @@ class NullReporter(object):
|
||||||
|
|
||||||
|
|
||||||
class QueueingCloudWatchReporter(object):
|
class QueueingCloudWatchReporter(object):
|
||||||
|
""" QueueingCloudWatchReporter reports metrics to the "SendToCloudWatch" process """
|
||||||
def __init__(self, request_queue, namespace, need_capacity_name, build_percent_name):
|
def __init__(self, request_queue, namespace, need_capacity_name, build_percent_name):
|
||||||
self._namespace = namespace
|
self._namespace = namespace
|
||||||
self._need_capacity_name = need_capacity_name
|
self._need_capacity_name = need_capacity_name
|
||||||
|
@ -35,6 +36,8 @@ class QueueingCloudWatchReporter(object):
|
||||||
|
|
||||||
|
|
||||||
class SendToCloudWatch(Process):
|
class SendToCloudWatch(Process):
|
||||||
|
""" SendToCloudWatch loops indefinitely and pulls metrics off of a queue then sends it to
|
||||||
|
CloudWatch. """
|
||||||
def __init__(self, request_queue, aws_access_key, aws_secret_key):
|
def __init__(self, request_queue, aws_access_key, aws_secret_key):
|
||||||
Process.__init__(self)
|
Process.__init__(self)
|
||||||
self._aws_access_key = aws_access_key
|
self._aws_access_key = aws_access_key
|
||||||
|
@ -43,12 +46,15 @@ class SendToCloudWatch(Process):
|
||||||
self.daemon = True
|
self.daemon = True
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
logger.debug('Starting cloudwatch sender process.')
|
logger.debug('Starting CloudWatch sender process.')
|
||||||
connection = boto.connect_cloudwatch(self._aws_access_key, self._aws_secret_key)
|
connection = boto.connect_cloudwatch(self._aws_access_key, self._aws_secret_key)
|
||||||
while True:
|
while True:
|
||||||
put_metric_args, kwargs = self._put_metrics_queue.get()
|
put_metric_args, kwargs = self._put_metrics_queue.get()
|
||||||
logger.debug('Got queued put metrics reqeust.')
|
logger.debug('Got queued put metrics request.')
|
||||||
|
try:
|
||||||
connection.put_metric_data(*put_metric_args, **kwargs)
|
connection.put_metric_data(*put_metric_args, **kwargs)
|
||||||
|
except:
|
||||||
|
logger.exception('Writing to CloudWatch failed')
|
||||||
|
|
||||||
|
|
||||||
class QueueMetrics(object):
|
class QueueMetrics(object):
|
||||||
|
|
Reference in a new issue