Exemple #1
0
        public void New()
        {
            if (!QuerySaveChanges())
            {
                return;
            }

            benchmark      = new Benchmark.Benchmark();
            benchmark.Name = "New benchmark";
            benchmarkTreeView.Benchmark     = benchmark;
            benchmarkObjectEditor.Benchmark = benchmark;
            benchmark.Changed += Benchmark_Changed;

            benchmarkTreeView.SelectedBenchmarkObject = benchmark;
            benchmarkTreeView.GetTreeNode(benchmark).Expand();
        }
Exemple #2
0
        private void OpenBenchmarkFileName(string fileName)
        {
            Cursor = Cursors.WaitCursor;

            benchmark = new Benchmark.Benchmark();
            benchmark.Load(fileName);

            benchmarkTreeView.Benchmark     = benchmark;
            benchmarkObjectEditor.Benchmark = benchmark;

            benchmarkTreeView.SelectedBenchmarkObject = benchmark;
            benchmarkTreeView.GetTreeNode(benchmark).Expand();

            benchmark.Changed += Benchmark_Changed;

            this.fileName = fileName;

            changed = false;
            UpdateUI();
            Cursor = Cursors.Default;
        }
Exemple #3
0
        private static void MergeTests()
        {
            Benchmark.Benchmark msSql = new Benchmark.Benchmark();
            msSql.Load(@"C:\Users\Petr\source\repos\QueryOptimizerBenchmark\benchmark_runner\ms_sql.xml");

            Benchmark.Benchmark oracle = new Benchmark.Benchmark();
            oracle.Load(@"C:\Users\Petr\source\repos\QueryOptimizerBenchmark\benchmark_runner\oracle.xml");

            Benchmark.Benchmark postgreSql = new Benchmark.Benchmark();
            postgreSql.Load(@"C:\Users\Petr\source\repos\QueryOptimizerBenchmark\benchmark_runner\postgresql.xml");

            Benchmark.Benchmark merged = new Benchmark.Benchmark();
            if (msSql.TestGroups.Count > oracle.TestGroups.Count ||
                msSql.TestGroups.Count > postgreSql.TestGroups.Count)
            {
                return;
            }

            MergeScript(msSql.InitScript, oracle.InitScript, postgreSql.InitScript);
            MergeScript(msSql.CleanUpScript, oracle.CleanUpScript, postgreSql.CleanUpScript);

            for (int group = 0; group < msSql.TestGroups.Count; group++)
            {
                Benchmark.TestGroup msSqlGroup    = msSql.TestGroups[group];
                Benchmark.TestGroup oracleGroup   = oracle.TestGroups[group];
                Benchmark.TestGroup postgresGroup = postgreSql.TestGroups[group];

                if (msSqlGroup.Configurations.Count > oracleGroup.Configurations.Count ||
                    msSqlGroup.Configurations.Count > postgresGroup.Configurations.Count)
                {
                    return;
                }

                if (msSqlGroup.Tests.Count > oracleGroup.Tests.Count ||
                    msSqlGroup.Tests.Count > postgresGroup.Tests.Count)
                {
                    //return;
                }

                for (int config = 0; config < msSqlGroup.Configurations.Count; config++)
                {
                    Benchmark.Configuration msSqlConfiguration    = msSqlGroup.Configurations[config];
                    Benchmark.Configuration oracleConfiguration   = oracleGroup.Configurations[config];
                    Benchmark.Configuration postgresConfiguration = postgresGroup.Configurations[config];

                    MergeScript(msSqlConfiguration.InitScript, oracleConfiguration.InitScript, postgresConfiguration.InitScript);
                    MergeScript(msSqlConfiguration.CleanUpScript, oracleConfiguration.CleanUpScript, postgresConfiguration.CleanUpScript);
                }

                for (int test = 0; test < msSqlGroup.Tests.Count && test < oracleGroup.Tests.Count && test < postgresGroup.Tests.Count; test++)
                {
                    Benchmark.PlanEquivalenceTest msSqlTest    = (Benchmark.PlanEquivalenceTest)msSqlGroup.Tests[test];
                    Benchmark.PlanEquivalenceTest oracleTest   = (Benchmark.PlanEquivalenceTest)oracleGroup.Tests[test];
                    Benchmark.PlanEquivalenceTest postgresTest = (Benchmark.PlanEquivalenceTest)postgresGroup.Tests[test];

                    for (int variant = 0; variant < msSqlTest.Variants.Count && variant < oracleTest.Variants.Count && variant < postgresTest.Variants.Count; variant++)
                    {
                        Benchmark.QueryVariant msSqlVariant    = msSqlTest.Variants[variant];
                        Benchmark.QueryVariant oracleVariant   = oracleTest.Variants[variant];
                        Benchmark.QueryVariant postgresVariant = postgresTest.Variants[variant];

                        MergeVariant(msSqlVariant, oracleVariant, postgresVariant);
                    }
                }
            }

            msSql.Save(@"C:\users\petr\desktop\merged.xml");

            MessageBox.Show("OK");
        }