Class JMeterThread

  • All Implemented Interfaces:
    java.lang.Runnable , org.apache.jmeter.samplers.Interruptible

    
    public class JMeterThread
     implements Runnable, Interruptible
                        

    The JMeter interface to the sampling process, allowing JMeter to see the timing, add listeners for sampling events and to stop the sampling process.

    • Method Detail

      • getThreadNum

         int getThreadNum()

        Returns the threadNum.

        Returns:

        the threadNum

      • setThreadNum

         void setThreadNum(int threadNum)

        Sets the threadNum.

        Parameters:
        threadNum - the threadNum to set
      • getStartTime

         long getStartTime()

        Get the start time value.

        Returns:

        the start time value.

      • setStartTime

         void setStartTime(long stime)

        Set the StartTime for this Thread.

        Parameters:
        stime - the StartTime value.
      • getEndTime

         long getEndTime()

        Get the end time value.

        Returns:

        the end time value.

      • setEndTime

         void setEndTime(long etime)

        Set the EndTime for this Thread.

        Parameters:
        etime - the EndTime value.
      • putVariables

        @API(status = API.Status.STABLE, since = "5.5") void putVariables(JMeterVariables variables)

        Updates the variables with all entries found in the variables in vars

        Parameters:
        variables - JMeterVariables with the entries to be updated
      • setScheduled

         void setScheduled(boolean sche)

        Enable the scheduler for this JMeterThread.

        Parameters:
        sche - flag whether the scheduler should be enabled
      • run

         void run()
      • stop

         void stop()

        Set running flag to false which will interrupt JMeterThread on next flag test. This is a clean shutdown.

      • interrupt

         boolean interrupt()

        Interrupt the current operation if possible.

      • getTestTree

         ListedHashTree getTestTree()
        Returns:

        ListedHashTree

      • setInitialDelay

         void setInitialDelay(int delay)

        Set rampup delay for JMeterThread Thread

        Parameters:
        delay - Rampup delay for JMeterThread
      • setEngine

         void setEngine(StandardJMeterEngine engine)

        Save the engine instance for access to the stop methods

        Parameters:
        engine - the engine which is used
      • setOnErrorStopTest

         void setOnErrorStopTest(boolean b)

        Should Test stop on sampler error?

        Parameters:
        b - true or false
      • setOnErrorStopTestNow

         void setOnErrorStopTestNow(boolean b)

        Should Test stop abruptly on sampler error?

        Parameters:
        b - true or false
      • setOnErrorStopThread

         void setOnErrorStopThread(boolean b)

        Should Thread stop on Sampler error?

        Parameters:
        b - true or false
      • setOnErrorStartNextLoop

         void setOnErrorStartNextLoop(boolean b)

        Should Thread start next loop on Sampler error?

        Parameters:
        b - true or false