mirror of
https://github.com/FAUSheppy/skillbird
synced 2025-12-06 14:51:36 +01:00
32 lines
776 B
Python
Executable File
32 lines
776 B
Python
Executable File
#!/usr/bin/python3
|
|
|
|
import sys
|
|
import requests
|
|
import json
|
|
import datetime as dt
|
|
|
|
if not len(sys.argv)>1:
|
|
sys.exit(1)
|
|
|
|
count = 31000
|
|
i = 0
|
|
start = dt.datetime.now()
|
|
url = "http://127.0.0.1:6200/single-event?session=0000"
|
|
|
|
with open(sys.argv[1], "r") as f:
|
|
for l in f:
|
|
requests.post(url, json=json.loads(l))
|
|
cur = dt.datetime.now()
|
|
i+=1
|
|
|
|
percent = int(i/count*100);
|
|
elapsed = str(cur-start)
|
|
estRem = str((cur-start)/i*count)
|
|
if "." in estRem:
|
|
estRem = estRem.split(".")[0]
|
|
if "." in elapsed:
|
|
elapsed = elapsed.split(".")[0]
|
|
print("Round: {} ({}%) - elapsed: {}, estimated remaining: {}".format(i, percent, elapsed, estRem))
|
|
|
|
requests.post(url, json={"etype":"round_end"})
|