memgraph/tests/benchmark_infra/groups/delete/setup.py
Mislav Bradac d14accad07 Migrate harness to memgraph
Reviewers: buda

Reviewed By: buda

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D532
2017-07-10 19:07:32 +02:00

27 lines
784 B
Python

""" This file does nothing, it's just utilities for other setups """
from random import randint
BATCH_SIZE = 50
def create_vertices(vertex_count):
for vertex in range(vertex_count):
print("CREATE (:Label {id: %d})" % vertex)
if vertex != 0 and vertex % BATCH_SIZE == 0:
print(";")
def create_edges(edge_count, vertex_count):
""" vertex_count is the number of already existing vertices in graph """
for edge in range(edge_count):
print("MERGE ({id: %d})-[:Type]->({id: %d})" % (
randint(0, vertex_count - 1), randint(0, vertex_count - 1)))
if edge != 0 and edge % BATCH_SIZE == 0:
print(";")
if __name__ == '__main__':
raise Exception("This file is just for utilities, not for actual setup")