Class TimeGuard.TimeData
java.lang.Object
com.igormaznitsa.meta.common.utils.TimeGuard.TimeData
- All Implemented Interfaces:
Serializable
- Enclosing class:
TimeGuard
Data container for time watching action.
- Since:
- 1.0
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final TimeGuard.TimeAlertListener
Some provided processor to be called for alert.private final String
The Alert message to be provided into log or somewhere else, for time points it is ID.private final long
The Creation time of the data container in milliseconds.private final long
Max allowed time delay in milliseconds.private static final long
private final int
Contains detected stack depth for creation. -
Constructor Summary
ConstructorsConstructorDescriptionTimeData
(int stackDepth, String alertMessage, long maxAllowedDelayInMilliseconds, TimeGuard.TimeAlertListener violationListener) The Constructor -
Method Summary
Modifier and TypeMethodDescriptionGet alert listener if providedGet the alert message.long
Get the creation time of the container.int
Get the detected stack depth during the container creation.long
Get defined max allowed time delay in milliseconds.boolean
Check that the object represents a named time point.
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
stackDepth
private final int stackDepthContains detected stack depth for creation.- Since:
- 1.0
-
maxAllowedDelayInMilliseconds
private final long maxAllowedDelayInMillisecondsMax allowed time delay in milliseconds.- Since:
- 1.0
-
creationTimeInMilliseconds
private final long creationTimeInMillisecondsThe Creation time of the data container in milliseconds.- Since:
- 1.0
-
alertMessage
The Alert message to be provided into log or somewhere else, for time points it is ID.- Since:
- 1.0
-
alertListener
Some provided processor to be called for alert.- Since:
- 1.0
-
-
Constructor Details
-
TimeData
@Weight(LIGHT) public TimeData(@Constraint("X>1") int stackDepth, String alertMessage, long maxAllowedDelayInMilliseconds, TimeGuard.TimeAlertListener violationListener) The Constructor- Parameters:
stackDepth
- stack depthalertMessage
- alert message for time violationmaxAllowedDelayInMilliseconds
- max allowed time gap in millisecondsviolationListener
- listener for the violation alert- Since:
- 1.0
-
-
Method Details
-
getAlertListener
Get alert listener if provided- Returns:
- the provided alert listener
- Since:
- 1.0
-
getAlertMessage
Get the alert message. For time points it is ID.- Returns:
- defined alert message.
- Since:
- 1.0
-
getDetectedStackDepth
public int getDetectedStackDepth()Get the detected stack depth during the container creation.- Returns:
- the detected stack depth
- Since:
- 1.0
-
getCreationTimeInMilliseconds
public long getCreationTimeInMilliseconds()Get the creation time of the container.- Returns:
- the creation time in milliseconds
- Since:
- 1.0
-
getMaxAllowedDelayInMilliseconds
public long getMaxAllowedDelayInMilliseconds()Get defined max allowed time delay in milliseconds.- Returns:
- the max allowed time delay in milliseconds
- Since:
- 1.0
-
isTimePoint
public boolean isTimePoint()Check that the object represents a named time point.- Returns:
- true if the object represents a time point created for statistics.
-