@Bean(bpi="method,runs,running,errors,minTime,maxTime,avgTime,totalTime,exceptions") public class MethodExecStats extends Object implements Comparable<MethodExecStats>
Constructor and Description |
---|
MethodExecStats(Method method)
Constructor.
|
MethodExecStats(Method method,
Class<?> stackTraceStopClass)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(MethodExecStats o) |
void |
error(Throwable e)
Call when an error occurs.
|
void |
finished(long nanoTime)
Call when task is finished.
|
int |
getAvgTime()
Returns the average execution time.
|
int |
getErrors()
Returns the number of times the
error(Throwable) method was called. |
List<StackTraceInfo> |
getExceptions()
Returns information on all stack traces of all exceptions encountered.
|
int |
getMaxTime()
Returns the max execution time.
|
String |
getMethod()
Returns the method name of these stats.
|
int |
getMinTime()
Returns the max execution time.
|
int |
getRunning()
Returns the number currently running method invocations.
|
int |
getRuns()
Returns the number of times the
started() method was called. |
long |
getTotalTime()
Returns the total execution time.
|
void |
started()
Call when task is started.
|
String |
toString() |
public MethodExecStats(Method method, Class<?> stackTraceStopClass)
method
- Arbitrary label. Should be kept to less than 50 characters.stackTraceStopClass
- Don't calculate stack traces when this class is encountered.public MethodExecStats(Method method)
method
- Arbitrary label. Should be kept to less than 50 characters.public void started()
public void finished(long nanoTime)
nanoTime
- The execution time of the task in nanoseconds.public void error(Throwable e)
e
- The exception thrown. Can be public String getMethod()
public int getRuns()
started()
method was called.started()
method was called.public int getRunning()
public int getErrors()
error(Throwable)
method was called.error(Throwable)
method was called.public int getMinTime()
public int getMaxTime()
public int getAvgTime()
public long getTotalTime()
public List<StackTraceInfo> getExceptions()
public int compareTo(MethodExecStats o)
compareTo
in interface Comparable<MethodExecStats>
Copyright © 2016–2020 The Apache Software Foundation. All rights reserved.