Examples of JMeterThread


Examples of org.apache.jmeter.threads.JMeterThread

        if (engine == null) {
            return false;// e.g. not yet started
        }
        // ConcurrentHashMap does not need synch. here
        for(Entry<JMeterThread, Thread> entry : engine.allThreads.entrySet()){
            JMeterThread thrd = entry.getKey();
            if (thrd.getThreadName().equals(threadName)){
                thrd.stop();
                thrd.interrupt();
                if (now) {
                    Thread t = entry.getValue();
                    if (t != null) {
                        t.interrupt();
                    }
View Full Code Here

Examples of org.apache.jmeter.threads.JMeterThread

                log.info("Thread will continue on error");
            }
            ListedHashTree threadGroupTree = (ListedHashTree) searcher.getSubTree(group);
            threadGroupTree.add(group, testLevelElements);
            for (int i = 0; running && i < numThreads; i++) {
                final JMeterThread jmeterThread = new JMeterThread(cloneTree(threadGroupTree), this, notifier);
                jmeterThread.setThreadNum(i);
                jmeterThread.setThreadGroup(group);
                jmeterThread.setInitialContext(JMeterContextService.getContext());
                final String threadName = groupName + " " + (groupCount) + "-" + (i + 1);
                jmeterThread.setThreadName(threadName);
                jmeterThread.setEngine(this);
                jmeterThread.setOnErrorStopTest(onErrorStopTest);
                jmeterThread.setOnErrorStopTestNow(onErrorStopTestNow);
                jmeterThread.setOnErrorStopThread(onErrorStopThread);
                jmeterThread.setOnErrorStartNextLoop(onErrorStartNextLoop);

                group.scheduleThread(jmeterThread);

                Thread newThread = new Thread(jmeterThread);
                newThread.setName(threadName);
View Full Code Here

Examples of org.apache.jmeter.threads.JMeterThread

     * </ul>
     */
    private void tellThreadsToStop() {
        // ConcurrentHashMap does not need protecting
        for (Entry<JMeterThread, Thread> entry : allThreads.entrySet()) {
            JMeterThread item = entry.getKey();
            item.stop(); // set stop flag
            item.interrupt(); // interrupt sampler if possible
            Thread t = entry.getValue();
            if (t != null ) { // Bug 49734
                t.interrupt(); // also interrupt JVM thread
            }
        }
View Full Code Here

Examples of org.apache.jmeter.threads.JMeterThread

  }

  private static boolean stopThread(String threadName, boolean now) {
    if (allThreadNames == null)
      return false;// e.g. not yet started
    JMeterThread thrd;
    try {
      thrd = (JMeterThread) allThreadNames.get(threadName);
    } catch (Exception e) {
      log.warn("stopThread: " + e);
      return false;
    }
    if (thrd != null) {
      thrd.stop();
      if (now) {
        Thread t = (Thread) allThreadsSave.get(thrd);
        if (t != null) {
          t.interrupt();
        }
View Full Code Here

Examples of org.apache.jmeter.threads.JMeterThread

      }

      for (int i = 0; running && i < threads.length; i++) {
        ListedHashTree threadGroupTree = (ListedHashTree) searcher.getSubTree(group);
        threadGroupTree.add(group, testLevelElements);
        threads[i] = new JMeterThread(cloneTree(threadGroupTree), this, notifier);
        threads[i].setThreadNum(i);
        threads[i].setThreadGroup(group);
        threads[i].setInitialContext(JMeterContextService.getContext());
        threads[i].setInitialDelay((int) (perThreadDelay * i));
        threads[i].setThreadName(groupName + " " + (groupCount) + "-" + (i + 1));
View Full Code Here

Examples of org.apache.jmeter.threads.JMeterThread

  }

  private void tellThreadsToStop() {
    Iterator iter = new HashSet(allThreads.keySet()).iterator();
    while (iter.hasNext()) {
      JMeterThread item = (JMeterThread) iter.next();
      item.stop();
      Thread t = (Thread) allThreads.get(item);
      if (t != null) {
        t.interrupt();
      } else {
        log.warn("Lost thread: " + item.getThreadName());
        allThreads.remove(item);
      }
    }
  }
View Full Code Here

Examples of org.apache.jmeter.threads.JMeterThread

  }

  private void stopAllThreads() {
    Iterator iter = new HashSet(allThreads.keySet()).iterator();
    while (iter.hasNext()) {
      JMeterThread item = (JMeterThread) iter.next();
      item.stop();
    }
  }
View Full Code Here

Examples of org.apache.jmeter.threads.JMeterThread

    private static boolean stopThread(String threadName, boolean now) {
        if (engine == null) {
            return false;// e.g. not yet started
        }
        JMeterThread thrd=null;
        synchronized (engine.allThreads) { // Protect iterator
            Iterator<JMeterThread> iter = engine.allThreads.keySet().iterator();
            while(iter.hasNext()){
                thrd = iter.next();
                if (thrd.getThreadName().equals(threadName)){
                    break; // Found matching thread
                }
            }
        }
        if (thrd != null) {
            thrd.stop();
            thrd.interrupt();
            if (now) {
                Thread t = engine.allThreads.get(thrd);
                if (t != null) {
                    t.interrupt();
                }
View Full Code Here

Examples of org.apache.jmeter.threads.JMeterThread

                log.info("Thread will continue on error");
            }
            ListedHashTree threadGroupTree = (ListedHashTree) searcher.getSubTree(group);
            threadGroupTree.add(group, testLevelElements);
            for (int i = 0; running && i < numThreads; i++) {
                final JMeterThread jmeterThread = new JMeterThread(cloneTree(threadGroupTree), this, notifier);
                jmeterThread.setThreadNum(i);
                jmeterThread.setThreadGroup(group);
                jmeterThread.setInitialContext(JMeterContextService.getContext());
                final String threadName = groupName + " " + (groupCount) + "-" + (i + 1);
                jmeterThread.setThreadName(threadName);
                jmeterThread.setEngine(this);
                jmeterThread.setOnErrorStopTest(onErrorStopTest);
                jmeterThread.setOnErrorStopTestNow(onErrorStopTestNow);
                jmeterThread.setOnErrorStopThread(onErrorStopThread);

                group.scheduleThread(jmeterThread);

                Thread newThread = new Thread(jmeterThread);
                newThread.setName(threadName);
View Full Code Here

Examples of org.apache.jmeter.threads.JMeterThread

    private void tellThreadsToStop() {
        synchronized (allThreads) { // Protect iterator
            Iterator<JMeterThread> iter = new HashSet<JMeterThread>(allThreads.keySet()).iterator();
            while (iter.hasNext()) {
                JMeterThread item = iter.next();
                item.stop(); // set stop flag
                item.interrupt(); // interrupt sampler if possible
                Thread t = allThreads.get(item);
                t.interrupt(); // also interrupt JVM thread
            }
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.