示例#1
0
        public string ProcessBenchmark(CollectorCommand command)
        {
            try
            {
                var benchmark = new BenchmarkTest(command.ThreadsCount);
                benchmark.AddLoadTestFactory(CreateReaderTest(ReadJsonFile(command.FileName), command.TableName,
                                                              command.HashFileName, command.CountReplics, command.PageSize));

                benchmark.Run();
            }
            catch (Exception e)
            {
                return(e.Message);
            }

            return(string.Empty);
        }
示例#2
0
        public string ProcessBenchmark(WriterCommand command)
        {
            try
            {
                var benchmark = new BenchmarkTest(command.ThreadsCount, command.DataCount);

                var testTypes = ParseTestTypes(command.TestType,
                                               () => new DbWriterAdapter(command.Host, command.Port, command.TableName),
                                               command.Generator, new KeyGenerator(command.KeyRange));
                foreach (var func in testTypes)
                {
                    benchmark.AddLoadTestFactory(func);
                }

                benchmark.Run();
            }
            catch (Exception e)
            {
                return(e.Message);
            }

            return(string.Empty);
        }