ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject incubator-ignite git commit: IGNITE-49 Fixed code style
Date Fri, 23 Jan 2015 13:41:02 GMT
Repository: incubator-ignite
Updated Branches:
  refs/heads/ignite-49 af2aa90b5 -> 7d68c8828


IGNITE-49 Fixed code style


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

Branch: refs/heads/ignite-49
Commit: 7d68c88281f30a94e9984f59d2bf4fa7b2271a68
Parents: af2aa90
Author: nikolay_tikhonov <ntikhonov@gridgain.com>
Authored: Fri Jan 23 16:30:42 2015 +0300
Committer: nikolay_tikhonov <ntikhonov@gridgain.com>
Committed: Fri Jan 23 16:39:17 2015 +0300

----------------------------------------------------------------------
 .../org/apache/ignite/IgniteCacheManager.java   |  3 +-
 .../processors/cache/CacheMetricsAdapter.java   | 14 ++++----
 .../kernal/visor/cache/VisorCacheMetrics.java   | 37 +++++++++-----------
 3 files changed, 26 insertions(+), 28 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7d68c882/modules/core/src/main/java/org/apache/ignite/IgniteCacheManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/IgniteCacheManager.java b/modules/core/src/main/java/org/apache/ignite/IgniteCacheManager.java
index 21a390d..b76d8c3 100644
--- a/modules/core/src/main/java/org/apache/ignite/IgniteCacheManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/IgniteCacheManager.java
@@ -385,7 +385,8 @@ public class IgniteCacheManager implements CacheManager {
         for (ObjectName registeredObjectName : registeredObjectNames) {
             try {
                 mBeanSrv.unregisterMBean(registeredObjectName);
-            } catch (Exception e) {
+            }
+            catch (Exception e) {
                 throw new CacheException("Error unregistering object instance " + registeredObjectName
                     + " . Error was " + e.getMessage(), e);
             }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7d68c882/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/CacheMetricsAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/CacheMetricsAdapter.java
b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/CacheMetricsAdapter.java
index f1c5248..d800c93 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/CacheMetricsAdapter.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/CacheMetricsAdapter.java
@@ -194,37 +194,37 @@ public class CacheMetricsAdapter implements CacheMetrics {
 
     /** {@inheritDoc} */
     @Override public int getTxDhtThreadMapSize() {
-        return cctx.isNear() && dhtCtx !=null ? dhtCtx.tm().threadMapSize() : -1;
+        return cctx.isNear() && dhtCtx != null ? dhtCtx.tm().threadMapSize() : -1;
     }
 
     /** {@inheritDoc} */
     @Override public int getTxDhtXidMapSize() {
-        return cctx.isNear() && dhtCtx !=null ? dhtCtx.tm().idMapSize() : -1;
+        return cctx.isNear() && dhtCtx != null ? dhtCtx.tm().idMapSize() : -1;
     }
 
     /** {@inheritDoc} */
     @Override public int getTxDhtCommitQueueSize() {
-        return cctx.isNear() && dhtCtx !=null ? dhtCtx.tm().commitQueueSize() : -1;
+        return cctx.isNear() && dhtCtx != null ? dhtCtx.tm().commitQueueSize() :
-1;
     }
 
     /** {@inheritDoc} */
     @Override public int getTxDhtPrepareQueueSize() {
-        return cctx.isNear() && dhtCtx !=null ? dhtCtx.tm().prepareQueueSize() :
-1;
+        return cctx.isNear() && dhtCtx != null ? dhtCtx.tm().prepareQueueSize() :
-1;
     }
 
     /** {@inheritDoc} */
     @Override public int getTxDhtStartVersionCountsSize() {
-        return cctx.isNear() && dhtCtx !=null ? dhtCtx.tm().startVersionCountsSize()
: -1;
+        return cctx.isNear() && dhtCtx != null ? dhtCtx.tm().startVersionCountsSize()
: -1;
     }
 
     /** {@inheritDoc} */
     @Override public int getTxDhtCommittedVersionsSize() {
-        return cctx.isNear() && dhtCtx !=null ? dhtCtx.tm().committedVersionsSize()
: -1;
+        return cctx.isNear() && dhtCtx != null ? dhtCtx.tm().committedVersionsSize()
: -1;
     }
 
     /** {@inheritDoc} */
     @Override public int getTxDhtRolledbackVersionsSize() {
-        return cctx.isNear() && dhtCtx !=null ? dhtCtx.tm().rolledbackVersionsSize()
: -1;
+        return cctx.isNear() && dhtCtx != null ? dhtCtx.tm().rolledbackVersionsSize()
: -1;
     }
 
     /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7d68c882/modules/core/src/main/java/org/gridgain/grid/kernal/visor/cache/VisorCacheMetrics.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/visor/cache/VisorCacheMetrics.java
b/modules/core/src/main/java/org/gridgain/grid/kernal/visor/cache/VisorCacheMetrics.java
index 4040954..a0e1856 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/visor/cache/VisorCacheMetrics.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/visor/cache/VisorCacheMetrics.java
@@ -27,6 +27,9 @@ import java.io.*;
  */
 public class VisorCacheMetrics implements Serializable {
     /** */
+    private static final int MICROSECONDS_IN_SECOND = 1_000_000;
+
+    /** */
     private static final long serialVersionUID = 0L;
 
     /** Gets the number of all entries cached on this node. */
@@ -104,26 +107,20 @@ public class VisorCacheMetrics implements Serializable {
 
         cm.size = c.size();
 
-//        cm.createTm = m.createTime();
-//        cm.writeTm = m.writeTime();
-//        cm.readTm = m.readTime();
-//        cm.commitTm = m.commitTime();
-//        cm.rollbackTm = m.rollbackTime();
-//
-//        cm.reads = m.reads();
-//        cm.writes = m.writes();
-//        cm.hits = m.hits();
-//        cm.misses = m.misses();
-//
-//        cm.txCommits = m.getAverageTxCommitTime();
-//        cm.txRollbacks = m.getAverageTxRollbackTime();
-//
-//        cm.readsPerSec = perSecond(m.reads(), m.readTime(), m.createTime());
-//        cm.writesPerSec = perSecond(m.writes(), m.writeTime(), m.createTime());
-//        cm.hitsPerSec = perSecond (m.hits(), m.readTime(), m.createTime());
-//        cm.missesPerSec = perSecond(m.misses(), m.readTime(), m.createTime());
-//        cm.commitsPerSec = perSecond(m.getAverageTxCommitTime(), m.commitTime(), m.createTime());
-//        cm.rollbacksPerSec = perSecond(m.getAverageTxRollbackTime(), m.rollbackTime(),
m.createTime());
+        cm.reads = (int)m.getCacheGets();
+        cm.writes = (int)(m.getCachePuts() + m.getCacheRemovals());
+        cm.hits = (int)m.getCacheHits();
+        cm.misses = (int)m.getCacheMisses();
+
+        cm.txCommits = (int)m.getCacheTxCommits();
+        cm.txRollbacks = (int)m.getCacheTxRollbacks();
+
+        cm.readsPerSec = (int)(MICROSECONDS_IN_SECOND * 1.f / m.getAverageGetTime());
+        cm.writesPerSec = (int)(MICROSECONDS_IN_SECOND * 1.f / m.getAveragePutTime());
+        cm.hitsPerSec = -1;
+        cm.missesPerSec = (int)(MICROSECONDS_IN_SECOND * 1.f / m.getAverageRemoveTime());
+        cm.commitsPerSec = (int)(MICROSECONDS_IN_SECOND * 1.f / m.getAverageTxCommitTime());
+        cm.rollbacksPerSec = (int)(MICROSECONDS_IN_SECOND * 1.f / m.getAverageTxRollbackTime());
 
         cm.qryMetrics = VisorCacheQueryMetrics.from(c.queries().metrics());
 


Mime
View raw message