static internal YcsbWorker Generate(
            int txCount, int queryCount, YCSBDataGenerator gen, TransactionExecution txExec)
        {
            YcsbWorker workload = new YcsbWorker();

            workload.txs    = new List <YcsbTx>(txCount);
            workload.txExec = txExec;
            for (int i = 0; i < txCount; ++i)
            {
                workload.txs.Add(YcsbTx.Generate(queryCount, gen));
            }
            return(workload);
        }
        static BenchResult BenchmarkWithConfigOnce(YcsbConfig config)
        {
            // config.Print();
            // Console.WriteLine();
            var versionDb = YcsbHelper.MakeVersionDb(config.Concurrency);

            // Console.Write("loading data... ");
            LoadYcsbData(versionDb, config.RecordCount);
            // Console.WriteLine("done");
            var generator = new YCSBDataGenerator(
                config.RecordCount, config.ReadRatio,
                config.Dist, config.ZipfSkew);
            Func <TransactionExecution, YcsbWorker> workerFactory =
                txExec => YcsbWorker.Generate(
                    config.WorkerWorkload, config.QueriesPerTx, generator, txExec);
            // Console.Write("generate workload... ");
            var benchmark = new YcsbBenchmarkEnv(versionDb, workerFactory);
            // Console.WriteLine("done");
            var result = benchmark.Go();

            SingletonVersionDb.DestroyInstance();
            return(result);
        }