public JsonResult GetLoadTestBasedOnName(string loadTestName, int page = 1, int itemsPerPage = 20) { long TotalRecord = 0; var Results = LoadTestService.GetLoadTestBasedOnName(loadTestName, itemsPerPage, (page - 1) * itemsPerPage, out TotalRecord); return(Json(new { data = Results, TotalRecord = TotalRecord }, JsonRequestBehavior.AllowGet)); }
public void Execute(string resultsFilePath) { InitializeTestScenarios(); InitializeTestScenarioMixtureDeterminers(); var loadTestExecutionWatch = Stopwatch.StartNew(); var loadTestRunResults = new LoadTestRunResults(); var loadTestService = new LoadTestService(); var testScenarioMixtureDeterminer = _testScenarioMixtureDeterminer.GetTestScenarioMixtureDeterminer(); if (Settings.LoadTestType == LoadTestType.ExecuteForTime) { loadTestService.ExecuteForTime(Settings.NumberOfProcesses, Settings.PauseBetweenStartSeconds, Settings.SecondsToBeExecuted, ExecuteTestScenario); } else if (Settings.LoadTestType == LoadTestType.ExecuteNumberOfTimes) { loadTestService.ExecuteNumberOfTimes(Settings.NumberOfProcesses, Settings.PauseBetweenStartSeconds, Settings.TimesToBeExecuted, ExecuteTestScenario); } void ExecuteTestScenario() { var testScenarioResults = new TestScenarioResults(); var testScenario = testScenarioMixtureDeterminer.GetTestScenario(); if (loadTestRunResults.TestScenarioResults.ContainsKey(testScenario.TestName)) { testScenarioResults = loadTestRunResults.TestScenarioResults[testScenario.TestName]; } else { testScenarioResults.TestName = testScenario.TestName; loadTestRunResults.TestScenarioResults.GetOrAdd(testScenario.TestName, testScenarioResults); } _testScenarioExecutor.Execute(testScenario, testScenarioResults, Settings.ShouldExecuteRecordedRequestPauses, Settings.IgnoreUrlRequestsPatterns); } loadTestExecutionWatch.Stop(); loadTestRunResults.TotalExecutionTime = loadTestExecutionWatch.Elapsed; var loadTestReportGenerator = new LoadTestReportGenerator(); loadTestReportGenerator.GenerateReport(loadTestRunResults, resultsFilePath); }
public ActionResult DetailedErrorMessage(int LoadTestRunId, string SubType) { var entityLoadTestMessages = LoadTestService.GetDetailedErrorMessage(LoadTestRunId, SubType); return(Json(entityLoadTestMessages, JsonRequestBehavior.AllowGet)); }