private void Init() { variables = null; previousResult = null; currentSampler = null; previousSampler = null; samplingStarted = false; threadNum = 0; nThread = null; isReinitSubControllers = false; samplerContext.Clear(); restartNextLoop = false; }
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 }
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); }
public void SetThread(NetMeterThread nThread) { this.nThread = nThread; }
/** * Register Thread when it starts * @param jMeterThread {@link JMeterThread} * @param newThread Thread */ private void RegisterStartedThread(NetMeterThread nmThread, Thread newThread) { allThreads.TryAdd(nmThread, newThread); }
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; }