diff --git a/tools/logsize.py b/tools/logsize.py new file mode 100644 index 000000000..ec7339553 --- /dev/null +++ b/tools/logsize.py @@ -0,0 +1,20 @@ +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))