Package org.apache.jmeter.samplers
Class SampleEvent
-
- All Implemented Interfaces:
-
java.io.Serializable
public class SampleEvent implements Serializable
Packages information regarding the target of a sample event, such as the result from that event and the thread group it ran in.
-
-
Field Summary
Fields Modifier and Type Field Description public final static String
SAMPLE_VARIABLES
public final static String
HOSTNAME
public final SampleResult
result
public final String
threadGroup
public final String
hostname
public final boolean
isTransactionSampleEvent
-
Constructor Summary
Constructors Constructor Description SampleEvent()
Constructor used for Unit tests only. SampleEvent(SampleResult result, String threadGroup)
Creates SampleEvent without saving any variables. SampleEvent(SampleResult result, String threadGroup, JMeterVariables jmvars)
Constructor used for normal samples, saves variable values if any are defined. SampleEvent(SampleResult result, String threadGroup, String hostname)
Only intended for use when loading results from a file. SampleEvent(SampleResult result, String threadGroup, JMeterVariables jmvars, boolean isTransactionSampleEvent)
-
Method Summary
Modifier and Type Method Description SampleResult
getResult()
Get the SampleResult associated with this event String
getThreadGroup()
Get the name of the thread group for which this event was recorded String
getHostname()
Get the name of the host for which this event was recorded boolean
isTransactionSampleEvent()
static void
initSampleVariables()
Set up the additional variable names to be saved from the value in the SAMPLE_VARIABLES property static int
getVarCount()
Get the number of defined variables static String
getVarName(int i)
Get the nth variable name (zero-based) String
getVarValue(int i)
Get the nth variable value (zero-based) String
toString()
-
-
Constructor Detail
-
SampleEvent
SampleEvent()
Constructor used for Unit tests only.
-
SampleEvent
SampleEvent(SampleResult result, String threadGroup)
Creates SampleEvent without saving any variables.- Parameters:
result
- The SampleResult to be associated with this eventthreadGroup
- The name of the thread, the SampleResult was recorded
-
SampleEvent
SampleEvent(SampleResult result, String threadGroup, JMeterVariables jmvars)
Constructor used for normal samples, saves variable values if any are defined.- Parameters:
result
- The SampleResult to be associated with this eventthreadGroup
- The name of the thread, the SampleResult was recordedjmvars
- the JMeterVariables of the thread, the SampleResult was recorded
-
SampleEvent
SampleEvent(SampleResult result, String threadGroup, String hostname)
Only intended for use when loading results from a file.- Parameters:
result
- The SampleResult to be associated with this eventthreadGroup
- The name of the thread, the SampleResult was recordedhostname
- The name of the host, for which the SampleResult was recorded
-
SampleEvent
SampleEvent(SampleResult result, String threadGroup, JMeterVariables jmvars, boolean isTransactionSampleEvent)
- Parameters:
result
- The SampleResult to be associated with this eventthreadGroup
- The name of the thread, the SampleResult was recordedjmvars
- the JMeterVariables of the thread, the SampleResult was recordedisTransactionSampleEvent
- Flag whether this event is an transaction sample event
-
-
Method Detail
-
getResult
SampleResult getResult()
Get the SampleResult associated with this event
- Returns:
the associated SampleResult
-
getThreadGroup
String getThreadGroup()
Get the name of the thread group for which this event was recorded
- Returns:
the name of the thread group
-
getHostname
String getHostname()
Get the name of the host for which this event was recorded
- Returns:
the name of the host
-
isTransactionSampleEvent
boolean isTransactionSampleEvent()
- Returns:
the isTransactionSampleEvent
-
initSampleVariables
static void initSampleVariables()
Set up the additional variable names to be saved from the value in the SAMPLE_VARIABLES property
-
getVarCount
static int getVarCount()
Get the number of defined variables
- Returns:
the number of variables defined
-
getVarName
static String getVarName(int i)
Get the nth variable name (zero-based)
- Parameters:
i
- specifies which variable name should be returned (zero-based)- Returns:
the variable name of the nth variable
-
getVarValue
String getVarValue(int i)
Get the nth variable value (zero-based)
- Parameters:
i
- specifies which variable value should be returned (zero-based)- Returns:
the value of the nth variable
-
-
-
-