This repository has been archived on 2020-03-24. You can view files and clone it, but cannot push or open issues or pull requests.
quay/tools/logsize.py
2014-09-16 00:18:28 -04:00

20 lines
555 B
Python

import logging
import json
import numpy
from app import app, storage as store
storage = store._storages['s3_us_east_1']
storage._initialize_cloud_conn()
sizes = []
for key in storage._cloud_bucket.list('logarchive'):
sizes.append(key.size)
array = numpy.array(sizes)
print 'Max: %s' % max(sizes)
print 'Min: %s' % min(sizes)
print 'Avg: %s' % (float(sum(sizes))/len(sizes))
print 'Median: %s' % numpy.median(array)
print 'Std: %s' % numpy.std(array)
print 'Percent <= 64k: %s' % (float(len([entry for entry in sizes if entry <= 64000]))/len(sizes))