Add chunk size metric

This commit is contained in:
Brad Ison 2016-12-15 13:20:16 -05:00
parent 8f59ac1251
commit df7366eace
2 changed files with 6 additions and 0 deletions

View file

@ -199,6 +199,8 @@ def put_image_layer(namespace, repository, image_id):
try: try:
start_time = time() start_time = time()
store.stream_write(locations, path, sr) 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, metric_queue.chunk_upload_time.Observe(time() - start_time,
labelvalues=[list(locations)[0]]) labelvalues=[list(locations)[0]])
except IOError: except IOError:

View file

@ -73,6 +73,10 @@ class MetricQueue(object):
labelnames=['namespace', 'repo_name', labelnames=['namespace', 'repo_name',
'status', 'executor']) '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', self.chunk_upload_time = prom.create_histogram('chunk_upload_time',
'Registry blob chunk upload time', 'Registry blob chunk upload time',
labelnames=['storage_region']) labelnames=['storage_region'])