public abstract class RequestOrientedStats extends AbstractStats
MB| Constructor and Description |
|---|
RequestOrientedStats()
Creates a new anonymous stats.
|
RequestOrientedStats(java.lang.String aMethodName)
Creates a new object with the given method name.
|
RequestOrientedStats(java.lang.String aMethodName,
Interval[] aSelectedIntervals)
Creates a new request oriented stats object with given method name and intervals.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addExecutionTime(long time)
Adds messed execution time to the total execution time.
|
void |
addRequest()
Notifies about start of a new request.
|
CallExecution |
createCallExecution()
Creates a new call execution object.
|
java.util.List<java.lang.String> |
getAvailableValueNames()
Returns the names of all contained stats.
|
double |
getAverageRequestDuration()
Returns the average time of the request execution duration.
|
double |
getAverageRequestDuration(java.lang.String intervalName)
Returns the average request duration for the given interval in nanoseconds.
|
double |
getAverageRequestDuration(java.lang.String intervalName,
TimeUnit unit)
Returns the average request duration for the given interval and converted to the given timeunit.
|
long |
getCurrentRequests() |
long |
getCurrentRequests(java.lang.String intervalName) |
double |
getErrorRate(java.lang.String intervalName)
Returns the error rate.
|
long |
getErrors() |
long |
getErrors(java.lang.String intervalName)
Returns the amount of errors for the given interval.
|
long |
getLastRequest()
Returns the duration of the last request in default interval in nanoseconds.
|
long |
getLastRequest(java.lang.String intervalName)
Returns the duration of the last request in an interval in nanoseconds.
|
long |
getMaxCurrentRequests() |
long |
getMaxCurrentRequests(java.lang.String intervalName) |
long |
getMaxTime() |
long |
getMaxTime(java.lang.String intervalName) |
java.lang.String |
getMethodName()
Returns the method name, which is the unique identifier of this stats object within its producer context.
|
long |
getMinTime() |
long |
getMinTime(java.lang.String intervalName) |
java.lang.String |
getName()
Returns the name of this request (effectively method name).
|
Interval[] |
getSelectedIntervals() |
long |
getTotalRequests()
Returns the total number of requests for the default interval.
|
long |
getTotalRequests(java.lang.String intervalName) |
long |
getTotalTime()
Returns the total spent time for the default interval.
|
long |
getTotalTime(java.lang.String intervalName)
Returns total spent time for the given interal.
|
java.lang.String |
getValueByNameAsString(java.lang.String valueName,
java.lang.String intervalName,
TimeUnit timeUnit) |
boolean |
isEmpty(java.lang.String intervalName)
Returns true if this stat object didn't record anything of interest in a given interval.
|
void |
notifyError()
Notifies about an uncaught error.
|
void |
notifyError(java.lang.Throwable throwable)
Notifies about an uncaught error.
|
void |
notifyRequestFinished()
Notifies that current request leaves the method body.
|
void |
setMethodName(java.lang.String string)
Sets the method name.
|
void |
setSelectedIntervals(Interval[] selectedIntervals) |
java.lang.String |
toStatsString(java.lang.String intervalName,
TimeUnit timeUnit)
This method creates a human-readable textual representation of all statistical
values in the given interval.
|
java.lang.String |
toString()
A string representation of this object.
|
java.lang.String |
toString(java.lang.String intervalName)
Returns a toString representation with values fo the given interval.
|
addStatValues, destroy, toStatsString, toStatsString, toStatsStringpublic RequestOrientedStats(java.lang.String aMethodName)
aMethodName - public RequestOrientedStats()
public RequestOrientedStats(java.lang.String aMethodName,
Interval[] aSelectedIntervals)
aMethodName - the method name.aSelectedIntervals - supported intervals.public void addRequest()
public void notifyRequestFinished()
public void notifyError()
public void notifyError(java.lang.Throwable throwable)
public void addExecutionTime(long time)
time - public double getAverageRequestDuration()
public double getAverageRequestDuration(java.lang.String intervalName)
intervalName - name of the interval.public double getAverageRequestDuration(java.lang.String intervalName,
TimeUnit unit)
intervalName - name of the interval.unit - timeunit.public double getErrorRate(java.lang.String intervalName)
intervalName - name of the interval.public java.lang.String toString()
toString in class AbstractStatspublic java.lang.String toStatsString(java.lang.String intervalName,
TimeUnit timeUnit)
IStatsintervalName - the name of the interval or null for all intervalspublic java.lang.String getValueByNameAsString(java.lang.String valueName,
java.lang.String intervalName,
TimeUnit timeUnit)
getValueByNameAsString in interface IStatsgetValueByNameAsString in class AbstractStatspublic java.lang.String toString(java.lang.String intervalName)
intervalName - the target interval.public java.lang.String getMethodName()
public void setMethodName(java.lang.String string)
string - method name parameter.public long getTotalRequests(java.lang.String intervalName)
public long getTotalRequests()
public long getTotalTime()
public long getTotalTime(java.lang.String intervalName)
intervalName - the target interval.public long getCurrentRequests(java.lang.String intervalName)
public long getCurrentRequests()
public long getMaxCurrentRequests(java.lang.String intervalName)
public long getMaxCurrentRequests()
public long getErrors()
public long getErrors(java.lang.String intervalName)
intervalName - public long getLastRequest()
public long getLastRequest(java.lang.String intervalName)
intervalName - public Interval[] getSelectedIntervals()
public void setSelectedIntervals(Interval[] selectedIntervals)
public long getMinTime(java.lang.String intervalName)
public long getMinTime()
public long getMaxTime(java.lang.String intervalName)
public long getMaxTime()
public java.lang.String getName()
getName in interface IStatsgetName in class AbstractStatspublic CallExecution createCallExecution()
createCallExecution in interface IStatscreateCallExecution in class AbstractStatspublic java.util.List<java.lang.String> getAvailableValueNames()
IStatsgetAvailableValueNames in interface IStatsgetAvailableValueNames in interface StatsMXBeangetAvailableValueNames in class AbstractStatspublic boolean isEmpty(java.lang.String intervalName)
IStatsisEmpty in interface IStatsisEmpty in class AbstractStatsCopyright © 2010-2020 anotheria.net. All Rights Reserved.