org.apache.jmeter.util

Class Calculator


public class Calculator
extends Object

Class to calculate various items that don't require all previous results to be saved: - mean = average - standard deviation - minimum - maximum

Constructor Summary

Calculator()
Calculator(String label)

Method Summary

void
addBytes(long newValue)
void
addSample(SampleResult res)
void
addValue(long newValue)
void
clear()
double
getAvgPageBytes()
calculates the average page size, which means divide the bytes by number of samples.
double
getBytesPerSecond()
Throughput in bytes / second
int
getCount()
double
getErrorPercentage()
Returns the raw double value of the percentage of samples with errors that were recorded.
double
getKBPerSecond()
Throughput in kilobytes / second
String
getLabel()
long
getMax()
double
getMean()
Number
getMeanAsNumber()
long
getMin()
double
getPageSize()
Deprecated. use getAvgPageBytes() instead.
double
getRate()
Returns the throughput associated to this sampler in requests per second.
double
getStandardDeviation()
long
getTotalBytes()

Constructor Details

Calculator

public Calculator()

Calculator

public Calculator(String label)

Method Details

addBytes

public void addBytes(long newValue)

addSample

public void addSample(SampleResult res)

addValue

public void addValue(long newValue)

clear

public void clear()

getAvgPageBytes

public double getAvgPageBytes()
calculates the average page size, which means divide the bytes by number of samples.
Returns:
average page size in bytes

getBytesPerSecond

public double getBytesPerSecond()
Throughput in bytes / second
Returns:
throughput in bytes/second

getCount

public int getCount()

getErrorPercentage

public 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.

getKBPerSecond

public double getKBPerSecond()
Throughput in kilobytes / second
Returns:
Throughput in kilobytes / second

getLabel

public String getLabel()

getMax

public long getMax()

getMean

public double getMean()

getMeanAsNumber

public Number getMeanAsNumber()

getMin

public long getMin()

getPageSize

public double getPageSize()

Deprecated. use getAvgPageBytes() instead.

calculates the average page size, which means divide the bytes by number of samples. This is an ambiguous name, so:
Returns:
average page size

getRate

public 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.

getStandardDeviation

public double getStandardDeviation()

getTotalBytes

public long getTotalBytes()

Copyright © 1998-2010 Apache Software Foundation. All Rights Reserved.