コード例 #1
0
ファイル: LoadGenerator.cs プロジェクト: AlonAmsalem/NLoad
 public LoadGenerator(LoadTest loadTest, Type testType, LoadTestContext context, CancellationToken cancellationToken)
 {
     _loadTest = loadTest;
     _testType = testType;
     _context = context;
     _cancellationToken = cancellationToken;
 }
コード例 #2
0
 public void Initialize(LoadTest loadTest)
 {
     myLoadTest = loadTest;
     myLoadTest.LoadTestFinished += new EventHandler(myLoadTest_LoadTestFinished);
     myLoadTest.TestStarting += myLoadTest_TestStarting;
     myLoadTest.Context["testNumber"] = 0;
 }
コード例 #3
0
ファイル: LoadTestBuilder.cs プロジェクト: AlonAmsalem/NLoad
        public ILoadTest Build()
        {
            var loadTest = new LoadTest(_testType, _configuration, _cancellationToken);

            if (_handler != null)
            {
                loadTest.Heartbeat += _handler;
            }

            return loadTest;
        }
コード例 #4
0
        public LoadTestResultBuilder(LoadTest loadTest, List<LoadGenerator> loadGenerators, HeartRateMonitor heartRateMonitor)
        {
            if (loadTest == null)
            {
                throw new ArgumentNullException("loadTest");
            }

            if (loadGenerators == null)
            {
                throw new ArgumentNullException("loadGenerators");
            }

            if (heartRateMonitor == null)
            {
                throw new ArgumentNullException("heartRateMonitor");
            }

            _loadTest = loadTest;
            _loadGenerators = loadGenerators;
            _heartRateMonitor = heartRateMonitor;
        }
コード例 #5
0
        public DLT EditTest(string folderName, string testName)
        {
            LoadTest test = EditLoadTest(folderName, testName);

            return(new DLT(test));
        }
コード例 #6
0
 public DltGroupsAndWorkloadPage(LoadTest loadTest)
     : base(loadTest)
 {
 }
コード例 #7
0
        public IList <LoadTest> ConvertToDomain(IEnumerable <LoadTestViewModel> viewModels)
        {
            List <LoadTest>    loadtests = new List <LoadTest>();
            LoadTestingContext context   = new LoadTestingContext();

            foreach (LoadTestViewModel vm in viewModels)
            {
                Guid id = vm.Id;
                LoadTestParameters ltParams = new LoadTestParameters(vm.StartDateUtc, vm.UserCount, vm.DurationSec);
                Agent agent = context.Agents.FirstOrDefault(a => a.Location.City.Equals(vm.AgentCity, StringComparison.InvariantCultureIgnoreCase) &&
                                                            a.Location.Country.ToLower() == vm.AgentCountry.ToLower());
                if (agent == null)
                {
                    throw new ArgumentException("There is no agent with the given properties.");
                }

                Customer customer = context.Customers.FirstOrDefault(c => c.Name.Equals(vm.CustomerName, StringComparison.InvariantCultureIgnoreCase));
                if (customer == null)
                {
                    throw new ArgumentException("There is no customer with the given name.");
                }

                Guid?engineerId = null;
                if (!string.IsNullOrEmpty(vm.EngineerName))
                {
                    Engineer engineer = context.Engineers.FirstOrDefault(e => e.Name.Equals(vm.EngineerName, StringComparison.InvariantCultureIgnoreCase));
                    if (engineer == null)
                    {
                        throw new ArgumentException("There is no engineer with the given properties.");
                    }
                    engineerId = engineer.Id;
                }

                LoadTestType ltType = context.LoadTestTypes.FirstOrDefault(t => t.Description.ShortDescription.Equals(vm.LoadTestTypeShortDescription, StringComparison.InvariantCultureIgnoreCase));
                if (ltType == null)
                {
                    throw new ArgumentException("There is no load test type with the given properties.");
                }

                Project project = context.Projects.FirstOrDefault(p => p.Description.ShortDescription.ToLower() == vm.ProjectName.ToLower());
                if (project == null)
                {
                    throw new ArgumentException("There is no project with the given properties.");
                }

                Scenario scenario = context.Scenarios.FirstOrDefault(s => s.UriOne.Equals(vm.ScenarioUriOne, StringComparison.InvariantCultureIgnoreCase) &&
                                                                     s.UriTwo.Equals(vm.ScenarioUriTwo, StringComparison.InvariantCultureIgnoreCase) && s.UriThree.Equals(vm.ScenarioUriThree, StringComparison.InvariantCultureIgnoreCase));

                if (scenario == null)
                {
                    List <Uri> uris      = new List <Uri>();
                    Uri        firstUri  = string.IsNullOrEmpty(vm.ScenarioUriOne) ? null : new Uri(vm.ScenarioUriOne);
                    Uri        secondUri = string.IsNullOrEmpty(vm.ScenarioUriTwo) ? null : new Uri(vm.ScenarioUriTwo);
                    Uri        thirdUri  = string.IsNullOrEmpty(vm.ScenarioUriThree) ? null : new Uri(vm.ScenarioUriThree);

                    if (firstUri != null)
                    {
                        uris.Add(firstUri);
                    }
                    if (secondUri != null)
                    {
                        uris.Add(secondUri);
                    }
                    if (thirdUri != null)
                    {
                        uris.Add(thirdUri);
                    }

                    scenario = new Scenario(Guid.NewGuid(), uris);
                    context.Scenarios.Add(scenario);
                    context.SaveChanges();
                }

                LoadTest converted = new LoadTest(id, ltParams, agent.Id, customer.Id, engineerId, ltType.Id, project.Id, scenario.Id);
                loadtests.Add(converted);
            }

            return(loadtests);
        }
 public void Initialize(LoadTest loadTest)
 {
     _myLoadTest = loadTest;
     _myLoadTest.LoadTestStarting += new EventHandler(LoadTestStarting);
 }
コード例 #9
0
 public void Initialize(LoadTest loadTest)
 {
     m_loadTest            = loadTest;
     warmUpPlusRunDuration = m_loadTest.RunSettings.WarmupTime + m_loadTest.RunSettings.RunDuration;
 }
 public void Initialize(LoadTest loadTest)
 {
     _myLoadTest = loadTest;
     _myLoadTest.LoadTestStarting += new EventHandler(LoadTestStarting);
 }
コード例 #11
0
ファイル: DLT.cs プロジェクト: LSFramework/WEBUIautomation
 public DLT(LoadTest loadTest)
 {
     this._loadTest = loadTest;
     _workload      = new DltGroupsAndWorkloadPage(_loadTest);
     _summary       = new DltSummaryPage(_loadTest);
 }
コード例 #12
0
 public OnlineScreen(LoadTest loadTest)
 {
     this.LoadTest = loadTest;
     this.Url      = onlineTab.Url;
 }
コード例 #13
0
 public IReport Create(LoadTest loadTest)
 {
     return(new ProcessReport {
         LoadTest = loadTest
     });
 }
コード例 #14
0
 public IReport Create(LoadTest loadTest)
 {
     return(new GeneralReport {
         LoadTest = loadTest
     });
 }