Try to add simplest mgbench dataset (#746)

This commit is contained in:
Marko Budiselić
2023-02-03 11:10:09 +01:00
committed by GitHub
parent fde3583883
commit 768b710af1
4 changed files with 31 additions and 2 deletions

View File

@@ -108,7 +108,12 @@ parser.add_argument("--no-properties-on-edges", action="store_true", help="disab
parser.add_argument("--bolt-port", default=7687, help="memgraph bolt port")
parser.add_argument("--datasets-path", default="datasets", help="path to datasets to scan")
parser.add_argument(
"--datasets-path",
default="datasets",
help="path to a single Python file where additional datasets are located"
"NOTE: give the file unique name compared to the core module names",
)
parser.add_argument("--test-system-args", default="")
parser.add_argument(

View File

@@ -574,3 +574,25 @@ class AccessControl(Dataset):
{},
)
return query
class TestDataset(Dataset):
NAME = "test"
VARIANTS = ["small"]
DEFAULT_VARIANT = "small"
# TODO(gitbuda): ~/Downloads/ doesn't work for some reason, fix! :)
# TODO(gitbuda): If ~ is wrong, client fails just with SIGABRT -> hard to figure out -> enable more details from client.
FILES = {
"small": "/home/buda/Downloads/mgbench/test_dataset_small.cypherl",
}
SIZES = {
"small": {"vertices": 10, "edges": 9},
}
# TODO(gitbuda): What's the purpose of the INDEX inside the Dataset?
# TODO(gitbuda): It's not possible to also inject local index file, it's much easier to add your local file compare to uploading it somewhere or running local HTTP server (easy with e.g. python, but...)
INDEX_FILES = {
"memgraph": "http://localhost:8080/test_dataset_index.cypherl",
}
def benchmark__basic__test(self):
return ("MATCH (n:Label {id: 0})-[*]->(m) RETURN n, m;", {})

View File

@@ -27,7 +27,7 @@ def get_binary_path(path, base=""):
def download_file(url, path):
if "https://" in url:
if "http://" in url or "https://" in url:
ret = subprocess.run(
["wget", "-nv", "--content-disposition", url], stderr=subprocess.PIPE, cwd=path, check=True
)

View File

@@ -115,6 +115,8 @@ class Memgraph:
self._proc_mg = None
raise Exception("The database process died prematurely!")
wait_for_server(7687)
# TODO(gitbuda): Add better logging
print("Memgraph is running...")
ret = self._proc_mg.poll()
assert ret is None, "The database process died prematurely " "({})!".format(ret)