From 8f59ac1251420428505d84f98ecea7bdc79cd678 Mon Sep 17 00:00:00 2001 From: Brad Ison Date: Wed, 14 Dec 2016 12:16:02 -0500 Subject: [PATCH 1/2] Don't record size in chunk upload metrics --- endpoints/v1/registry.py | 2 +- util/metrics/metricqueue.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/endpoints/v1/registry.py b/endpoints/v1/registry.py index 543a8f4c2..c6f6f71f4 100644 --- a/endpoints/v1/registry.py +++ b/endpoints/v1/registry.py @@ -200,7 +200,7 @@ def put_image_layer(namespace, repository, image_id): start_time = time() store.stream_write(locations, path, sr) metric_queue.chunk_upload_time.Observe(time() - start_time, - labelvalues=[size_info.compressed_size, list(locations)[0]]) + labelvalues=[list(locations)[0]]) except IOError: logger.exception('Exception when writing image data') abort(520, 'Image %(image_id)s could not be written. Please try again.', image_id=image_id) diff --git a/util/metrics/metricqueue.py b/util/metrics/metricqueue.py index caf065ea5..cbb8e5fe4 100644 --- a/util/metrics/metricqueue.py +++ b/util/metrics/metricqueue.py @@ -75,7 +75,7 @@ class MetricQueue(object): self.chunk_upload_time = prom.create_histogram('chunk_upload_time', 'Registry blob chunk upload time', - labelnames=['chunk_size', 'storage_region']) + labelnames=['storage_region']) self.authentication_count = prom.create_counter('authenication_count', 'Authentication count', From df7366eaceb4bd858cc9fa9b1de8e9695c81901d Mon Sep 17 00:00:00 2001 From: Brad Ison Date: Thu, 15 Dec 2016 13:20:16 -0500 Subject: [PATCH 2/2] Add chunk size metric --- endpoints/v1/registry.py | 2 ++ util/metrics/metricqueue.py | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/endpoints/v1/registry.py b/endpoints/v1/registry.py index c6f6f71f4..f0bcc11b8 100644 --- a/endpoints/v1/registry.py +++ b/endpoints/v1/registry.py @@ -199,6 +199,8 @@ def put_image_layer(namespace, repository, image_id): try: start_time = time() store.stream_write(locations, path, sr) + metric_queue.chunk_size.Observe(size_info.compressed_size, + labelvalues=[list(locations)[0]]) metric_queue.chunk_upload_time.Observe(time() - start_time, labelvalues=[list(locations)[0]]) except IOError: diff --git a/util/metrics/metricqueue.py b/util/metrics/metricqueue.py index cbb8e5fe4..5dba0ea97 100644 --- a/util/metrics/metricqueue.py +++ b/util/metrics/metricqueue.py @@ -73,6 +73,10 @@ class MetricQueue(object): labelnames=['namespace', 'repo_name', 'status', 'executor']) + self.chunk_size = prom.create_histogram('chunk_size', + 'Registry blob chunk size', + labelnames=['storage_region']) + self.chunk_upload_time = prom.create_histogram('chunk_upload_time', 'Registry blob chunk upload time', labelnames=['storage_region'])