usergrid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sfeld...@apache.org
Subject [2/2] incubator-usergrid git commit: adding graphite metrics
Date Tue, 03 Mar 2015 19:13:21 GMT
adding graphite metrics


Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/2b310158
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/2b310158
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/2b310158

Branch: refs/heads/USERGRID-432
Commit: 2b31015811205695024eb4b249dab35d4732a286
Parents: 5e578d5
Author: Shawn Feldman <sfeldman@apache.org>
Authored: Tue Mar 3 12:13:12 2015 -0700
Committer: Shawn Feldman <sfeldman@apache.org>
Committed: Tue Mar 3 12:13:12 2015 -0700

----------------------------------------------------------------------
 .../usergrid/corepersistence/StaleIndexCleanupTest.java       | 2 +-
 .../persistence/index/impl/EsIndexBufferConsumerImpl.java     | 7 ++++++-
 2 files changed, 7 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/2b310158/stack/core/src/test/java/org/apache/usergrid/corepersistence/StaleIndexCleanupTest.java
----------------------------------------------------------------------
diff --git a/stack/core/src/test/java/org/apache/usergrid/corepersistence/StaleIndexCleanupTest.java
b/stack/core/src/test/java/org/apache/usergrid/corepersistence/StaleIndexCleanupTest.java
index 703a497..54f0e93 100644
--- a/stack/core/src/test/java/org/apache/usergrid/corepersistence/StaleIndexCleanupTest.java
+++ b/stack/core/src/test/java/org/apache/usergrid/corepersistence/StaleIndexCleanupTest.java
@@ -385,7 +385,7 @@ public class StaleIndexCleanupTest extends AbstractCoreIT {
         do {
             if(count>0){Thread.sleep(200);}
             crs = queryCollectionCp("things", "thing", "select *");
-        } while ( crs.size() == numEntities && count++ < 15 );
+        } while ( crs.size() == numEntities && count++ < 1000 );
 
         Assert.assertEquals("Expect candidates without earlier stale entities", crs.size(),numEntities);
     }

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/2b310158/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EsIndexBufferConsumerImpl.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EsIndexBufferConsumerImpl.java
b/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EsIndexBufferConsumerImpl.java
index fbb7a40..52d1abb 100644
--- a/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EsIndexBufferConsumerImpl.java
+++ b/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EsIndexBufferConsumerImpl.java
@@ -20,6 +20,7 @@
 package org.apache.usergrid.persistence.index.impl;
 
 import com.codahale.metrics.Counter;
+import com.codahale.metrics.Meter;
 import com.codahale.metrics.Timer;
 import com.google.inject.Inject;
 import com.google.inject.Singleton;
@@ -61,10 +62,12 @@ public class EsIndexBufferConsumerImpl implements IndexBufferConsumer
{
     private final Observable<List<IndexOperationMessage>> consumer;
     private final Timer flushTimer;
     private final Counter indexSizeCounter;
+    private final Meter flushMeter;
 
     @Inject
     public EsIndexBufferConsumerImpl(final IndexFig config, final IndexBufferProducer producer,
final EsProvider provider, final MetricsFactory metricsFactory){
         this.flushTimer = metricsFactory.getTimer(EsIndexBufferConsumerImpl.class, "index.buffer.flush");
+        this.flushMeter = metricsFactory.getMeter(EsIndexBufferConsumerImpl.class, "index.buffer.meter");
         this.indexSizeCounter =  metricsFactory.getCounter(EsIndexBufferConsumerImpl.class,
"index.buffer.size");
         this.config = config;
         this.failureMonitor = new FailureMonitorImpl(config,provider);
@@ -77,9 +80,11 @@ public class EsIndexBufferConsumerImpl implements IndexBufferConsumer {
             .doOnNext(new Action1<List<IndexOperationMessage>>() {
                 @Override
                 public void call(List<IndexOperationMessage> containerList) {
-                    flushTimer.time();
                     if (containerList.size() > 0) {
+                        flushMeter.mark(containerList.size());
+                        Timer.Context time = flushTimer.time();
                         execute(containerList);
+                        time.stop();
                     }
                 }
             });


Mime
View raw message