-
Notifications
You must be signed in to change notification settings - Fork 0
/
client.py
37 lines (30 loc) · 982 Bytes
/
client.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
from asvbench import AsvBenchmarkAdapter
from pathlib import Path
import os
import time
import alert
from utilities import Environment, check_new_files
env = Environment()
benchmarks_file_path = Path.cwd() / env.BENCHMARKS_FILE_PATH
def adapter_instance(file_to_read) -> None:
adapter = AsvBenchmarkAdapter(
command=["echo", str(file_to_read)],
result_file=Path(file_to_read),
result_fields_override={
"run_reason": env.CONBENCH_RUN_REASON,
},
benchmarks_file_path=benchmarks_file_path,
)
adapter.run()
adapter.post_results()
def post_data() -> None:
while True:
all_files, processed_files = check_new_files(env)
for new_file in (set(all_files) - set(processed_files)):
adapter_instance(new_file)
with open(env.ASV_PROCESSED_FILES, "a") as f:
f.write(new_file)
f.write("\n")
time.sleep(30) #adjust this on server
if __name__=="__main__":
post_data()