mirror of
https://github.com/mhx/dwarfs.git
synced 2025-08-03 17:56:12 -04:00
chore: don't import duplicate benchmark results
This commit is contained in:
parent
b155610ca3
commit
5a25eb104c
@ -34,14 +34,22 @@ def import_data(db_path, *args):
|
|||||||
]
|
]
|
||||||
)
|
)
|
||||||
|
|
||||||
|
dbtimes = {doc['time'] for doc in table.all()}
|
||||||
|
skipped = 0
|
||||||
|
|
||||||
for path in tqdm(files, desc="Importing JSON files", unit="file"):
|
for path in tqdm(files, desc="Importing JSON files", unit="file"):
|
||||||
with open(path, "r") as f:
|
with open(path, "r") as f:
|
||||||
data = json.load(f)
|
data = json.load(f)
|
||||||
|
if data["time"] in dbtimes:
|
||||||
|
skipped += 1
|
||||||
|
continue
|
||||||
if "exit_codes" in data:
|
if "exit_codes" in data:
|
||||||
del data["times"]
|
del data["times"]
|
||||||
del data["exit_codes"]
|
del data["exit_codes"]
|
||||||
table.insert(data)
|
table.insert(data)
|
||||||
|
|
||||||
|
print(f"Skipped {skipped} files that were already in the database.")
|
||||||
|
|
||||||
|
|
||||||
def query_and_bar_chart(db_path, arch, version, binary_type):
|
def query_and_bar_chart(db_path, arch, version, binary_type):
|
||||||
"""
|
"""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user