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/sharedimagestorage.py

15 lines
365 B
Python
Raw Normal View History

2019-11-12 16:09:47 +00:00
from data.database import Image, ImageStorage
query = ImageStorage.select().annotate(Image)
saved_bytes = 0
total_bytes = 0
for storage in query:
if storage.image_size is not None:
saved_bytes += (storage.count - 1) * storage.image_size
total_bytes += storage.count * storage.image_size
print "Saved: %s" % saved_bytes
print "Total: %s" % total_bytes