Skip to content

Commit

Permalink
block history to report total number of transactions
Browse files Browse the repository at this point in the history
  • Loading branch information
algorandskiy committed Aug 22, 2024
1 parent 1f25c59 commit 1cc9a9c
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions test/heapwatch/block_history_plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
# Graph over time of TPS or 10-round-moving-average-TPS

import base64
import json
import os
import statistics
import sys
Expand Down Expand Up @@ -85,10 +86,11 @@ def process(path, args):
else:
tsv.append(_time)
if dt > 0.5:
dt = round(dt, 3)
dtxn = tc - prevtc
if dtxn < 0:
sys.stderr.write(f'{path}:{count} tc {tc}, prevtc {prevtc}, rnd {rnd}, prevrnd {prevrnd}\n')
tps = dtxn / dt
tps = round(dtxn / dt, 3)
mintxn = min(dtxn,mintxn)
maxtxn = max(dtxn,maxtxn)
mindt = min(dt,mindt)
Expand All @@ -106,12 +108,25 @@ def process(path, args):
prevtc = tc
prevts = ts
prevtime = _time
print('{} blocks, block txns [{}-{}], block seconds [{}-{}], tps [{}-{}]'.format(
print('{} blocks, block txns [{}-{}], block seconds [{}-{}], tps [{}-{}], total txns {}'.format(
count,
mintxn,maxtxn,
mindt,maxdt,
mintps,maxtps,
tc,
))
if tc > 0:
with open(path + '.stats', 'w') as fout:
fout.write(json.dumps({
'blocks': count,
'tc': tc,
'mintxn': mintxn,
'maxtxn': maxtxn,
'mindt': mindt,
'maxdt': maxdt,
'mintps': mintps,
'maxtps': maxtps,
}))

start = 0
end = len(txnv)-1
Expand Down

0 comments on commit 1cc9a9c

Please sign in to comment.