Beispiel #1
0
        public long RunScenario(Scenario model)
        {
            log.Debug(Debugging.HatcheryService_Invoked);

            var scenarioExecution = new ScenarioExecution
            {
                ScenarioId = model.Id,
                Started    = DateTime.UtcNow,
                Status     = ExecutionStatus.Created
            };

            executionRepository.Add(scenarioExecution);

            LoadTestScenario scenario = Load(model);

            scenario.ExecutionId = scenarioExecution.Id;

            using (var wcf = GetWcfConnectionToDrone())
            {
                log.Debug(Debugging.HatcheryService_Request);
                wcf.Channel.StartLoadTest(scenario);
                log.Debug(Debugging.HatcheryService_Response);
            }

            return(scenarioExecution.Id);
        }
Beispiel #2
0
        public ActionResult Scenario(long id)
        {
            ScenarioExecution      execution     = executionService.GetById(id);
            IEnumerable <Snapshot> snapshots     = snapshotService.GetByScenarioExecution(execution);
            IList <SnapshotModel>  snapshotModel = mapper.Map <IEnumerable <Snapshot>, IList <SnapshotModel> >(snapshots);

            var reportModel = new ReportModel
            {
                ExecutionId = id,
                Snapshots   = snapshotModel,
                Status      = execution.Status.ToString()
            };
            var json  = JsonConvert.SerializeObject(reportModel);
            var model = new ReportViewModel
            {
                Report = reportModel,
                Json   = new MvcHtmlString(json)
            };

            return(View(model));
        }
Beispiel #3
0
 public IEnumerable <Snapshot> GetByScenarioExecution(ScenarioExecution execution)
 {
     return(GetByScenarioExecutionId(execution.Id));
 }
Beispiel #4
0
 public void Update(ScenarioExecution scenarioExecution)
 {
     connection.Update(scenarioExecution);
 }
Beispiel #5
0
 public ScenarioExecution Add(ScenarioExecution scenarioExecution)
 {
     connection.Insert(scenarioExecution);
     return(scenarioExecution);
 }
Beispiel #6
0
 public ScenarioExecution Add(ScenarioExecution scenarioExecution)
 {
     executionRepository.Add(scenarioExecution);
     return(scenarioExecution);
 }
Beispiel #7
0
 public void Update(ScenarioExecution scenarioExecution)
 {
     executionRepository.Update(scenarioExecution);
 }