Skip to content

Commit

Permalink
Update InsertTestsWithIntermittentTransactions.cs
Browse files Browse the repository at this point in the history
  • Loading branch information
gfs committed Mar 11, 2020
1 parent 7d64b6f commit 6de3e67
Showing 1 changed file with 9 additions and 15 deletions.
24 changes: 9 additions & 15 deletions AsaBenchmarks/InsertTestsWithIntermittentTransactions.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using AttackSurfaceAnalyzer.Objects;
using AttackSurfaceAnalyzer.Utils;
using BenchmarkDotNet.Attributes;
using Serilog;
using System.Collections.Concurrent;
using System.Threading;
using System.Threading.Tasks;
Expand All @@ -13,7 +14,7 @@ public class InsertTestsWithIntermittentTransactions
{
// The number of records to insert for the benchmark
//[Params(25000,50000,100000)]
[Params(100000)]
[Params(100000,1000000)]
public int N { get; set; }

// The number of records to populate the database with before the benchmark
Expand All @@ -28,11 +29,11 @@ public class InsertTestsWithIntermittentTransactions
public int ObjectPadding { get; set; }

// The number of Shards/Threads to use for Database operations
[Params(1,2,3,4,5,6,7,8,9,10,11,12)]
[Params(6)]
public int Shards { get; set; }

// The number of Shards/Threads to use for Database operations
[Params(5000,10000,25000)]
[Params(5000,10000,25000,100000,-1)]
public int FlushCount { get; set; }

// Bag of reusable objects to write to the database.
Expand Down Expand Up @@ -117,18 +118,11 @@ public void IterationSetup()
[IterationCleanup]
public void IterationCleanup()
{
if (StartingSize == 0)
{
DatabaseManager.Destroy();
}
else
{
DatabaseManager.BeginTransaction();
DatabaseManager.DeleteRun("Insert_N_Objects");
DatabaseManager.Commit();
DatabaseManager.Vacuum();
DatabaseManager.CloseDatabase();
}
DatabaseManager.BeginTransaction();
DatabaseManager.DeleteRun("Insert_N_Objects");
DatabaseManager.Commit();
DatabaseManager.Vacuum();
DatabaseManager.CloseDatabase();
}
}
}

0 comments on commit 6de3e67

Please sign in to comment.