move memory monitor benchamrk to single indexing stress test

This commit is contained in:
kimchy 2010-08-20 15:05:21 +03:00
parent ef64f5d970
commit 4c00e89f5e

View File

@ -65,7 +65,8 @@ public class SingleThreadIndexingStress {
StopWatch stopWatch = new StopWatch().start(); StopWatch stopWatch = new StopWatch().start();
int COUNT = 200000; int COUNT = 200000;
System.out.println("Indexing [" + COUNT + "] ..."); System.out.println("Indexing [" + COUNT + "] ...");
for (int i = 0; i < COUNT; i++) { int i = 1;
for (; i <= COUNT; i++) {
client1.index( client1.index(
indexRequest("test") indexRequest("test")
.type("type1") .type("type1")
@ -74,11 +75,10 @@ public class SingleThreadIndexingStress {
.opType(IndexRequest.OpType.INDEX) .opType(IndexRequest.OpType.INDEX)
).actionGet(); ).actionGet();
if ((i % 10000) == 0) { if ((i % 10000) == 0) {
System.out.println("Indexed 10000, total " + (i + 10000) + " took " + stopWatch.stop().lastTaskTime()); System.out.println("Indexed " + i + " took " + stopWatch.stop().lastTaskTime());
stopWatch.start(); stopWatch.start();
} }
} }
stopWatch.stop();
System.out.println("Indexing took " + stopWatch.totalTime() + ", TPS " + (((double) COUNT) / stopWatch.totalTime().secondsFrac())); System.out.println("Indexing took " + stopWatch.totalTime() + ", TPS " + (((double) COUNT) / stopWatch.totalTime().secondsFrac()));
client.close(); client.close();