private void Flush() { Upscaledb.Environment env = new Upscaledb.Environment(); env.Create("ntest.db"); env.Flush(); env.Close(); }
public void Start(string context, int recordCount, int?threadCount = null) { Log.Clear(); Context = context; RecordCount = recordCount; ThreadCount = threadCount; var engine = GetType().Name; Log.AppendLine($"# Context: {Context} | Engine: {engine} | Records: {recordCount} | Threads: {threadCount}"); var databaseName = $@"{context.Replace(" ", "_").ToLower()}_{engine.ToLower()}.db"; if (Directory.Exists(databaseName)) { Directory.Delete(databaseName, true); } var databasePath = Path.Combine(System.Environment.CurrentDirectory, databaseName); var environment = new Upscaledb.Environment(); var db = new Database(); environment.Create(databaseName); db = environment.CreateDatabase(1); var stopWatch = new Stopwatch(); stopWatch.Start(); _actions.ForEach(action => action(db)); stopWatch.Stop(); environment.Flush(); environment.Close(); db.Close(); Log.AppendFormat("# Context: {0} | Engine: {1} | Total time: {2:hh\\:mm\\:ss\\.ffff}\n", Context, engine, stopWatch.Elapsed); Log.AppendLine("\n"); }
private void Flush() { Upscaledb.Environment env = new Upscaledb.Environment(); env.Create("ntest.db"); env.Flush(); env.Close(); }