Package org.apache.unomi.api.rules
Class RuleStatistics
java.lang.Object
org.apache.unomi.api.Item
org.apache.unomi.api.rules.RuleStatistics
- All Implemented Interfaces:
Serializable
A separate item to track rule statistics, because we will manage the persistence and updating of
these seperately from the rules themselves. This object contains all the relevant statistics
concerning the execution of a rule, including accumulated execution times.
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlong
Retrieve the accumulated time of the rule's actionslong
Retrieve the accumulated time evaluating the conditions of the rule in the clusterlong
Retrieve the execution count of the rule in the clusterRetrieve the last sync datelong
Retrieve the accumulated time spent executing the rule's actions since the last sync with the clusterlong
Retrieve the accumulated execution time of the rule's condition since the last sync with the clusterlong
Retrieve the execution count of the rule on this single node since the last sync with the clustervoid
setActionsTime
(long actionsTime) Sets the accumulated time for the rule's actionsvoid
setConditionsTime
(long conditionsTime) Sets the execution time of the condition of the rule for the whole clustervoid
setExecutionCount
(long executionCount) Set the execution count of the rule in the clustervoid
setLastSyncDate
(Date lastSyncDate) Sets the last sync datevoid
setLocalActionsTime
(long localActionsTime) Sets the accumulated time spend executing the rule's actions since the last sync with the clustervoid
setLocalConditionsTime
(long localConditionsTime) Sets the accumulated execution time of the rule's condition since the last sync with the clustervoid
setLocalExecutionCount
(long localExecutionCount) Sets the number of local execution counts for this node since the last sync with the clusterMethods inherited from class org.apache.unomi.api.Item
equals, getItemId, getItemType, getItemType, getScope, getSystemMetadata, getVersion, hashCode, setItemId, setItemType, setScope, setSystemMetadata, setVersion
-
Field Details
-
ITEM_TYPE
The RuleStatistics ITEM_TYPE.
-
-
Constructor Details
-
RuleStatistics
public RuleStatistics() -
RuleStatistics
-
-
Method Details
-
getExecutionCount
public long getExecutionCount()Retrieve the execution count of the rule in the cluster- Returns:
- a long that is the total number of executions of the rule without the local node execution count
-
setExecutionCount
public void setExecutionCount(long executionCount) Set the execution count of the rule in the cluster- Parameters:
executionCount
- a long that represents the number of execution of the rule in the cluster
-
getLocalExecutionCount
public long getLocalExecutionCount()Retrieve the execution count of the rule on this single node since the last sync with the cluster- Returns:
- a long that is the total number of executions on this node since the last sync with the cluster
-
setLocalExecutionCount
public void setLocalExecutionCount(long localExecutionCount) Sets the number of local execution counts for this node since the last sync with the cluster- Parameters:
localExecutionCount
- a long that represents the number of execution of the rule since the last sync with the cluster
-
getConditionsTime
public long getConditionsTime()Retrieve the accumulated time evaluating the conditions of the rule in the cluster- Returns:
- a long representing the accumulated time in milliseconds that represents the time spent evaluating the conditions of the rule for the whole cluster
-
setConditionsTime
public void setConditionsTime(long conditionsTime) Sets the execution time of the condition of the rule for the whole cluster- Parameters:
conditionsTime
- a long representing a time in milliseconds
-
getLocalConditionsTime
public long getLocalConditionsTime()Retrieve the accumulated execution time of the rule's condition since the last sync with the cluster- Returns:
- a long that represents the accumulated time in milliseconds
-
setLocalConditionsTime
public void setLocalConditionsTime(long localConditionsTime) Sets the accumulated execution time of the rule's condition since the last sync with the cluster- Parameters:
localConditionsTime
- a long that represents the accumulated time in milliseconds
-
getActionsTime
public long getActionsTime()Retrieve the accumulated time of the rule's actions- Returns:
- a long representing the accumulated time in milliseconds
-
setActionsTime
public void setActionsTime(long actionsTime) Sets the accumulated time for the rule's actions- Parameters:
actionsTime
- a long representing the accumulated time in milliseconds
-
getLocalActionsTime
public long getLocalActionsTime()Retrieve the accumulated time spent executing the rule's actions since the last sync with the cluster- Returns:
- a long representing the accumulated time in milliseconds
-
setLocalActionsTime
public void setLocalActionsTime(long localActionsTime) Sets the accumulated time spend executing the rule's actions since the last sync with the cluster- Parameters:
localActionsTime
- a long representing the accumulated time in milliseconds
-
getLastSyncDate
Retrieve the last sync date- Returns:
- a date that was set the last time the statistics were synchronized with the cluster
-
setLastSyncDate
Sets the last sync date- Parameters:
lastSyncDate
- a date that represents the last time the statistics were synchronized with the cluster
-