Exemplo n.º 1
0
        // get all the configuration from the database
        public void Initialize()
        {
            // don't proceed if web driver is not present
            if (_webDriver == null)
            {
                var driverOption = new ChromeOptions();
                driverOption.AddArguments(new List <string>()
                {
                    "no-sandbox", "headless", "disable-gpu", "hide-scrollbars", "log-level=3", "start-maximize"
                });

                _webDriver = new ChromeDriver(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), driverOption);
                //_webDriver = new ChromeDriver(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location));
            }

            _target            = _dbContext.WebTargets.Where(x => x.ConstantName.Equals(GlobalContstants.NAME)).FirstOrDefault();
            _target.InnerLinks = _dbContext.InnerLinks.Where(x => x.ParentLink.Id == _target.Id).ToList();
        }
Exemplo n.º 2
0
        static void Main(string[] args)
        {
            try
            {
                Console.WriteLine("Making a single call to service to check availability...");
                //Manual call to log service to test plain performance
                DateTime d1 = DateTime.Now;
                WebTarget.DoRequest("Http://localhost:55044/api/log", JsonConvert.SerializeObject(new NLog.WebLog.WebTarget.LogMessage()
                {
                    Message        = "TEST MANUAL MESSAGE" + DateTime.Now,
                    SourceDate     = DateTime.Now,
                    Level          = "Error",
                    ApplicationKey = "{FF99EE02-1E88-44FF-B0A4-8DF8D2F3B742}"
                }));

                double ms = DateTime.Now.Subtract(d1).TotalMilliseconds;
                Console.WriteLine("Service call done in ms:" + ms);

                TestIterator it = new TestIterator();
                it.Instances.Add(new WlogTest());
                it.Instances.Add(new WLogBulkTest());
                it.Instances.Add(new FileTest());

                int[] iterationSize = new int[] { 1, 10, 100, 1000, 10000 };
                Console.WriteLine("#;Wlog;Wlog (bulk);File;");
                for (int i = 0; i < iterationSize.Length; i++)
                {
                    it.RepeatCount = iterationSize[i];
                    //Console.WriteLine("=> Starting benchmark with iterationSize " + it.RepeatCount);

                    it.DoTest();

                    Console.WriteLine("{0};{1};{2};{3}", it.RepeatCount, it.Instances[0].Avg, it.Instances[1].Avg, it.Instances[2].Avg);
                }
            }
            catch (Exception er)
            {
                Console.WriteLine(er.StackTrace);
            }


            Console.ReadKey();
        }
Exemplo n.º 3
0
 public void method_11(WebTarget A_0)
 {
     this.webTarget_0 = A_0;
 }