public void Using_the_load_generator_should_share_the_load()
		{
			Fiber thread1 = new ThreadFiber();
			thread1.Add(() => {
					var generator1 = new LoadGenerator<FirstCommand, FirstResponse>();
					generator1.Run(RemoteBus, LocalBus.Endpoint, Instances.Values.Select(x => x.DataBus), 100, x => new FirstCommand(x));
				});

			thread1.Shutdown(3.Minutes());
		}
Exemplo n.º 2
0
        public void Using_the_load_generator_should_share_the_load()
        {
            Fiber thread1 = new ThreadFiber();

            thread1.Add(() => {
                var generator1 = new LoadGenerator <FirstCommand, FirstResponse>();
                generator1.Run(RemoteBus, LocalBus.Endpoint, Instances.Values.Select(x => x.DataBus), 100, x => new FirstCommand(x));
            });

            thread1.Shutdown(3.Minutes());
        }
Exemplo n.º 3
0
        public void Node_a_should_recieve_all_the_work()
        {
            var       generator = new LoadGenerator <FirstCommand, FirstResponse>();
            const int count     = 100;

            generator.Run(RemoteBus, count, x => new FirstCommand(x));

            Dictionary <Uri, int> results = generator.GetWorkerLoad();

            Assert.That(results.Sum(x => x.Value), Is.EqualTo(count));
            Assert.That(results[_nodes["A"]], Is.EqualTo(count));
        }
Exemplo n.º 4
0
        public async Task Generator(GeneratorArgs args)
        {
            // Load request generator and apply plugin args
            IRequestGenerator     requestGenerator = new LoadGenerator().Execute(args, PluginDir());
            IEnumerable <Request> requests         = requestGenerator.Run();

            HttpRequestTree requestTree = new HttpRequestTree()
            {
                Requests = requests, Description = requestGenerator.Name
            };

            await RunRequestTreeAgent(requestTree, args.Concurrency, requestGenerator.ComparerFactoryOverride, requestGenerator.Name, args.OutputFilePath);
        }
Exemplo n.º 5
0
        public void Using_the_load_generator_should_share_the_load()
        {
            var       generator = new LoadGenerator <FirstCommand, FirstResponse>();
            const int count     = 100;

            generator.Run(RemoteBus, count, x => new FirstCommand(x));

            Dictionary <Uri, int> results = generator.GetWorkerLoad();

            Assert.That(results.Sum(x => x.Value), Is.EqualTo(count));
            results.ToList().ForEach(x =>
                                     Assert.That(x.Value, Is.GreaterThan(0).And.LessThanOrEqualTo(count),
                                                 string.Format("{0} did not consume between 0 and {1}",
                                                               x.Key.ToString(), count)));
        }
Exemplo n.º 6
0
		public void Using_the_load_generator_should_share_the_load()
		{
			var generator = new LoadGenerator<FirstCommand, FirstResponse>();

			generator.Run(RemoteBus, 100, x => new FirstCommand(x));
		}
Exemplo n.º 7
0
        public void Using_the_load_generator_should_share_the_load()
        {
            var generator = new LoadGenerator <FirstCommand, FirstResponse>();

            generator.Run(RemoteBus, 100, x => new FirstCommand(x));
        }
Exemplo n.º 8
0
        public void Using_the_load_generator_should_share_the_load()
        {
            var generator = new LoadGenerator <FirstCommand, FirstResponse>();

            generator.Run(RemoteBus, LocalBus.Endpoint, Instances.Values.Select(x => x.DataBus), 100, x => new FirstCommand(x));
        }
Exemplo n.º 9
0
		public void Node_a_should_recieve_all_the_work()
		{
			var generator = new LoadGenerator<FirstCommand, FirstResponse>();
			const int count = 100;

			generator.Run(RemoteBus, count, x => new FirstCommand(x));

			Dictionary<Uri, int> results = generator.GetWorkerLoad();

			Assert.That(results.Sum(x => x.Value), Is.EqualTo(count));
			Assert.That(results[_nodes["A"]], Is.EqualTo(count));
		}
Exemplo n.º 10
0
		public void Using_the_load_generator_should_share_the_load()
		{
			var generator = new LoadGenerator<FirstCommand, FirstResponse>();
			const int count = 100;

			generator.Run(RemoteBus, count, x => new FirstCommand(x));

			Dictionary<Uri, int> results = generator.GetWorkerLoad();

			Assert.That(results.Sum(x => x.Value), Is.EqualTo(count));
			results.ToList().ForEach(x =>
			                         Assert.That(x.Value, Is.GreaterThan(0).And.LessThanOrEqualTo(count),
			                         	string.Format("{0} did not consume between 0 and {1}",
			                         		x.Key.ToString(), count)));
		}
Exemplo n.º 11
0
		public void Using_the_load_generator_should_share_the_load()
		{
			var generator = new LoadGenerator<FirstCommand, FirstResponse>();

			generator.Run(RemoteBus, LocalBus.Endpoint, Instances.Values.Select(x => x.DataBus), 100, x => new FirstCommand(x));
		}