Class SamplerMetric
-
- All Implemented Interfaces:
public class SamplerMetricSampler metric
- Since:
2.13
-
-
Field Summary
Fields Modifier and Type Field Description public intsuccessespublic intfailurespublic inthitspublic final Map<ErrorMetric, Integer>errorspublic longsentBytespublic longreceivedBytes
-
Constructor Summary
Constructors Constructor Description SamplerMetric()
-
Method Summary
Modifier and Type Method Description intgetSuccesses()Get the number of successful requests for the current time slot intgetFailures()Get the number of failed requests for the current time slot intgetHits()Returns hits to server Map<ErrorMetric, Integer>getErrors()Returns by type ( response code and message ) the count of errors occurs longgetSentBytes()longgetReceivedBytes()static voidsetDefaultWindowMode(WindowMode windowMode)Set WindowMode to use for newly created metrics. synchronized voidadd(SampleResult result)Add a SampleResult to be used in the statistics synchronized voidaddCumulated(SampleResult result)Add a SampleResult and its sub-results to be used in the statistics synchronized voidresetForTimeInterval()Reset metric except for percentile related data intgetTotal()Get the number of total requests for the current time slot doublegetOkMaxTime()Get the maximal elapsed time for requests within sliding window doublegetOkMinTime()Get the minimal elapsed time for requests within sliding window doublegetOkMean()Get the arithmetic mean of the stored values doublegetOkPercentile(double percentile)Returns an estimate for the requested percentile of the stored values. doublegetKoMaxTime()Get the maximal elapsed time for requests within sliding window doublegetKoMinTime()Get the minimal elapsed time for requests within sliding window doublegetKoMean()Get the arithmetic mean of the stored values doublegetKoPercentile(double percentile)Returns an estimate for the requested percentile of the stored values. doublegetAllMaxTime()Get the maximal elapsed time for requests within sliding window doublegetAllMinTime()Get the minimal elapsed time for requests within sliding window doublegetAllMean()Get the arithmetic mean of the stored values doublegetAllPercentile(double percentile)Returns an estimate for the requested percentile of the stored values. -
-
Method Detail
-
getSuccesses
int getSuccesses()
Get the number of successful requests for the current time slot
- Returns:
number of successful requests
-
getFailures
int getFailures()
Get the number of failed requests for the current time slot
- Returns:
number of failed requests
-
getHits
int getHits()
Returns hits to server
- Returns:
the hits
-
getErrors
Map<ErrorMetric, Integer> getErrors()
Returns by type ( response code and message ) the count of errors occurs
- Returns:
errors
-
getSentBytes
long getSentBytes()
- Returns:
the sentBytes
-
getReceivedBytes
long getReceivedBytes()
- Returns:
the receivedBytes
-
setDefaultWindowMode
@Deprecated()@VisibleForTesting(visibility = VisibleForTesting.Visibility.PRIVATE) static void setDefaultWindowMode(WindowMode windowMode)
Set WindowMode to use for newly created metrics.
- Parameters:
windowMode- new visibility mode
-
add
synchronized void add(SampleResult result)
Add a SampleResult to be used in the statistics
- Parameters:
result- SampleResult to be used
-
addCumulated
synchronized void addCumulated(SampleResult result)
Add a SampleResult and its sub-results to be used in the statistics
- Parameters:
result- SampleResult to be used
-
resetForTimeInterval
synchronized void resetForTimeInterval()
Reset metric except for percentile related data
-
getTotal
int getTotal()
Get the number of total requests for the current time slot
- Returns:
number of total requests
-
getOkMaxTime
double getOkMaxTime()
Get the maximal elapsed time for requests within sliding window
- Returns:
the maximal elapsed time, or
0if no requests have been added yet
-
getOkMinTime
double getOkMinTime()
Get the minimal elapsed time for requests within sliding window
- Returns:
the minTime, or MAX_VALUE if no requests have been added yet
-
getOkMean
double getOkMean()
Get the arithmetic mean of the stored values
- Returns:
The arithmetic mean of the stored values
-
getOkPercentile
double getOkPercentile(double percentile)
Returns an estimate for the requested percentile of the stored values.
- Parameters:
percentile- the requested percentile (scaled from 0 - 100)- Returns:
Returns an estimate for the requested percentile of the stored values.
-
getKoMaxTime
double getKoMaxTime()
Get the maximal elapsed time for requests within sliding window
- Returns:
the maximal elapsed time, or
0if no requests have been added yet
-
getKoMinTime
double getKoMinTime()
Get the minimal elapsed time for requests within sliding window
- Returns:
the minTime, or MAX_VALUE if no requests have been added yet
-
getKoMean
double getKoMean()
Get the arithmetic mean of the stored values
- Returns:
The arithmetic mean of the stored values
-
getKoPercentile
double getKoPercentile(double percentile)
Returns an estimate for the requested percentile of the stored values.
- Parameters:
percentile- the requested percentile (scaled from 0 - 100)- Returns:
Returns an estimate for the requested percentile of the stored values.
-
getAllMaxTime
double getAllMaxTime()
Get the maximal elapsed time for requests within sliding window
- Returns:
the maximal elapsed time, or
0if no requests have been added yet
-
getAllMinTime
double getAllMinTime()
Get the minimal elapsed time for requests within sliding window
- Returns:
the minTime, or MAX_VALUE if no requests have been added yet
-
getAllMean
double getAllMean()
Get the arithmetic mean of the stored values
- Returns:
The arithmetic mean of the stored values
-
getAllPercentile
double getAllPercentile(double percentile)
Returns an estimate for the requested percentile of the stored values.
- Parameters:
percentile- the requested percentile (scaled from 0 - 100)- Returns:
Returns an estimate for the requested percentile of the stored values.
-
-
-
-