Package org.apache.jmeter.samplers
Class StatisticalSampleResult
- java.lang.Object
-
- org.apache.jmeter.samplers.SampleResult
-
- org.apache.jmeter.samplers.StatisticalSampleResult
-
- All Implemented Interfaces:
Serializable
,Cloneable
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?- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class org.apache.jmeter.samplers.SampleResult
BINARY, DEFAULT_ENCODING, DEFAULT_HTTP_ENCODING, EMPTY_BA, TEXT
-
-
Constructor Summary
Constructors Constructor Description StatisticalSampleResult()
StatisticalSampleResult(long stamp, long elapsed)
Deprecated.Needs to be replaced when multiple sample results are sorted outStatisticalSampleResult(SampleResult res)
Create a statistical sample result from an ordinary sample result.StatisticalSampleResult(SampleResult res, boolean unused)
Deprecated.no longer necessary; useStatisticalSampleResult(SampleResult)
instead
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(SampleResult res)
int
getErrorCount()
Returns the count of errors.static String
getKey(SampleEvent event, boolean keyOnThreadName)
Generates the key to be used for aggregating samples as follows:
sampleLabel
"-"[threadName|threadGroup]
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.void
setErrorCount(int e)
-
Methods inherited from class org.apache.jmeter.samplers.SampleResult
addAssertionResult, addRawSubResult, addSubResult, cleanAfterSample, clone, connectEnd, createTestSample, createTestSample, currentTimeInMillis, getAllThreads, getAssertionResults, getBodySize, getBytes, getConnectTime, getContentType, getDataEncodingNoDefault, getDataEncodingWithDefault, getDataEncodingWithDefault, getDataType, getEndTime, getGroupThreads, getHeadersSize, getIdleTime, getLatency, getMediaType, getParent, getRequestHeaders, getResponseCode, getResponseData, getResponseDataAsString, getResponseHeaders, getResponseMessage, getResultFileName, getSampleCount, getSampleLabel, getSampleLabel, getSamplerData, getSaveConfig, getStartTime, getSubResults, getThreadName, getURL, getUrlAsString, isMonitor, isResponseCodeOK, isStampedAtStart, isStartNextThreadLoop, isStopTest, isStopTestNow, isStopThread, isSuccessful, latencyEnd, markFile, removeAssertionResults, removeSubResults, sampleEnd, samplePause, sampleResume, sampleStart, setAllThreads, setBodySize, setBytes, setConnectTime, setContentType, setDataEncoding, setDataType, setEncodingAndType, setEndTime, setGroupThreads, setHeadersSize, setIdleTime, setLatency, setMonitor, setParent, setRequestHeaders, setResponseCode, setResponseCodeOK, setResponseData, setResponseData, setResponseData, setResponseHeaders, setResponseMessage, setResponseMessageOK, setResponseOK, setResultFileName, setSampleCount, setSampleLabel, setSamplerData, setSaveConfig, setStampAndTime, setStartNextThreadLoop, setStartTime, setStopTest, setStopTestNow, setStopThread, setSuccessful, setThreadName, setTimeStamp, setURL, storeSubResult, toString
-
-
-
-
Constructor Detail
-
StatisticalSampleResult
public StatisticalSampleResult()
-
StatisticalSampleResult
@Deprecated public StatisticalSampleResult(long stamp, long elapsed)
Deprecated.Needs to be replaced when multiple sample results are sorted outAllow OldSaveService 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
public StatisticalSampleResult(SampleResult res)
Create a statistical sample result from an ordinary sample result.- Parameters:
res
- the sample result
-
StatisticalSampleResult
@Deprecated public StatisticalSampleResult(SampleResult res, boolean unused)
Deprecated.no longer necessary; useStatisticalSampleResult(SampleResult)
insteadCreate a statistical sample result from an ordinary sample result.- Parameters:
res
- the sample resultunused
- no longer used
-
-
Method Detail
-
add
public void add(SampleResult res)
-
getTime
public long getTime()
Description copied from class:SampleResult
Get the time it took this sample to occur.- Overrides:
getTime
in classSampleResult
- Returns:
- elapsed time in milliseonds
-
getTimeStamp
public long getTimeStamp()
Description copied from class:SampleResult
Get the sample timestamp, which may be either the start time or the end time.- Overrides:
getTimeStamp
in classSampleResult
- Returns:
- timeStamp in milliseconds
- See Also:
SampleResult.getStartTime()
,SampleResult.getEndTime()
-
getErrorCount
public int getErrorCount()
Description copied from class:SampleResult
Returns the count of errors.- Overrides:
getErrorCount
in classSampleResult
- Returns:
- 0 - or 1 if the sample failed TODO do we need allow for nested samples?
-
setErrorCount
public void setErrorCount(int e)
- Overrides:
setErrorCount
in classSampleResult
-
getKey
public 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
-
-