Skip to content

Commit b467359

Browse files
committed
reset numsent in between connection test runs
1 parent 0910c4e commit b467359

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

src/ProtocolLoadTest/Program.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ class Program
2020

2121
static void Main(string[] args)
2222
{
23-
//double httpRate = RunTest<HttpTester>(HTTP_PORT);
23+
double httpRate = RunTest<HttpTester>(HTTP_PORT);
2424
double thriftRate = RunTest<ThriftTester>(THRIFT_PORT);
2525

2626
Console.WriteLine();
27-
//Console.WriteLine("HTTP: {0:0,0}/s", httpRate);
27+
Console.WriteLine("HTTP: {0:0,0}/s", httpRate);
2828
Console.WriteLine("Thrift: {0:0,0}/s", thriftRate);
2929

3030
Console.ReadLine();
@@ -51,7 +51,7 @@ private static double RunTest<T>(int port) where T : ITester
5151
Console.WriteLine("{0} test completed in {1}ms ({2:0,0}/s)", type, sw.ElapsedMilliseconds, rate);
5252

5353
// Close the index so we don't interfere with the next test
54-
//CloseIndex(type);
54+
CloseIndex(type);
5555

5656
return rate;
5757
}

src/ProtocolLoadTest/Tester.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,9 @@ protected static void GenerateAndIndex(ElasticClient client, string indexName, i
4141
var tasks = new List<Task>();
4242

4343
var partitionedMessages = msgGenerator.Generate(numMessages).Partition(bufferSize);
44-
44+
45+
Interlocked.Exchange(ref NumSent, 0);
46+
4547
foreach (var messages in partitionedMessages)
4648
{
4749
var t = client.IndexManyAsync(messages, indexName, bulkParms);

0 commit comments

Comments
 (0)