Ejemplo n.º 1
0
        public static void Main(string[] args)
        {
            var param = new Param
            {
                EndPoint = "http://localhost:59927/api/values",
                Rampup = 2000,
                Time = 20000,
                ThreadUsers = 50
            };

            Rest.Main(param);
            Rest.ExtractResult().ToPrint();
            Console.ReadKey();
        }
Ejemplo n.º 2
0
        public static void Main(Param param)
        {
            var time = new Stopwatch();
            var perdiodicTask = PeriodicTaskFactory.Start(() =>
            {
                Samples = new SampleRequest();
                time.Start();
                Samples.IsSucess = RunAsyncIsFaulted(new Uri(param.EndPoint)) == false;
                time.Stop();
                Samples.Duration = time.ElapsedMilliseconds;
                time.Reset();
                Results.Samples.Add(Samples);
            }, param.Rampup, maxIterations: param.ThreadUsers, duration: param.Time);

            perdiodicTask.ContinueWith(_ => { Console.WriteLine("Sampling Finished!"); }).Wait();
            
        }