ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [37/42] ignite git commit: IGNITE-1932 Fixed busy time calculations after ignite.cluster().resetMetrics(). - Fixes #242.
Date Fri, 11 Dec 2015 12:52:39 GMT
IGNITE-1932 Fixed busy time calculations after ignite.cluster().resetMetrics(). - Fixes #242.

Signed-off-by: Alexey Kuznetsov <akuznetsov@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/69a6b0f9
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/69a6b0f9
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/69a6b0f9

Branch: refs/heads/ignite-1537
Commit: 69a6b0f93b4ce55e9693620666cd016f527dd838
Parents: 0ac39c9
Author: AKuznetsov <akuznetsov@gridgain.com>
Authored: Fri Dec 11 17:11:38 2015 +0700
Committer: Alexey Kuznetsov <akuznetsov@apache.org>
Committed: Fri Dec 11 17:11:38 2015 +0700

----------------------------------------------------------------------
 .../processors/jobmetrics/GridJobMetricsProcessor.java       | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/69a6b0f9/modules/core/src/main/java/org/apache/ignite/internal/processors/jobmetrics/GridJobMetricsProcessor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/jobmetrics/GridJobMetricsProcessor.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/jobmetrics/GridJobMetricsProcessor.java
index 06b9383..72ffe23 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/jobmetrics/GridJobMetricsProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/jobmetrics/GridJobMetricsProcessor.java
@@ -108,7 +108,13 @@ public class GridJobMetricsProcessor extends GridProcessorAdapter {
      * Resets metrics.
      */
     public void reset() {
+        InternalMetrics prevMetrics = metrics;
+
         metrics = new InternalMetrics();
+
+        // Preserve totalIdleTime, because it is used for busy / idle time calculations.
+        if (prevMetrics != null)
+            metrics.totalIdleTime = prevMetrics.totalIdleTime;
     }
 
     /**
@@ -400,4 +406,4 @@ public class GridJobMetricsProcessor extends GridProcessorAdapter {
             return m;
         }
     }
-}
\ No newline at end of file
+}


Mime
View raw message