示例#1
0
 private void Init()
 {
     variables              = null;
     previousResult         = null;
     currentSampler         = null;
     previousSampler        = null;
     samplingStarted        = false;
     threadNum              = 0;
     nThread                = null;
     isReinitSubControllers = false;
     samplerContext.Clear();
     restartNextLoop = false;
 }
示例#2
0
        public void Start(int groupCount, ListenerNotifier notifier, OrderedHashTree threadGroupTree, StandardEngine engine)
        {
            int threadNumber = GetThreadsNumber();
            // TODO : log

            Int32           now     = System.DateTime.Now.Millisecond;
            NetMeterContext context = NetMeterContextManager.GetContext();

            for (int i = 0; running && i < threadNumber; i++)
            {
                NetMeterThread nmThread  = CreateThread(groupCount, notifier, threadGroupTree, engine, i, context);
                Thread         newThread = new Thread(nmThread.Run);
                RegisterStartedThread(nmThread, newThread);
                newThread.Start();
            }

            // TODO : log
        }
示例#3
0
        private NetMeterThread CreateThread(int groupCount, ListenerNotifier notifier, OrderedHashTree threadGroupTree,
                                            StandardEngine engine, int i, NetMeterContext context)
        {
            String         groupName = GetName();
            NetMeterThread nmThread  = new NetMeterThread(CloneTree(threadGroupTree), this, notifier);

            nmThread.SetThreadNum(i);
            nmThread.SetThreadGroup(this);
            nmThread.SetInitialContext(context);
            String threadName = groupName + " " + (groupCount) + "-" + (i + 1);

            nmThread.SetThreadName(threadName);
            nmThread.SetEngine(engine);
            nmThread.SetOnErrorStopTest(GetOnErrorStopTest());
            nmThread.SetOnErrorStopTestNow(GetOnErrorStopTestNow());
            nmThread.SetOnErrorStopThread(GetOnErrorStopThread());
            nmThread.SetOnErrorStartNextLoop(GetOnErrorStartNextLoop());
            return(nmThread);
        }
示例#4
0
 private void Init()
 {
     variables = null;
     previousResult = null;
     currentSampler = null;
     previousSampler = null;
     samplingStarted = false;
     threadNum = 0;
     nThread = null;
     isReinitSubControllers = false;
     samplerContext.Clear();
     restartNextLoop = false;
 }
示例#5
0
 public void SetThread(NetMeterThread nThread)
 {
     this.nThread = nThread;
 }
示例#6
0
 /**
  * Register Thread when it starts
  * @param jMeterThread {@link JMeterThread}
  * @param newThread Thread
  */
 private void RegisterStartedThread(NetMeterThread nmThread, Thread newThread)
 {
     allThreads.TryAdd(nmThread, newThread);
 }
示例#7
0
 public void SetThread(NetMeterThread nThread)
 {
     this.nThread = nThread;
 }
示例#8
0
 private NetMeterThread CreateThread(int groupCount, ListenerNotifier notifier, OrderedHashTree threadGroupTree,
         StandardEngine engine, int i, NetMeterContext context)
 {
     String groupName = GetName();
     NetMeterThread nmThread = new NetMeterThread(CloneTree(threadGroupTree), this, notifier);
     nmThread.SetThreadNum(i);
     nmThread.SetThreadGroup(this);
     nmThread.SetInitialContext(context);
     String threadName = groupName + " " + (groupCount) + "-" + (i + 1);
     nmThread.SetThreadName(threadName);
     nmThread.SetEngine(engine);
     nmThread.SetOnErrorStopTest(GetOnErrorStopTest());
     nmThread.SetOnErrorStopTestNow(GetOnErrorStopTestNow());
     nmThread.SetOnErrorStopThread(GetOnErrorStopThread());
     nmThread.SetOnErrorStartNextLoop(GetOnErrorStartNextLoop());
     return nmThread;
 }
示例#9
0
 /**
  * Register Thread when it starts
  * @param jMeterThread {@link JMeterThread}
  * @param newThread Thread
  */
 private void RegisterStartedThread(NetMeterThread nmThread, Thread newThread)
 {
     allThreads.TryAdd(nmThread, newThread);
 }