Example #1
0
        public void Start(PerformanceSuite.PerfTestContext ctxt, IPerformanceTestRunnerListener runListener)
        {
            m_endAt = DateTime.Now.Add(m_runFor);
            m_threads.Clear();
            m_threads = new List <ActionCompleteThread>();
            for (var i = 01; i < m_numThreads; i++)
            {
                var threadListener = new TestListenerAdapter(runListener, ctxt);
                var threadAction   = NewInvokeTestAction(threadListener);
                m_threads.Add(new ActionCompleteThread(threadAction.Invoke).Where(t => t.Priority = m_threadPriority));
            }

            m_threads.ForEach(t => t.Start());
            //wait for runners to complete
            while (DateTime.Now < m_endAt && m_threads.Any(t => !t.Completed))
            {
                Thread.Sleep(1000);
            }
            m_threads.ForEach(t => t.Abort());
        }
Example #2
0
 public TestListenerAdapter(IPerformanceTestRunnerListener listener, PerformanceSuite.PerfTestContext ctxt)
 {
     m_listener  = listener;
     m_agentId   = ctxt.AgentId;
     m_machineId = ctxt.MachineId;
 }
Example #3
0
        public void Start(PerformanceSuite.PerfTestContext ctxt, IPerformanceTestRunnerListener runListener)
        {
            var actions = TestsToParallelActions(m_tests, runListener);

            ParallelActionInvoker.InvokeAllWaitingForCompletion(actions, m_runTimeout, m_threadPriority);
        }