public static void Main(string[] args) { BenchmarkConfigs configs = BenchmarkConfigs.Parse(args); BenchmarkWithZipfConfigs(configs); Pause(); }
static void BenchmarkWithZipfConfigs(BenchmarkConfigs configs) { foreach (YcsbConfig config in configs.GetConfigs()) { config.PrintSimple(); BenchmarkWithConfig(configs.Repeat, config); GC.Collect(); } }
static public BenchmarkConfigs Parse(string[] args) { BenchmarkConfigs config = new BenchmarkConfigs(); for (int i = 0; i < args.Length; ++i) { switch (args[i]) { case "-u": case "--uniform": config.Dist = Distribution.Uniform; break; case "-r": case "--records": config.RecordCount = Convert.ToInt32(args[++i]); break; case "-w": case "--workload": config.WorkerWorkload = Convert.ToInt32(args[++i]); break; case "-c": case "--concurrency": config.Concurrencies = args[++i].Split(',').Select(s => Convert.ToInt32(s)).ToArray(); break; case "-s": case "--skew": config.ZipfSkews = args[++i].Split(',').Select(s => Convert.ToDouble(s)).ToArray(); break; case "-rr": case "--read-ratio": config.ReadRatios = args[++i].Split(',').Select(s => Convert.ToDouble(s)).ToArray(); break; case "-q": case "--query": config.QueryPerTx = Convert.ToInt32(args[++i]); break; case "--repeat": config.Repeat = Convert.ToInt32(args[++i]); break; default: throw new ArgumentException($"unknown option {args[i]}"); } } return(config); }