memgraph/tests/benchmark_infra/groups/delete/setup.py
Mislav Bradac 955962d036 Fix bugs in benchmarks
Reviewers: buda

Reviewed By: buda

Differential Revision: https://phabricator.memgraph.io/D536
2017-07-11 14:46:06 +02:00

27 lines
802 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) or \
(vertex + 1 == vertex_count):
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("MATCH (a {id: %d}), (b {id: %d}) MERGE (a)-[:Type]->(b)" % (
randint(0, vertex_count - 1), randint(0, vertex_count - 1)))
print(";")
if __name__ == '__main__':
raise Exception("This file is just for utilities, not for actual setup")