A Simple Graph Stress Tester
Groovy
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
src/main/groovy/com/countvajhula/splinter
.gitignore
README.textile
pom.xml
sampletestdefinition.xml

README.textile

Introduction

A simple automated graph stress test tool based on the Pilot graph operator, utilizing the Tinkerpop stack — i.e. Blueprints, Gremlin, Pipes. You can use it to:

  • quickly generate random graphs of whatever configuration you want (you can specify number of vertices and level of connectivity)
  • benchmark different graph database providers on some defined metrics
  • automate sets of tests to be run on any number of graphs

To Use:

For Maven Users

After downloading the project, just:

$ mvn clean install
$ mvn exec:java -Dexec.args="sampletestdefinition.xml"

In the above command, any test definition XML file may be used in place of the example sampletestdefinition.xml file provided.

Non-Maven

Dependencies

Make sure you have Pilot, the Tinkerpop libraries, and your favorite graph database already in your system CLASSPATH.

Running

Copy the sources in src/main/groovy/com/countvajhula/splinter/ to a desired location and cd into that directory. Then:

$ groovyc *.groovy
$ ./Splinter.groovy <testdefinitionfile.xml>

As an example, the provided sampletestdefinition.xml file may be used in the above command.

Test Definition

The test definition file is pretty straightforward XML (see sampletestdefinition.xml for a comprehensive example) like so:

<sampletestdefinition>
	<graphs>
		<graph type="tinkergraph" overwrite="no">
			<vertices>100</vertices>
			<connectivity>
				<function>linear</function>
				<arg>0.2</arg>
			</connectivity>
		</graph>
		<!-- add more graphs here if you want to get crazy -->
	</graphs>
	<tests>
		<test name="getEdgesBetweenVertices">
			<times>100</times>
		</test>
		<test name="getNeighbors">
			<times>100</times>
		</test>
		<!-- these are the only pre-loaded metrics. You can add your own fairly easily by modifying the file TestMetrics.groovy, if you want to get crazy -->
	</tests>
</sampletestdefinition>

Example output:

$./GraphStressTester.groovy sampletestdefinition.xml
...
TinkerGraph graph initialized.
Graph empty or overwrite set to true. Recreating graph.
Running getNeighbors...
profiler results:
------PROFILER RESULTS (tinkergraph_100vertices_linear0.2connxns--getneighbors) ------
Total Duration = 152.004 ms
getNeighbors:	149.073 ms	98.07176127 %
getVertex:	1.988 ms	1.30786032 %
hashCode:	0.595 ms	0.39143707 %
equals:	0.348 ms	0.22894134 %
super$2$getElementProperty:	0.0 ms	0.0 %
$createCallSiteArray:	0.0 ms	0.0 %
super$2$getAllEdges:	0.0 ms	0.0 %
super$2$removeEdge:	0.0 ms	0.0 %
super$2$this$dist$set$2:	0.0 ms	0.0 %
... etc.
------xxxxxxxxxxxxxxxx (tinkergraph_100vertices_linear0.2connxns--getneighbors) ------