public SingletonYcsbBenchmark.BenchResult Go() { Thread[] threads = new Thread[this.workers.Length]; GC.Collect(); DateTime startTime = DateTime.UtcNow; for (int i = 0; i < this.workers.Length; ++i) { threads[i] = new Thread(this.workers[i].Run); threads[i].Start(); } WorkerMonitor monitor = new WorkerMonitor(this.workers); monitor.StartBlocking(100); foreach (Thread t in threads) { t.Join(); } DateTime endTime = DateTime.UtcNow; var result = YcsbBenchmarkEnv.CombineOutputs( this.workers.Select(w => w.output).ToArray(), endTime - startTime); result.SuggestedThroughput = monitor.SuggestThroughput(); return(result); }
public void Run() { Console.WriteLine("Running TPCC workload..."); ForceGC(); this.startTicks = DateTime.UtcNow; Thread[] threads = new Thread[workerCount]; for (int i = 0; i < this.workerCount; i++) { threads[i] = new Thread(tpccWorkers[i].Run); threads[i].Start(); } WorkerMonitor monitor = new WorkerMonitor(this.tpccWorkers); monitor.StartBlocking(100); foreach (Thread thread in threads) { thread.Join(); } this.endTicks = DateTime.UtcNow; Console.WriteLine($"Monitor Suggested throughput: {monitor.SuggestThroughput()}"); }