Package org.apache.jmeter.visualizers
Class SamplingStatCalculator
java.lang.Object
org.apache.jmeter.visualizers.SamplingStatCalculator
- Direct Known Subclasses:
- CachingStatCalculator
Aggregate sample data container. Just instantiate a new instance of this
 class, and then call 
addSample(SampleResult) a few times, and pull
 the stats out with whatever methods you prefer.- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionaddSample(SampleResult res) Records a sample.voidclear()Clear the counters (useful for differential stats)doublecalculates the average page size, which means divide the bytes by number of samples.doubleThroughput in bytes / secondlonggetCount()longGet the elapsed time for the sampleslongdoubleReturns the raw double value of the percentage of samples with errors that were recorded.doubleThroughput in kilobytes / secondgetLabel()getMax()doubledoublegetMean()getMin()getPercentPoint(double percent) getPercentPoint(float percent) doublegetRate()Returns the throughput associated to this sampler in requests per second.doubleSent Throughput in bytes / seconddoubleSent Throughput in kilobytes / seconddoubletoString()
- 
Constructor Details- 
SamplingStatCalculatorpublic SamplingStatCalculator()
- 
SamplingStatCalculator
 
- 
- 
Method Details- 
clearpublic void clear()Clear the counters (useful for differential stats)
- 
getCurrentSample
- 
getElapsedpublic long getElapsed()Get the elapsed time for the samples- Returns:
- how long the samples took
 
- 
getRatepublic double getRate()Returns the throughput associated to this sampler in requests per second. May be slightly skewed because it takes the timestamps of the first and last samples as the total time passed, and the test may actually have started before that start time and ended after that end time.- Returns:
- throughput associated with this sampler per second
 
- 
getBytesPerSecondpublic double getBytesPerSecond()Throughput in bytes / second- Returns:
- throughput in bytes/second
 
- 
getKBPerSecondpublic double getKBPerSecond()Throughput in kilobytes / second- Returns:
- Throughput in kilobytes / second
 
- 
getSentBytesPerSecondpublic double getSentBytesPerSecond()Sent Throughput in bytes / second- Returns:
- sent throughput in bytes/second
 
- 
getSentKBPerSecondpublic double getSentKBPerSecond()Sent Throughput in kilobytes / second- Returns:
- Sent Throughput in kilobytes / second
 
- 
getAvgPageBytespublic double getAvgPageBytes()calculates the average page size, which means divide the bytes by number of samples.- Returns:
- average page size in bytes (0 if sample count is zero)
 
- 
getLabel- Returns:
- the label of this component
 
- 
addSampleRecords a sample.- Parameters:
- res- the sample to record
- Returns:
- newly created sample with current statistics
 
- 
getErrorPercentagepublic double getErrorPercentage()Returns the raw double value of the percentage of samples with errors that were recorded. (Between 0.0 and 1.0)- Returns:
- the raw double value of the percentage of samples with errors that were recorded.
 
- 
toString
- 
getErrorCountpublic long getErrorCount()- Returns:
- errorCount
 
- 
getMaxThroughputpublic double getMaxThroughput()- Returns:
- Returns the maxThroughput.
 
- 
getDistribution
- 
getPercentPoint
- 
getCountpublic long getCount()
- 
getMax
- 
getMeanpublic double getMean()
- 
getMeanAsNumber
- 
getMedian
- 
getMin
- 
getPercentPoint
- 
getStandardDeviationpublic double getStandardDeviation()
 
-