Example #1
0
        private void WriteServerCalledByLoadBalancer()
        {
            var server1 = BasicLoadBalancer.GetLoadBalancer();

            Console.WriteLine($"{server1.Server} :: Thread Id :: {Thread.CurrentThread.ManagedThreadId}");
            Thread.Sleep(1000);
        }
 public void BasicLoadBalancerCreationTest()
 {
     for (var i = 0; i < 6; i++)
     {
         var server1 = BasicLoadBalancer.GetLoadBalancer();
         Console.WriteLine(server1.Server);
     }
 }
Example #3
0
        public void BasicLoadBalancerCreationSingleThreadTest()
        {
            var stopWatch = new Stopwatch();

            stopWatch.Start();
            for (var i = 0; i < 3; i++)
            {
                var server1 = BasicLoadBalancer.GetLoadBalancer();
                Console.WriteLine($"{server1.Server} :: Thread Id :: {Thread.CurrentThread.ManagedThreadId}");
                Thread.Sleep(1000);
            }
            stopWatch.Stop();
            Console.WriteLine($"Total execution :: {stopWatch.Elapsed}");
        }