You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@unomi.apache.org by sh...@apache.org on 2017/05/01 19:36:55 UTC

incubator-unomi git commit: UNOMI-93 Add rule execution statistics to rule service endpoint - Add JavaDoc documentation

Repository: incubator-unomi
Updated Branches:
  refs/heads/master df6acb3f1 -> 64bf3a96a


UNOMI-93 Add rule execution statistics to rule service endpoint
- Add JavaDoc documentation

Signed-off-by: Serge Huber <sh...@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/incubator-unomi/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-unomi/commit/64bf3a96
Tree: http://git-wip-us.apache.org/repos/asf/incubator-unomi/tree/64bf3a96
Diff: http://git-wip-us.apache.org/repos/asf/incubator-unomi/diff/64bf3a96

Branch: refs/heads/master
Commit: 64bf3a96a34fc49a5ed6301bf33d889c04a91223
Parents: df6acb3
Author: Serge Huber <sh...@apache.org>
Authored: Mon May 1 21:36:49 2017 +0200
Committer: Serge Huber <sh...@apache.org>
Committed: Mon May 1 21:36:49 2017 +0200

----------------------------------------------------------------------
 .../apache/unomi/api/rules/RuleStatistics.java  | 68 +++++++++++++++++++-
 1 file changed, 65 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/64bf3a96/api/src/main/java/org/apache/unomi/api/rules/RuleStatistics.java
----------------------------------------------------------------------
diff --git a/api/src/main/java/org/apache/unomi/api/rules/RuleStatistics.java b/api/src/main/java/org/apache/unomi/api/rules/RuleStatistics.java
index 2172461..4dd18c7 100644
--- a/api/src/main/java/org/apache/unomi/api/rules/RuleStatistics.java
+++ b/api/src/main/java/org/apache/unomi/api/rules/RuleStatistics.java
@@ -21,13 +21,14 @@ import org.apache.unomi.api.Item;
 import java.util.Date;
 
 /**
- * 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.
+ * 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.
  */
 public class RuleStatistics extends Item {
 
     /**
-     * The Rule ITEM_TYPE.
+     * The RuleStatistics ITEM_TYPE.
      *
      * @see Item for a discussion of ITEM_TYPE
      */
@@ -49,58 +50,119 @@ public class RuleStatistics extends Item {
         super(itemId);
     }
 
+    /**
+     * Retrieve the execution count of the rule in the cluster
+     * @return a long that is the total number of executions of the rule without the local node execution
+     * count
+     */
     public long getExecutionCount() {
         return executionCount;
     }
 
+    /**
+     * Set the execution count of the rule in the cluster
+     * @param executionCount a long that represents the number of execution of the rule in the cluster
+     */
     public void setExecutionCount(long executionCount) {
         this.executionCount = executionCount;
     }
 
+    /**
+     * Retrieve the execution count of the rule on this single node since the last sync with the cluster
+     * @return a long that is the total number of executions on this node since the last sync with the
+     * cluster
+     */
     public long getLocalExecutionCount() {
         return localExecutionCount;
     }
 
+    /**
+     * Sets the number of local execution counts for this node since the last sync with the cluster
+     * @param localExecutionCount a long that represents the number of execution of the rule since the
+     *                            last sync with the cluster
+     */
     public void setLocalExecutionCount(long localExecutionCount) {
         this.localExecutionCount = localExecutionCount;
     }
 
+    /**
+     * Retrieve the accumulated time evaluating the conditions of the rule in the cluster
+     * @return a long representing the accumulated time in milliseconds that represents the time spent
+     * evaluating the conditions of the rule for the whole cluster
+     */
     public long getConditionsTime() {
         return conditionsTime;
     }
 
+    /**
+     * Sets the execution time of the condition of the rule for the whole cluster
+     * @param conditionsTime a long representing a time in milliseconds
+     */
     public void setConditionsTime(long conditionsTime) {
         this.conditionsTime = conditionsTime;
     }
 
+    /**
+     * Retrieve the accumulated execution time of the rule's condition since the last sync with the cluster
+     * @return a long that represents the accumulated time in milliseconds
+     */
     public long getLocalConditionsTime() {
         return localConditionsTime;
     }
 
+    /**
+     * Sets the accumulated execution time of the rule's condition since the last sync with the cluster
+     * @param localConditionsTime a long that represents the accumulated time in milliseconds
+     */
     public void setLocalConditionsTime(long localConditionsTime) {
         this.localConditionsTime = localConditionsTime;
     }
 
+    /**
+     * Retrieve the accumulated time of the rule's actions
+     * @return a long representing the accumulated time in milliseconds
+     */
     public long getActionsTime() {
         return actionsTime;
     }
 
+    /**
+     * Sets the accumulated time for the rule's actions
+     * @param actionsTime a long representing the accumulated time in milliseconds
+     */
     public void setActionsTime(long actionsTime) {
         this.actionsTime = actionsTime;
     }
 
+    /**
+     * Retrieve the accumulated time spent executing the rule's actions since the last sync with the cluster
+     * @return a long representing the accumulated time in milliseconds
+     */
     public long getLocalActionsTime() {
         return localActionsTime;
     }
 
+    /**
+     * Sets the accumulated time spend executing the rule's actions since the last sync with the cluster
+     * @param localActionsTime a long representing the accumulated time in milliseconds
+     */
     public void setLocalActionsTime(long localActionsTime) {
         this.localActionsTime = localActionsTime;
     }
 
+    /**
+     * Retrieve the last sync date
+     * @return a date that was set the last time the statistics were synchronized with the cluster
+     */
     public Date getLastSyncDate() {
         return lastSyncDate;
     }
 
+    /**
+     * Sets the last sync date
+     * @param lastSyncDate a date that represents the last time the statistics were synchronized
+     *                     with the cluster
+     */
     public void setLastSyncDate(Date lastSyncDate) {
         this.lastSyncDate = lastSyncDate;
     }