Last active
December 16, 2015 22:39
-
-
Save psiska/5508990 to your computer and use it in GitHub Desktop.
OrientDB ScalaMeter example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx | |
import com.orientechnologies.orient.core.record.impl.ODocument | |
import org.scalameter.api._ | |
object DBTest extends PerformanceTest.Quickbenchmark { | |
import OUtils._ //custom DB helper - setups the database | |
val sequence = Gen.range("sequence")(0, 10, 1) | |
val names = Gen.enumeration("names")("ferko", "jozko", "duri", "alica", "betar", "kuchar", "lopata", "kon") | |
val recs = for { | |
seqid <- sequence | |
name <- names | |
} yield (seqid, name) | |
var dbcon = _ | |
performance of "OrientDB" in { | |
measure method "insert" in { | |
using(recs) setUpBeforeAll{ | |
prepareDB //creates the db in filesystem | |
dbcon = openDB //opens the db for use | |
} tearDownAfterAll { | |
dbcon.drop | |
dbcon.close | |
} in { | |
tup => new ODocument("perftest").field("myid", i).field("id", tup._1).field("sample", tup._2).save | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment