Пример #1
0
        public AClient(string clientName, string password, BenchmarkServiceClient benchmarkService)
        {
            Console.WriteLine(clientName + " started...");

            _user = new User(clientName, password);
            _benchmarkService = benchmarkService;

            _jobs = new Queue<Job>();
            _jobsAdded = 0;
            _jobsDone = 0;
            _random = new Random();
        }
Пример #2
0
        static void Main(string[] args)
        {
            using (var client = new BenchmarkServiceClient())
            {
                _timer.Elapsed += (s, e) =>
                {
                    var lastMinuteCallCount = Interlocked.Exchange(ref _lastMinuteCallCount, 0);
                    Console.WriteLine($"{DateTime.Now} -- {lastMinuteCallCount} ops/sec");
                };
                _timer.Start();

                for (int i = 0; i < CALL_COUNT; i++)
                {
                    client.Proxy.Operation(new ServiceRequest { Id = 10 });
                    Interlocked.Increment(ref _lastMinuteCallCount);
                }
            }
        }
Пример #3
0
        /*******************************
        * Clients name not implemented yet
        *********************************/
        static void Main(string[] args)
        {
            using (BenchmarkServiceClient benchmarkService = new BenchmarkServiceClient())
            {
                AClient ac;

                if (args == null || args.Count() != 2)
                {
                    ac = new AClient("ArtificialClient", "secretPassword :)", benchmarkService);
                    ac.StartUp();
                    ac.KeepBenchmarkLoaded();
                }
                else
                {
                    ac = new AClient(args[0], args[1], benchmarkService);
                    ac.StartUp();
                }
            }
        }