Esempio n. 1
0
        private void buttonStop_Click(object sender, EventArgs e)
        {
            Stopping = true;
            try
            {
                if (TestTimerMonitor.ThreadState == ThreadState.Running)
                {
                    TestTimerMonitor.Abort();
                }

                if (TestTimer.Enabled)
                {
                    TestTimer.Stop();
                }

                if (RunnerThread.ThreadState == ThreadState.Running)
                {
                    RunnerThread.Abort();
                }

                ChangeControlStatus(buttonRunTest, true);
                ChangeControlStatus(buttonStartDaemon, true);

                if (SeleniumChromeDriver != null)
                {
                    SeleniumChromeDriver.Quit();
                }
            }
            catch
            {
                // ignored
            }
        }
Esempio n. 2
0
        public static void Main(string[] args)
        {
            int nThreads = 2;
            int numIters = 200;

            string fname1 = "facet1";
            //string fname2 = "facet2"; // NOT USED
            FacetSpec fspec = new FacetSpec();

            fspec.ExpandSelection = (true);
            fspec.MaxCount        = (50);
            fspec.MinHitCount     = (1);
            fspec.OrderBy         = FacetSpec.FacetSortSpec.OrderHitsDesc;

            List <IFacetAccessible> list1 = new List <IFacetAccessible>(numSegs);

            for (int i = 0; i < numSegs; ++i)
            {
                list1.Add(BuildSubAccessible(fname1, i, fspec));
            }

            //List<FacetAccessible> list2 = new List<FacetAccessible>(numSegs);
            //for (int i = 0; i < numSegs; ++i)
            //{
            //    list2.add(BuildSubAccessible(fname2, i, fspec));
            //}

            AtomicLong timeCounter = new AtomicLong();

            Thread[]       threads      = new Thread[nThreads];
            RunnerThread[] threadStates = new RunnerThread[nThreads];
            for (int i = 0; i < threads.Length; ++i)
            {
                var threadState = new RunnerThread(timeCounter, numIters, fspec, list1);
                threadStates[i] = threadState;
                threads[i]      = new Thread(new ThreadStart(threadState.Run));
            }


            //		System.out.println("press key to start load test... ");
            //		{
            //			BufferedReader br = new BufferedReader(new InputStreamReader(
            //					System.in));
            //			int ch = br.read();
            //			char c = (char) ch;
            //		}
            foreach (Thread t in threads)
            {
                t.Start();
            }

            foreach (Thread t in threads)
            {
                t.Join();
            }

            Console.WriteLine("average time: " + timeCounter.Get() / numIters / nThreads + " ms");
        }
Esempio n. 3
0
        public SchedulerRegistry(int intervalInMinutes)
        {
            _actionThread = new RunnerThread();

            //Schedule(() => _actionThread.Execute(Probe.RunProbe))
            //    .ToRunEvery(intervalInMinutes).Minutes();

            Schedule(() => _actionThread.Execute(Probe.RunProbe))
                .ToRunNow().AndEvery(intervalInMinutes).Minutes();
        }
Esempio n. 4
0
        static void Time1(int[][] array)
        {
            int           iter     = array.Length;
            BigInt32Array bigArray = new BigInt32Array(max);

            Thread[]       threads      = new Thread[iter];
            RunnerThread[] threadStates = new RunnerThread[iter];

            for (int i = 0; i < iter; ++i)
            {
                threadStates[i] = new RunnerThread(array[i], bigArray);
                threads[i]      = new Thread(new ThreadStart(threadStates[i].Run));
            }

            foreach (Thread t in threads)
            {
                t.Start();
            }
        }
Esempio n. 5
0
        static void Time2(int[][] array)
        {
            int iter = array.Length;
            int[] bigArray = new int[max];
            Thread[] threads = new Thread[iter];
            RunnerThread[] threadStates = new RunnerThread[iter];

            for (int i = 0; i < iter; ++i)
            {
                threadStates[i] = new RunnerThread(array[i], bigArray);
                threads[i] = new Thread(new ThreadStart(threadStates[i].Run));
            }

            foreach (Thread t in threads)
            {
                t.Start();
            }
        }
        public static void Main(string[] args)
        {
            int nThreads = 2;
            int numIters = 200;

            string fname1 = "facet1";
            //string fname2 = "facet2"; // NOT USED
            FacetSpec fspec = new FacetSpec();
            fspec.ExpandSelection = (true);
            fspec.MaxCount = (50);
            fspec.MinHitCount = (1);
            fspec.OrderBy = FacetSpec.FacetSortSpec.OrderHitsDesc;

            List<IFacetAccessible> list1 = new List<IFacetAccessible>(numSegs);
            for (int i = 0; i < numSegs; ++i)
            {
                list1.Add(BuildSubAccessible(fname1, i, fspec));
            }

            //List<FacetAccessible> list2 = new List<FacetAccessible>(numSegs);
            //for (int i = 0; i < numSegs; ++i)
            //{
            //    list2.add(BuildSubAccessible(fname2, i, fspec));
            //}		
            
            AtomicLong timeCounter = new AtomicLong();
            Thread[] threads = new Thread[nThreads];
            RunnerThread[] threadStates = new RunnerThread[nThreads];
            for (int i = 0; i < threads.Length; ++i)
            {
                var threadState = new RunnerThread(timeCounter, numIters, fspec, list1);
                threadStates[i] = threadState;
                threads[i] = new Thread(new ThreadStart(threadState.Run));
            }


            //		System.out.println("press key to start load test... ");
            //		{
            //			BufferedReader br = new BufferedReader(new InputStreamReader(
            //					System.in));
            //			int ch = br.read();
            //			char c = (char) ch;
            //		}
            foreach (Thread t in threads)
            {
                t.Start();
            }

            foreach (Thread t in threads)
            {
                t.Join();
            }

            Console.WriteLine("average time: " + timeCounter.Get() / numIters / nThreads + " ms");
        }