Permalink
Browse files

changed number of docs created

  • Loading branch information...
1 parent 7e15e33 commit 0220d8a53f0d496c735d7e78b8cc66b5d940dd2c @marcesher committed Apr 7, 2012
Showing with 16 additions and 8 deletions.
  1. +16 −8 examples/benchmark.cfm
View
24 examples/benchmark.cfm
@@ -1,3 +1,4 @@
+<cfsetting requesttimeout="500">
<!--- create the mongo objects --->
<cfset variables.dbName = "cfmongodb_benchmarks">
@@ -16,7 +17,7 @@
dataCreateStart = getTickCount();
coolPeople = [];
- totalDocs = 1000;
+ totalDocs = 50000;
for( i = 1; i LTE totalDocs; i++ ){
DOC =
{
@@ -30,12 +31,17 @@
TS = now(),
COUNTER = i,
MONGOROCKS = true,
- PRODUCT = serverName
+ PRODUCT = serverName,
+ PRICE = randRange(1,1000),
+ TICK = getTickCount(),
+ SKU = repeatString( randRange(1,100), "10" )
};
arrayAppend( coolPeople, doc );
}
dataCreateTotal = getTickCount() - dataCreateStart;
+ writeOutput("Total docs: #arrayLen(coolPeople)# in #dataCreateTotal# ms");
+
saveStart = getTickCount();
dbCol.saveAll( coolPeople );
@@ -45,6 +51,8 @@
stat = { DATATOTAL=dataCreateTotal, SAVETOTAL=saveTotal, COUNT=totalDocs, SAVETYPE='structs', USEJL=url.useJavaLoader, PRODUCT=serverName, TS=now() };
metricsCol.save( stat );
+ writeDump(stat);
+
dataCreateStart = getTickCount();
coolPeople = [];
@@ -61,7 +69,10 @@
TS = now(),
COUNTER = i,
MONGOROCKS = true,
- PRODUCT = serverName
+ PRODUCT = serverName,
+ PRICE = randRange(1,1000),
+ TICK = getTickCount(),
+ SKU = repeatString( randRange(1,100), "10" )
};
arrayAppend( coolPeople, mongoUtil.toMongo(doc) );
}
@@ -77,6 +88,7 @@
stat = { DATATOTAL=dataCreateTotal, SAVETOTAL=saveTotal, COUNT=totalDocs, SAVETYPE='dbos', USEJL=url.useJavaLoader, PRODUCT=serverName, TS=now() };
metricsCol.save( stat );
+ writeDump(stat);
reduce = "
@@ -101,14 +113,10 @@
keys="PRODUCT,SAVETYPE,USEJL",
initial={COUNT=0,SAVETOTAL=0,DATATOTAL=0},
reduce=reduce,
- query={COUNT = 1000, PRODUCT = {"$exists" = true} },
+ query={COUNT = totalDocs, PRODUCT = {"$exists" = true} },
finalize=finalize
);
writeDump(metricsResults);
-
-
-
-
</cfscript>

0 comments on commit 0220d8a

Please sign in to comment.