Class SamplingStatCalculator
-
- All Implemented Interfaces:
public class SamplingStatCalculator
Aggregate sample data container. Just instantiate a new instance of this class, and then call addSample a few times, and pull the stats out with whatever methods you prefer.
-
-
Field Summary
Fields Modifier and Type Field Description public double
maxThroughput
public final String
label
public volatile Sample
currentSample
-
Constructor Summary
Constructors Constructor Description SamplingStatCalculator()
SamplingStatCalculator(String label)
-
Method Summary
Modifier and Type Method Description double
getMaxThroughput()
String
getLabel()
Sample
getCurrentSample()
synchronized void
clear()
Clear the counters (useful for differential stats) long
getElapsed()
Get the elapsed time for the samples double
getRate()
Returns the throughput associated to this sampler in requests per second. double
getBytesPerSecond()
Throughput in bytes / second double
getKBPerSecond()
Throughput in kilobytes / second double
getSentBytesPerSecond()
Sent Throughput in bytes / second double
getSentKBPerSecond()
Sent Throughput in kilobytes / second double
getAvgPageBytes()
calculates the average page size, which means divide the bytes by number of samples. Sample
addSample(SampleResult res)
Records a sample. double
getErrorPercentage()
Returns the raw double value of the percentage of samples with errors that were recorded. String
toString()
long
getErrorCount()
Map<Number, Array<Number>>
getDistribution()
Number
getPercentPoint(double percent)
long
getCount()
Number
getMax()
double
getMean()
Number
getMeanAsNumber()
Number
getMedian()
Number
getMin()
Number
getPercentPoint(float percent)
double
getStandardDeviation()
-
-
Constructor Detail
-
SamplingStatCalculator
SamplingStatCalculator()
-
SamplingStatCalculator
SamplingStatCalculator(String label)
-
-
Method Detail
-
getMaxThroughput
double getMaxThroughput()
- Returns:
Returns the maxThroughput.
-
getCurrentSample
Sample getCurrentSample()
-
clear
synchronized void clear()
Clear the counters (useful for differential stats)
-
getElapsed
long getElapsed()
Get the elapsed time for the samples
- Returns:
how long the samples took
-
getRate
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
-
getBytesPerSecond
double getBytesPerSecond()
Throughput in bytes / second
- Returns:
throughput in bytes/second
-
getKBPerSecond
double getKBPerSecond()
Throughput in kilobytes / second
- Returns:
Throughput in kilobytes / second
-
getSentBytesPerSecond
double getSentBytesPerSecond()
Sent Throughput in bytes / second
- Returns:
sent throughput in bytes/second
-
getSentKBPerSecond
double getSentKBPerSecond()
Sent Throughput in kilobytes / second
- Returns:
Sent Throughput in kilobytes / second
-
getAvgPageBytes
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)
-
addSample
Sample addSample(SampleResult res)
Records a sample.
- Parameters:
res
- the sample to record- Returns:
newly created sample with current statistics
-
getErrorPercentage
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.
-
getErrorCount
long getErrorCount()
- Returns:
errorCount
-
getDistribution
Map<Number, Array<Number>> getDistribution()
-
getPercentPoint
Number getPercentPoint(double percent)
-
getCount
long getCount()
-
getMean
double getMean()
-
getMeanAsNumber
Number getMeanAsNumber()
-
getPercentPoint
Number getPercentPoint(float percent)
-
getStandardDeviation
double getStandardDeviation()
-
-
-
-