20 lines
555 B
Python
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))
|