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
Nested Classes -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedMethodExecStats(MethodExecStats.Builder builder) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionstatic MethodExecStats.BuilderStatic creator.Call when an error occurs.finished(long nanoTime) Call when task is finished.intReturns the average execution time.intReturns the number of times theerror(Throwable)method was called.longgetGuid()Returns a globally unique ID for this object.intReturns the max execution time.Returns the method name of these stats.intReturns the max execution time.intReturns the number currently running method invocations.intgetRuns()Returns the number of times thestarted()method was called.Returns information on all stack traces of all exceptions encountered.longReturns 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.
-
error
Call when an error occurs.- Parameters:
e- The exception thrown. Can benull .- Returns:
- This object.
-
finished
Call when task is finished.- Parameters:
nanoTime- The execution time of the task in nanoseconds.- Returns:
- This object.
-
getAvgTime
Returns the average execution time.- Returns:
- The average execution time in milliseconds.
-
getErrors
Returns the number of times theerror(Throwable)method was called.- Returns:
- The number of times the
error(Throwable)method was called.
-
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.
-
getMaxTime
Returns the max execution time.- Returns:
- The average execution time in milliseconds.
-
getMethod
Returns the method name of these stats.- Returns:
- The method name of these stats.
-
getMinTime
Returns the max execution time.- Returns:
- The average execution time in milliseconds.
-
getRunning
Returns the number currently running method invocations.- Returns:
- The number of currently running method invocations.
-
getRuns
Returns the number of times thestarted()method was called.- Returns:
- The number of times the
started()method was called.
-
getThrownStore
Returns information on all stack traces of all exceptions encountered.- Returns:
- Information on all stack traces of all exceptions encountered.
-
getTotalTime
Returns the total execution time.- Returns:
- The total execution time in milliseconds.
-
started
Call when task is started.- Returns:
- This object.
-
properties
-
toString
-