private void Run(BenchmarkInfo benchmarkInfo)
        {
            switch (Stage)
            {
            case StageEnum.Build:
                benchmarkInfo.BuildSchema();
                break;

            case StageEnum.TypicalExecution:
                _documentExecuter.ExecuteAsync(o =>
                {
                    o.Schema = benchmarkInfo.Schema;
                    o.Query  = benchmarkInfo.Query;
                    o.Inputs = benchmarkInfo.InputsString?.ToInputs();
                }).GetAwaiter().GetResult();
                break;

            case StageEnum.Parse:
                benchmarkInfo.Parse();
                break;

            case StageEnum.Convert:
                benchmarkInfo.Convert();
                break;

            case StageEnum.Validate:
                benchmarkInfo.Validate();
                break;

            case StageEnum.DeserializeVars:
                benchmarkInfo.DeserializeInputs();
                break;

            case StageEnum.ParseVariables:
                benchmarkInfo.ParseVariables();
                break;

            case StageEnum.Execute:
                benchmarkInfo.Execute();
                break;

            case StageEnum.Serialize:
                benchmarkInfo.Serialize();
                break;

            default:
                throw new InvalidOperationException();
            }
        }
示例#2
0
        private void Run(BenchmarkInfo benchmarkInfo)
        {
            switch (Stage)
            {
            case StageEnum.Build:
                benchmarkInfo.BuildSchema();
                break;

            case StageEnum.Parse:
                benchmarkInfo.Parse();
                break;

            case StageEnum.Convert:
                benchmarkInfo.Convert();
                break;

            case StageEnum.Validate:
                benchmarkInfo.Validate();
                break;

            case StageEnum.DeserializeVars:
                benchmarkInfo.DeserializeInputs();
                break;

            case StageEnum.ParseVariables:
                benchmarkInfo.ParseVariables();
                break;

            case StageEnum.Execute:
                benchmarkInfo.Execute();
                break;

            case StageEnum.Serialize:
                benchmarkInfo.Serialize();
                break;

            default:
                throw new InvalidOperationException();
            }
        }