From d73b036cff994f2d97744df1b9a56cca0a7c6c45 Mon Sep 17 00:00:00 2001 From: Alex Sharov Date: Fri, 28 Aug 2020 14:19:34 +0700 Subject: [PATCH] python_bublic_print_cli (#994) --- cmd/state/py/main.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/cmd/state/py/main.py b/cmd/state/py/main.py index 18aec02cb..c5d0d82f9 100644 --- a/cmd/state/py/main.py +++ b/cmd/state/py/main.py @@ -36,12 +36,13 @@ if cmd == "stats": b = env.open_db(bucket.encode(), create=False) with env.begin(write=False) as txn: stat = txn.stat(b) - data["name"].append(bucket) - data["size"].append(stat['psize'] * (stat['branch_pages'] + stat['leaf_pages'] + stat['overflow_pages'])) - - df = pd.DataFrame.from_dict(data) - fig = px.pie(df, values='size', names='name', title='Buckets size') - fig.show() + size = stat['psize'] * (stat['branch_pages'] + stat['leaf_pages'] + stat['overflow_pages']) + print("%s: %dMb" % (bucket, size/1024/1024)) +# data["name"].append(bucket) +# data["size"].append(stat['psize'] * (stat['branch_pages'] + stat['leaf_pages'] + stat['overflow_pages'])) +# df = pd.DataFrame.from_dict(data) +# fig = px.pie(df, values='size', names='name', title='Buckets size') +# fig.show() elif cmd == "gas_limits": StartedWhenBlockNumber = chain.lastBlockNumber(env)