Class JMeterContextService

  • All Implemented Interfaces:

    
    public final class JMeterContextService
    
                        

    Provides context service for JMeter threads. Keeps track of active and total thread counts.

    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Constructor Detail

    • Method Detail

      • getContext

         static JMeterContext getContext()

        Gives access to the current thread context.

        Returns:

        the current thread Context

      • startTest

         static void startTest()

        Method is called by the JMeterEngine class when a test run is started. Zeroes numberOfActiveThreads. Saves current time in a field and in the JMeter property "TESTSTART.MS"

      • getNumberOfThreads

         static int getNumberOfThreads()

        Get the number of currently active threads

        Returns:

        active thread count

      • endTest

         static void endTest()

        Called by MainFrame#testEnded(). Clears start time field.

      • getTotalThreads

         static int getTotalThreads()

        Get the total number of threads (>= active)

        Returns:

        total thread count

      • addTotalThreads

         static void addTotalThreads(int thisGroup)

        Update the total number of threads

        Parameters:
        thisGroup - number of threads in this thread group
      • clearTotalThreads

         static void clearTotalThreads()

        Set total threads to zero; also clears started and finished counts

      • getClientSideVariables

         static JMeterVariables getClientSideVariables()

        Get all variables accessible for JMeter client in a distributed test (only test plan and user defined variables) Note this is a read-only collection

        Returns:

        JMeterVariables available for JMeter client