Class Calculator
-
- All Implemented Interfaces:
public class Calculator
Class to calculate various items that don't require all previous results to be saved:
- mean = average
- standard deviation
- minimum
- maximum
-
-
Constructor Summary
Constructors Constructor Description Calculator()
Calculator(String label)
-
Method Summary
Modifier and Type Method Description String
getLabel()
void
clear()
void
addSample(SampleResult res)
Add details for a sample result, which may consist of multiple samples. void
addBytes(long newValue)
add received bytes long
getTotalBytes()
double
getMean()
Number
getMeanAsNumber()
double
getStandardDeviation()
long
getMin()
long
getMax()
int
getCount()
long
getCountLong()
double
getErrorPercentage()
Returns the raw double value of the percentage of samples with errors that were recorded. double
getRate()
Returns the throughput associated to this sampler in requests per second. double
getAvgPageBytes()
calculates the average page size, which means divide the bytes by number of samples. double
getBytesPerSecond()
Throughput in bytes / second double
getKBPerSecond()
Sent Throughput in kilobytes / second double
getSentBytesPerSecond()
Sent bytes / second double
getSentKBPerSecond()
Sent bytes throughput in kilobytes / second -
-
Constructor Detail
-
Calculator
Calculator()
-
Calculator
Calculator(String label)
-
-
Method Detail
-
clear
void clear()
-
addSample
void addSample(SampleResult res)
Add details for a sample result, which may consist of multiple samples. Updates the number of bytes read and sent, error count, startTime and elapsedTime
- Parameters:
res
- the sample result; might represent multiple values
-
addBytes
void addBytes(long newValue)
add received bytes
- Parameters:
newValue
- received bytes
-
getTotalBytes
long getTotalBytes()
-
getMean
double getMean()
-
getMeanAsNumber
Number getMeanAsNumber()
-
getStandardDeviation
double getStandardDeviation()
-
getMin
long getMin()
-
getMax
long getMax()
-
getCount
int getCount()
-
getCountLong
long getCountLong()
-
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.
-
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 to this sampler in requests per second
-
getAvgPageBytes
double getAvgPageBytes()
calculates the average page size, which means divide the bytes by number of samples.
- Returns:
average page size in bytes
-
getBytesPerSecond
double getBytesPerSecond()
Throughput in bytes / second
- Returns:
throughput in bytes/second
-
getKBPerSecond
double getKBPerSecond()
Sent Throughput in kilobytes / second
- Returns:
Sent Throughput in kilobytes / second
-
getSentBytesPerSecond
double getSentBytesPerSecond()
Sent bytes / second
- Returns:
throughput in bytes/second
-
getSentKBPerSecond
double getSentKBPerSecond()
Sent bytes throughput in kilobytes / second
- Returns:
Throughput in kilobytes / second
-
-
-
-