Пример #1
0
        static void Main(string[] args)
        {
            if (args.Length < 2)
            {
                Console.WriteLine("USAGE: [CommandName] [ResultsFolder] [StatisticsFile]");
                return;
            }

            var resultsFolder  = new DirectoryInfo(args[0]);
            var statisticsFile = new FileInfo(args[1]);

            var collection = OpenCollection();

            var queries = new Dictionary <string, IQuery>()
            {
                { "MailsFilteredAndSortedByDate", new MailsFilteredAndSortedByDate(collection) },
                { "SentMailCountPerEmailAccount", new SentMailCountPerEmailAccount(collection) },
                { "AllReceivedMailsForAnEmailAccount", new AllReceivedMailsForAnEmailAccount(collection) },
                { "AllMailsWithWordInSubjectOrBody", new AllMailsWithWordInSubjectOrBody(collection) },
                { "ComplexMailQuery", new ComplexMailQuery(collection) },
            };

            PerformanceTest.StartStatisticsBatch("Structured MongoDB", statisticsFile);
            foreach (var query in queries)
            {
                PerformanceTest.Run(query.Key, resultsFolder, statisticsFile, query.Value);
            }
            PerformanceTest.EndStatisticsBatch(statisticsFile);
        }
Пример #2
0
        static void Main(string[] args)
        {
            if (args.Length < 2)
            {
                Console.WriteLine("USAGE: [CommandName] [ResultsFolder] [StatisticsFile]");
                return;
            }

            var resultsFolder  = new DirectoryInfo(args[0]);
            var statisticsFile = new FileInfo(args[1]);

            using (var sqlConnection = new SqlConnection(ConfigurationManager.ConnectionStrings["EnronSQL"].ConnectionString))
            {
                sqlConnection.Open();

                var queries = new Dictionary <string, IQuery>()
                {
                    { "MailsFilteredAndSortedByDate", new MailsFilteredAndSortedByDate(sqlConnection) },
                    { "SentMailCountPerEmailAccount", new SentMailCountPerEmailAccount(sqlConnection) },
                    { "AllReceivedMailsForAnEmailAccount", new AllReceivedMailsForAnEmailAccount(sqlConnection) },
                    { "AllMailsWithWordInSubjectOrBodyWithContains", new AllMailsWithWordInSubjectOrBodyWithContains(sqlConnection) },
                    { "AllMailsWithWordInSubjectOrBodyWithLike", new AllMailsWithWordInSubjectOrBodyWithLike(sqlConnection) },
                    { "ComplexMailQuery", new ComplexMailQuery(sqlConnection) },
                };

                PerformanceTest.StartStatisticsBatch("SQL Server", statisticsFile);

                foreach (var query in queries)
                {
                    PerformanceTest.Run(query.Key, resultsFolder, statisticsFile, query.Value);
                }
                PerformanceTest.EndStatisticsBatch(statisticsFile);
            }
        }