Package org.apache.jmeter.samplers
Class StatisticalSampleResult
-
- All Implemented Interfaces:
-
java.io.Serializable
,java.lang.Cloneable
,org.apache.jmeter.gui.Searchable
public class StatisticalSampleResult extends SampleResult implements Serializable
Aggregates sample results for use by the Statistical remote batch mode. Samples are aggregated by the key defined by getKey(). TODO: merge error count into parent class?
-
-
Field Summary
Fields Modifier and Type Field Description public int
errorCount
public final static String
DEFAULT_HTTP_ENCODING
public final static String
TEXT
public final static String
BINARY
public SampleSaveConfiguration
saveConfig
public SampleResult
parent
public Array<byte>
responseData
public String
responseCode
public String
resultFileName
public String
samplerData
public String
threadName
public String
responseMessage
public String
responseHeaders
public String
requestHeaders
public long
startTime
public long
endTime
public long
idleTime
public String
dataType
public String
contentType
public long
latency
public long
connectTime
public JMeterContext.TestLogicalAction
testLogicalAction
public int
sampleCount
public int
headersSize
public volatile int
groupThreads
public volatile int
allThreads
public long
sentBytes
public transient volatile String
responseDataAsString
-
Constructor Summary
Constructors Constructor Description StatisticalSampleResult()
StatisticalSampleResult(long stamp, long elapsed)
Allow CsvSaveService to generate a suitable result when sample/error counts have been saved. StatisticalSampleResult(SampleResult res)
Create a statistical sample result from an ordinary sample result.
-
Method Summary
Modifier and Type Method Description int
getErrorCount()
Returns the count of errors. void
setErrorCount(int e)
void
add(SampleResult res)
long
getTime()
Get the time it took this sample to occur. long
getTimeStamp()
Get the sample timestamp, which may be either the start time or the end time. static String
getKey(SampleEvent event, boolean keyOnThreadName)
Generates the key to be used for aggregating samples as follows: sampleLabel
"-"[threadName|threadGroup]
N.B.-
Methods inherited from class org.apache.jmeter.samplers.SampleResult
addAssertionResult, addRawSubResult, addSubResult, addSubResult, cleanAfterSample, clone, connectEnd, createTestSample, createTestSample, currentTimeInMillis, getAllThreads, getAssertionResults, getBodySize, getBodySizeAsLong, getBytes, getBytesAsLong, getConnectTime, getContentType, getDataEncodingNoDefault, getDataEncodingWithDefault, getDataType, getEndTime, getFirstAssertionFailureMessage, getGroupThreads, getHeadersSize, getIdleTime, getLatency, getMediaType, getParent, getRequestHeaders, getResponseCode, getResponseData, getResponseDataAsString, getResponseHeaders, getResponseMessage, getResultFileName, getSampleCount, getSampleLabel, getSampleLabel, getSamplerData, getSaveConfig, getSearchableTokens, getSentBytes, getStartTime, getSubResults, getTestLogicalAction, getThreadName, getURL, getUrlAsString, isBinaryType, isIgnore, isMonitor, isRenameSampleLabel, isResponseCodeOK, isStampedAtStart, isStartNextThreadLoop, isStopTest, isStopTestNow, isStopThread, isSuccessful, latencyEnd, markFile, removeAssertionResults, removeSubResults, sampleEnd, samplePause, sampleResume, sampleStart, setAllThreads, setBodySize, setBodySize, setBytes, setBytes, setConnectTime, setContentType, setDataEncoding, setDataType, setEncodingAndType, setEndTime, setErrorCount, setGroupThreads, setHeadersSize, setIdleTime, setIgnore, setLatency, setMonitor, setParent, setRequestHeaders, setResponseCode, setResponseCodeOK, setResponseData, setResponseData, setResponseData, setResponseHeaders, setResponseMessage, setResponseMessageOK, setResponseOK, setResultFileName, setSampleCount, setSampleLabel, setSamplerData, setSaveConfig, setSentBytes, setStampAndTime, setStartNextThreadLoop, setStopTest, setStopTestNow, setStopThread, setSuccessful, setTestLogicalAction, setThreadName, setTimeStamp, setURL, storeSubResult, storeSubResult, toDebugString, toString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Constructor Detail
-
StatisticalSampleResult
StatisticalSampleResult()
-
StatisticalSampleResult
StatisticalSampleResult(long stamp, long elapsed)
Allow CsvSaveService to generate a suitable result when sample/error counts have been saved.- Parameters:
stamp
- this may be a start time or an end time (both in milliseconds)elapsed
- time in milliseconds
-
StatisticalSampleResult
StatisticalSampleResult(SampleResult res)
Create a statistical sample result from an ordinary sample result.- Parameters:
res
- the sample result
-
-
Method Detail
-
getErrorCount
int getErrorCount()
Returns the count of errors.
- Returns:
0 - or 1 if the sample failed TODO do we need allow for nested samples?
-
setErrorCount
void setErrorCount(int e)
-
add
void add(SampleResult res)
-
getTime
long getTime()
Get the time it took this sample to occur.
- Returns:
elapsed time in milliseconds
-
getTimeStamp
long getTimeStamp()
Get the sample timestamp, which may be either the start time or the end time.
- Returns:
timeStamp in milliseconds
-
getKey
static String getKey(SampleEvent event, boolean keyOnThreadName)
Generates the key to be used for aggregating samples as follows:
sampleLabel
"-"[threadName|threadGroup]
N.B. the key should agree with the fixed items that are saved in the sample.
- Parameters:
event
- sample event whose key is to be calculatedkeyOnThreadName
- true if key should use thread name, otherwise use thread group- Returns:
the key to use for aggregating samples
-
-
-
-