Permalink
Browse files

added default max

  • Loading branch information...
1 parent cd47924 commit ebe204849f3456730fa9b8283bbaec8af587ff50 @fehguy committed Apr 19, 2012
Showing with 7 additions and 0 deletions.
  1. +7 −0 src/main/scala/BaseBenchmark.scala
@@ -42,6 +42,13 @@ abstract class BaseBenchmark {
case "true" => validateData(config("totalRecords").toInt)
case _ =>
}
+ config.getOrElse("totalRecords", {
+ getDb().getCollection(getCollectionName()).find().count() match {
+ case c: Int => config += "totalRecords" -> c.toString
+ case _ => config += "totalRecords" -> "0"
+ }
+ println("set totalRecords from DB to " + config("totalRecords"))
+ })
}
def getCollectionName() = config("collection")

0 comments on commit ebe2048

Please sign in to comment.