added the @dkuppitz example to the AkkaGraphActors test/ package for playing and benchmarking.
Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/065bcfb3 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/065bcfb3 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/065bcfb3 Branch: refs/heads/TINKERPOP-1564 Commit: 065bcfb34a9513ab3f9a32152141ebaf996a7c98 Parents: a3eb72a Author: Marko A. Rodriguez <okramma...@gmail.com> Authored: Wed Jan 4 15:10:25 2017 -0700 Committer: Marko A. Rodriguez <okramma...@gmail.com> Committed: Mon Jan 23 14:22:53 2017 -0700 ---------------------------------------------------------------------- akka-gremlin/pom.xml | 6 +++ .../process/actors/AkkaGroovyPlayTest.groovy | 53 ++++++++++++++++++++ 2 files changed, 59 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/065bcfb3/akka-gremlin/pom.xml ---------------------------------------------------------------------- diff --git a/akka-gremlin/pom.xml b/akka-gremlin/pom.xml index e9f5345..f88ec7d 100644 --- a/akka-gremlin/pom.xml +++ b/akka-gremlin/pom.xml @@ -54,6 +54,12 @@ <!-- TEST --> <dependency> <groupId>org.apache.tinkerpop</groupId> + <artifactId>gremlin-groovy</artifactId> + <version>3.3.0-SNAPSHOT</version> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.apache.tinkerpop</groupId> <artifactId>gremlin-test</artifactId> <version>3.3.0-SNAPSHOT</version> <scope>test</scope> http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/065bcfb3/akka-gremlin/src/test/groovy/org/apache/tinkerpop/gremlin/akka/process/actors/AkkaGroovyPlayTest.groovy ---------------------------------------------------------------------- diff --git a/akka-gremlin/src/test/groovy/org/apache/tinkerpop/gremlin/akka/process/actors/AkkaGroovyPlayTest.groovy b/akka-gremlin/src/test/groovy/org/apache/tinkerpop/gremlin/akka/process/actors/AkkaGroovyPlayTest.groovy new file mode 100644 index 0000000..2102abb --- /dev/null +++ b/akka-gremlin/src/test/groovy/org/apache/tinkerpop/gremlin/akka/process/actors/AkkaGroovyPlayTest.groovy @@ -0,0 +1,53 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.apache.tinkerpop.gremlin.akka.process.actors + +import org.apache.tinkerpop.gremlin.process.computer.Computer +import org.apache.tinkerpop.gremlin.structure.T +import org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerGraph +import org.apache.tinkerpop.gremlin.util.TimeUtil +import org.junit.Ignore +import org.junit.Test + +/** + * @author Marko A. Rodriguez (http://markorodriguez.com) + */ +class AkkaGroovyPlayTest { + + @Test + @Ignore + public void testStuff() { + + def graph = TinkerGraph.open() + def g = graph.traversal() + def a = graph.traversal().withProcessor(AkkaGraphActors.open().workers(8)); + def r = new Random(123) + + (1..1000000).each { + def vid = ["a", "b", "c", "d"].collectEntries { [it, r.nextInt() % 400000] } + graph.addVertex(T.id, vid) + }; [] + + println TimeUtil.clockWithResult(1) { g.V().id().select("c").count().next() } + println TimeUtil.clockWithResult(1) { g.V().id().select("c").dedup().count().next() } + println TimeUtil.clockWithResult(1) { a.V().id().select("c").count().next() } + println TimeUtil.clockWithResult(1) { a.V().id().select("c").dedup().count().next() } + } +}