Add log sizes tool
This commit is contained in:
parent
bdbfb0c6d3
commit
820d5c0476
1 changed files with 20 additions and 0 deletions
20
tools/logsize.py
Normal file
20
tools/logsize.py
Normal file
|
@ -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))
|
Reference in a new issue