Package org.apache.juneau.rest.stats
Class MethodExecStats
java.lang.Object
org.apache.juneau.rest.stats.MethodExecStats
Method execution statistics.
Keeps track of number of starts/finishes on tasks and keeps an average run time.
See Also:
-
Nested Class Summary
-
Constructor Summary
ModifierConstructorDescriptionprotected
MethodExecStats
(MethodExecStats.Builder builder) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionstatic MethodExecStats.Builder
Static creator.Call when an error occurs.finished
(long nanoTime) Call when task is finished.int
Returns the average execution time.int
Returns the number of times theerror(Throwable)
method was called.long
getGuid()
Returns a globally unique ID for this object.int
Returns the max execution time.Returns the method name of these stats.int
Returns the max execution time.int
Returns the number currently running method invocations.int
getRuns()
Returns the number of times thestarted()
method was called.Returns information on all stack traces of all exceptions encountered.long
Returns the total execution time.started()
Call when task is started.toString()
-
Constructor Details
-
MethodExecStats
Constructor.- Parameters:
builder
- The builder for this object.
-
-
Method Details
-
create
Static creator.- Parameters:
beanStore
- The bean store to use for creating beans.- Returns:
- A new builder for this object.
-
started
Call when task is started.- Returns:
- This object.
-
finished
Call when task is finished.- Parameters:
nanoTime
- The execution time of the task in nanoseconds.- Returns:
- This object.
-
error
Call when an error occurs.- Parameters:
e
- The exception thrown. Can benull .- Returns:
- This object.
-
getGuid
Returns a globally unique ID for this object.A random long generated during the creation of this object. Allows this object to be differentiated from other similar objects in multi-node environments so that statistics can be reliably stored in a centralized location.
- Returns:
- The globally unique ID for this object.
-
getMethod
Returns the method name of these stats.- Returns:
- The method name of these stats.
-
getRuns
Returns the number of times thestarted()
method was called.- Returns:
- The number of times the
started()
method was called.
-
getRunning
Returns the number currently running method invocations.- Returns:
- The number of currently running method invocations.
-
getErrors
Returns the number of times theerror(Throwable)
method was called.- Returns:
- The number of times the
error(Throwable)
method was called.
-
getMinTime
Returns the max execution time.- Returns:
- The average execution time in milliseconds.
-
getMaxTime
Returns the max execution time.- Returns:
- The average execution time in milliseconds.
-
getAvgTime
Returns the average execution time.- Returns:
- The average execution time in milliseconds.
-
getTotalTime
Returns the total execution time.- Returns:
- The total execution time in milliseconds.
-
getThrownStore
Returns information on all stack traces of all exceptions encountered.- Returns:
- Information on all stack traces of all exceptions encountered.
-
toString
-