Skip to content

Commit

Permalink
Update show-tps.py
Browse files Browse the repository at this point in the history
  • Loading branch information
0g-wh committed Nov 12, 2024
1 parent 6580b64 commit 0445dce
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions show-tps.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,15 @@ def getTPS(url):
category = 'Simple' if len(name) < 3 else name[2].strip()
print(chain, category)
runs = requests.get(f'{workflow['url']}/runs', headers=headers).json()
last_run = runs['workflow_runs'][0]
print(last_run['logs_url'])
best_tps, gas_used = getTPS(last_run['logs_url'])
print(best_tps, gas_used)
if chain not in res:
res[chain] = {}
res[chain][category] = (best_tps, gas_used)
for run in runs['workflow_runs']:
if run['conclusion'] == 'success':
print(run['logs_url'])
best_tps, gas_used = getTPS(run['logs_url'])
print(best_tps, gas_used)
if chain not in res:
res[chain] = {}
res[chain][category] = (best_tps, gas_used)
break

print(res)

Expand Down

0 comments on commit 0445dce

Please sign in to comment.