graph.py (420B)
1 import plotly.express as px 2 import os 3 import subprocess 4 5 def du(path): 6 """disk usage in human readable format (e.g. '2,1GB')""" 7 print(path) 8 return subprocess.check_output(['du','-s', path]).split()[0].decode('utf-8') 9 10 sizes = [] 11 12 # Run this from root of repo 13 for f in os.listdir('./crawl/outputs/sites/'): 14 sizes.append(du("./crawl/outputs/sites/" + f)) 15 16 print(sizes) 17 fig = px.histogram(sizes) 18 fig.show()