Beispiel #1
0
        private static void RunRegisteredBenchers()
        {
            Console.WriteLine("\nStarting benchmarks.");
            Console.WriteLine("====================================================================");

            foreach (var bencher in RegisteredBenchers)
            {
                OriginalController.DisplayBencherInfo(bencher);
                try
                {
                    OriginalController.RunBencher(bencher);
                }
                catch (Exception ex)
                {
                    BencherUtils.DisplayException(ex);
                }
            }

            Console.WriteLine("\nPerforming memory measurement runs.");
            Console.WriteLine("====================================================================");
            AppDomain.MonitoringIsEnabled = true;
            foreach (var bencher in RegisteredBenchers)
            {
                OriginalController.DisplayBencherInfo(bencher);
                try
                {
                    OriginalController.RunMemoryAnalysisForBencher(bencher);
                }
                catch (Exception ex)
                {
                    BencherUtils.DisplayException(ex);
                }
            }
        }
Beispiel #2
0
 public static void Main(string[] args)
 {
     try
     {
         BenchController.Run(args);
     }
     catch (Exception ex)
     {
         BencherUtils.DisplayException(ex);
     }
 }
        public static void DisplayException(Exception toDisplay)
        {
            if (toDisplay == null)
            {
                return;
            }

            Console.WriteLine("Exception caught of type: {0}", toDisplay.GetType().FullName);
            Console.WriteLine("Message: {0}", toDisplay.Message);
            Console.WriteLine("Stack trace:\n{0}", toDisplay.StackTrace);
            Console.WriteLine("Inner exception:");
            BencherUtils.DisplayException(toDisplay.InnerException);
        }
        public static void Main(string[] args)
        {
            try
            {
                // old runner
                OriginalController.Run(args);

                //DoBenchmarkDotNet();
            }
            catch (Exception ex)
            {
                BencherUtils.DisplayException(ex);
            }
        }
Beispiel #5
0
        private static void RunRegisteredBenchers()
        {
            Console.WriteLine("\nStarting benchmarks.");
            Console.WriteLine("====================================================================");

            foreach (var bencher in RegisteredBenchers)
            {
                OriginalController.DisplayBencherInfo(bencher);
                try
                {
                    OriginalController.RunBencher(bencher);
                }
                catch (Exception ex)
                {
                    BencherUtils.DisplayException(ex);
                }
            }
        }
Beispiel #6
0
        private static void RunRegisteredBenchers()
        {
            Console.WriteLine("\nStarting benchmarks.");
            Console.WriteLine("====================================================================");

            foreach (var bencher in RegisteredBenchers)
            {
                BenchController.DisplayBencherInfo(bencher);
                try
                {
                    BenchController.RunBencher(bencher);
                }
                catch (Exception ex)
                {
                    BencherUtils.DisplayException(ex);
                }
            }

            Console.WriteLine("\nPerforming memory measurement runs.");
            Console.WriteLine("====================================================================");
#if !NETCOREAPP
            AppDomain.MonitoringIsEnabled = true;
#endif
            foreach (var bencher in RegisteredBenchers)
            {
                BenchController.DisplayBencherInfo(bencher);
                bencher.CollectMemoryAllocated = true;
                try
                {
                    BenchController.RunMemoryAnalysisForBencher(bencher);
                }
                catch (Exception ex)
                {
                    BencherUtils.DisplayException(ex);
                }

                bencher.CollectMemoryAllocated = false;
            }
        }