コード例 #1
0
ファイル: Program.cs プロジェクト: zhangzihan/FASTER
        public static void Main(string[] args)
        {
            ParserResult <Options> result = Parser.Default.ParseArguments <Options>(args);

            if (result.Tag == ParserResultType.NotParsed)
            {
                return;
            }

            var           options = result.MapResult(o => o, xs => new Options());
            BenchmarkType b       = (BenchmarkType)options.Benchmark;

            if (b == BenchmarkType.Ycsb)
            {
                var test = new FASTER_YcsbBenchmark(options.ThreadCount, options.NumaStyle, options.Distribution, options.ReadPercent, options.Backup);
                test.Run();
            }
            else if (b == BenchmarkType.SpanByte)
            {
                var test = new FasterSpanByteYcsbBenchmark(options.ThreadCount, options.NumaStyle, options.Distribution, options.ReadPercent, options.Backup);
                test.Run();
            }
            else if (b == BenchmarkType.ConcurrentDictionaryYcsb)
            {
                var test = new ConcurrentDictionary_YcsbBenchmark(options.ThreadCount, options.NumaStyle, options.Distribution, options.ReadPercent);
                test.Run();
            }
        }
コード例 #2
0
ファイル: Program.cs プロジェクト: microsoft/FASTER
        public static void Main(string[] args)
        {
            ParserResult <Options> result = Parser.Default.ParseArguments <Options>(args);

            if (result.Tag == ParserResultType.NotParsed)
            {
                return;
            }

            var           options = result.MapResult(o => o, xs => new Options());
            BenchmarkType b       = (BenchmarkType)options.Benchmark;

            if (b == BenchmarkType.Ycsb)
            {
                var test = new FASTER_YcsbBenchmark(options.ThreadCount, options.NumaStyle, options.Distribution, options.ReadPercent, options.IpAddress, options.Port, options.SkipSetup);
                test.Run();
            }
        }
コード例 #3
0
        public static void Main(string[] args)
        {
            ParserResult <Options> result = Parser.Default.ParseArguments <Options>(args);

            if (result.Tag == ParserResultType.NotParsed)
            {
                return;
            }

            result.WithNotParsed(errs =>
            {
                var helpText = HelpText.AutoBuild(result, h =>
                {
                    return(HelpText.DefaultParsingErrorsHandler(result, h));
                }, e =>
                {
                    return(e);
                });
                Console.WriteLine(helpText);
            });

            var           options = result.MapResult(o => o, xs => new Options());
            BenchmarkType b       = (BenchmarkType)options.Benchmark;

            Console.WriteLine("Benchmark Arguments:");
            Console.WriteLine("  Benchmark = {0}", options.Benchmark);
            Console.WriteLine("  Number of threads = {0}", options.ThreadCount);
            Console.WriteLine("  Thread NUMA mapping = {0}", options.NumaStyle);
            Console.WriteLine("  Read percent = {0}", options.ReadPercent);
            Console.WriteLine("  Distribution = {0}", options.Distribution);


            if (b == BenchmarkType.Ycsb)
            {
                var test = new FASTER_YcsbBenchmark(options.ThreadCount, options.NumaStyle, options.Distribution, options.ReadPercent);
                test.Run();
            }
        }
コード例 #4
0
ファイル: Program.cs プロジェクト: tli2/FASTER
        const int kTrimResultCount = 3; // Use some high value like int.MaxValue to disable

        public static void Main(string[] args)
        {
            TestLoader testLoader = new();

            if (!testLoader.Parse(args))
            {
                return;
            }

            TestStats testStats = new(testLoader.Options);

            testLoader.LoadData();
            var options = testLoader.Options;   // shortcut

            for (var iter = 0; iter < options.IterationCount; ++iter)
            {
                Console.WriteLine();
                if (options.IterationCount > 1)
                {
                    Console.WriteLine($"Iteration {iter + 1} of {options.IterationCount}");
                }

                switch (testLoader.BenchmarkType)
                {
                case BenchmarkType.Ycsb:
                    var yTest = new FASTER_YcsbBenchmark(testLoader.init_keys, testLoader.txn_keys, testLoader);
                    testStats.AddResult(yTest.Run(testLoader));
                    yTest.Dispose();
                    break;

                case BenchmarkType.SpanByte:
                    var sTest = new FasterSpanByteYcsbBenchmark(testLoader.init_span_keys, testLoader.txn_span_keys, testLoader);
                    testStats.AddResult(sTest.Run(testLoader));
                    sTest.Dispose();
                    break;

                case BenchmarkType.ConcurrentDictionaryYcsb:
                    var cTest = new ConcurrentDictionary_YcsbBenchmark(testLoader.init_keys, testLoader.txn_keys, testLoader);
                    testStats.AddResult(cTest.Run(testLoader));
                    cTest.Dispose();
                    break;

                default:
                    throw new ApplicationException("Unknown benchmark type");
                }

                if (options.IterationCount > 1)
                {
                    testStats.ShowAllStats(AggregateType.Running);
                    if (iter < options.IterationCount - 1)
                    {
                        GC.Collect();
                        GC.WaitForFullGCComplete();
                        Thread.Sleep(1000);
                    }
                }
            }

            Console.WriteLine();
            testStats.ShowAllStats(AggregateType.FinalFull);
            if (options.IterationCount >= kTrimResultCount)
            {
                testStats.ShowTrimmedStats();
            }
        }