Last active
November 4, 2016 21:28
-
-
Save johntbush/9a6536dd4a5209c6cc82496725805536 to your computer and use it in GitHub Desktop.
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
| #!/usr/bin/env scalas | |
| /*** | |
| scalaVersion := "2.11.8" | |
| resolvers += Resolver.url("typesafe-ivy-repo", url("http://repo.typesafe.com/typesafe/releases"))(Resolver.ivyStylePatterns) | |
| resolvers += "Trax Artifactory" at "http://artifactory.s03.filex.com/artifactory/repo" | |
| resolvers += "mandubian maven bintray" at "http://dl.bintray.com/mandubian/maven" | |
| resolvers += Resolver.mavenLocal | |
| libraryDependencies += "org.scala-sbt" % "io" % "0.13.11" | |
| libraryDependencies += "ch.qos.logback" % "logback-classic" % "1.1.7" | |
| libraryDependencies += "ch.qos.logback" % "logback-core" % "1.1.7" | |
| libraryDependencies += "org.slf4j" % "slf4j-api" % "1.7.21" | |
| libraryDependencies += "com.trax.platform" % "trax-platform-shared" % "1.2.55" | |
| libraryDependencies += "com.trax.platform" % "trax-platform-utils" % "1.3.26" | |
| */ | |
| import com.trax.common.log.LogbackUtils | |
| import com.trax.platform.shared.fps.FpsAware | |
| import com.trax.platform.sql.DatabaseManager._ | |
| import com.trax.platform.sql.TaggedDB | |
| import com.trax.platform.util.scala.DateTimeUtils | |
| import com.trax.platform.util.scala.metrics.Metrics | |
| import com.typesafe.scalalogging.Logger | |
| import org.slf4j.LoggerFactory | |
| import scalikejdbc._ | |
| LogbackUtils.setLogLevel(null, "INFO") | |
| val logger = Logger(LoggerFactory.getLogger("log")) | |
| val dbUser="someuser" | |
| val dbPwd="*" | |
| //Metrics.startConsoleReporter() | |
| object Helper extends FpsAware { | |
| def database(envId: String) = findEnvironment(envId).get.db | |
| } | |
| val start = DateTimeUtils.nowUtc.getMillis | |
| val rows = 100000 | |
| TaggedDB(initDb(Database("sql0.filex.com","GrandCanyon"), userName = dbUser, pwd = dbPwd, isDomainLogon = false)) localTx { implicit session => | |
| SQL("select TOP 100000 * from vw_DW_Freight_Bill_Lines_Reporting") | |
| .fetchSize(1000) | |
| .foreach { rs => } | |
| } | |
| val end = DateTimeUtils.nowUtc.getMillis | |
| val diff = (end - start) / 1000 | |
| val rowsPerSec = 100000 / diff | |
| println("took " + diff + " secs") | |
| println("rowsPerSec " + rowsPerSec) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment