accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vi...@apache.org
Subject svn commit: r1343878 - /accumulo/trunk/server/src/main/java/org/apache/accumulo/server/monitor/Monitor.java
Date Tue, 29 May 2012 17:51:14 GMT
Author: vines
Date: Tue May 29 17:51:14 2012
New Revision: 1343878

URL: http://svn.apache.org/viewvc?rev=1343878&view=rev
Log:
ACCUMULO-605 - don't attempt to aggregate stats of there are no stats to aggregate


Modified:
    accumulo/trunk/server/src/main/java/org/apache/accumulo/server/monitor/Monitor.java

Modified: accumulo/trunk/server/src/main/java/org/apache/accumulo/server/monitor/Monitor.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/server/src/main/java/org/apache/accumulo/server/monitor/Monitor.java?rev=1343878&r1=1343877&r2=1343878&view=diff
==============================================================================
--- accumulo/trunk/server/src/main/java/org/apache/accumulo/server/monitor/Monitor.java (original)
+++ accumulo/trunk/server/src/main/java/org/apache/accumulo/server/monitor/Monitor.java Tue
May 29 17:51:14 2012
@@ -307,84 +307,86 @@ public class Monitor {
         if (mmi == null)
           UtilWaitThread.sleep(1000);
       }
-      
-      int majorCompactions = 0;
-      int minorCompactions = 0;
-      
-      lookupRateTracker.startingUpdates();
-      indexCacheHitTracker.startingUpdates();
-      indexCacheRequestTracker.startingUpdates();
-      dataCacheHitTracker.startingUpdates();
-      dataCacheRequestTracker.startingUpdates();
-      
-      for (TabletServerStatus server : mmi.tServerInfo) {
-        TableInfo summary = Monitor.summarizeTableStats(server);
-        totalIngestRate += summary.ingestRate;
-        totalIngestByteRate += summary.ingestByteRate;
-        totalQueryRate += summary.queryRate;
-        totalScanRate += summary.scanRate;
-        totalQueryByteRate += summary.queryByteRate;
-        totalEntries += summary.recs;
-        totalHoldTime += server.holdTime;
-        totalLookups += server.lookups;
-        majorCompactions += summary.major.running;
-        minorCompactions += summary.minor.running;
-        lookupRateTracker.updateTabletServer(server.name, server.lastContact, server.lookups);
-        indexCacheHitTracker.updateTabletServer(server.name, server.lastContact, server.indexCacheHits);
-        indexCacheRequestTracker.updateTabletServer(server.name, server.lastContact, server.indexCacheRequest);
-        dataCacheHitTracker.updateTabletServer(server.name, server.lastContact, server.dataCacheHits);
-        dataCacheRequestTracker.updateTabletServer(server.name, server.lastContact, server.dataCacheRequest);
-      }
-      
-      lookupRateTracker.finishedUpdating();
-      indexCacheHitTracker.finishedUpdating();
-      indexCacheRequestTracker.finishedUpdating();
-      dataCacheHitTracker.finishedUpdating();
-      dataCacheRequestTracker.finishedUpdating();
-      
-      int totalTables = 0;
-      for (TableInfo tInfo : mmi.tableMap.values()) {
-        totalTabletCount += tInfo.tablets;
-        onlineTabletCount += tInfo.onlineTablets;
-        totalTables++;
-      }
-      Monitor.totalIngestRate = totalIngestRate;
-      Monitor.totalTables = totalTables;
-      totalIngestByteRate = totalIngestByteRate / 1000000.0;
-      Monitor.totalIngestByteRate = totalIngestByteRate;
-      Monitor.totalQueryRate = totalQueryRate;
-      Monitor.totalScanRate = totalScanRate;
-      totalQueryByteRate = totalQueryByteRate / 1000000.0;
-      Monitor.totalQueryByteRate = totalQueryByteRate;
-      Monitor.totalEntries = totalEntries;
-      Monitor.totalTabletCount = totalTabletCount;
-      Monitor.onlineTabletCount = onlineTabletCount;
-      Monitor.totalHoldTime = totalHoldTime;
-      Monitor.totalLookups = totalLookups;
-      
-      ingestRateOverTime.add(new Pair<Long,Double>(currentTime, totalIngestRate));
-      ingestByteRateOverTime.add(new Pair<Long,Double>(currentTime, totalIngestByteRate));
-      recoveriesOverTime.add(new Pair<Long,Integer>(currentTime, mmi.recovery.size()));
-      
-      double totalLoad = 0.;
-      for (TabletServerStatus status : mmi.tServerInfo) {
-        if (status != null)
-          totalLoad += status.osLoad;
-      }
-      loadOverTime.add(new Pair<Long,Double>(currentTime, totalLoad));
-      
-      minorCompactionsOverTime.add(new Pair<Long,Integer>(currentTime, minorCompactions));
-      majorCompactionsOverTime.add(new Pair<Long,Integer>(currentTime, majorCompactions));
-      
-      lookupsOverTime.add(new Pair<Long,Double>(currentTime, lookupRateTracker.calculateRate()));
-      
-      queryRateOverTime.add(new Pair<Long,Integer>(currentTime, (int) totalQueryRate));
-      queryByteRateOverTime.add(new Pair<Long,Double>(currentTime, totalQueryByteRate));
-      
-      scanRateOverTime.add(new Pair<Long,Integer>(currentTime, (int) totalScanRate));
+      if (mmi != null) {
+        
+        int majorCompactions = 0;
+        int minorCompactions = 0;
+        
+        lookupRateTracker.startingUpdates();
+        indexCacheHitTracker.startingUpdates();
+        indexCacheRequestTracker.startingUpdates();
+        dataCacheHitTracker.startingUpdates();
+        dataCacheRequestTracker.startingUpdates();
 
-      calcCacheHitRate(indexCacheHitRateOverTime, currentTime, indexCacheHitTracker, indexCacheRequestTracker);
-      calcCacheHitRate(dataCacheHitRateOverTime, currentTime, dataCacheHitTracker, dataCacheRequestTracker);
+        for (TabletServerStatus server : mmi.tServerInfo) {
+          TableInfo summary = Monitor.summarizeTableStats(server);
+          totalIngestRate += summary.ingestRate;
+          totalIngestByteRate += summary.ingestByteRate;
+          totalQueryRate += summary.queryRate;
+          totalScanRate += summary.scanRate;
+          totalQueryByteRate += summary.queryByteRate;
+          totalEntries += summary.recs;
+          totalHoldTime += server.holdTime;
+          totalLookups += server.lookups;
+          majorCompactions += summary.major.running;
+          minorCompactions += summary.minor.running;
+          lookupRateTracker.updateTabletServer(server.name, server.lastContact, server.lookups);
+          indexCacheHitTracker.updateTabletServer(server.name, server.lastContact, server.indexCacheHits);
+          indexCacheRequestTracker.updateTabletServer(server.name, server.lastContact, server.indexCacheRequest);
+          dataCacheHitTracker.updateTabletServer(server.name, server.lastContact, server.dataCacheHits);
+          dataCacheRequestTracker.updateTabletServer(server.name, server.lastContact, server.dataCacheRequest);
+        }
+        
+        lookupRateTracker.finishedUpdating();
+        indexCacheHitTracker.finishedUpdating();
+        indexCacheRequestTracker.finishedUpdating();
+        dataCacheHitTracker.finishedUpdating();
+        dataCacheRequestTracker.finishedUpdating();
+        
+        int totalTables = 0;
+        for (TableInfo tInfo : mmi.tableMap.values()) {
+          totalTabletCount += tInfo.tablets;
+          onlineTabletCount += tInfo.onlineTablets;
+          totalTables++;
+        }
+        Monitor.totalIngestRate = totalIngestRate;
+        Monitor.totalTables = totalTables;
+        totalIngestByteRate = totalIngestByteRate / 1000000.0;
+        Monitor.totalIngestByteRate = totalIngestByteRate;
+        Monitor.totalQueryRate = totalQueryRate;
+        Monitor.totalScanRate = totalScanRate;
+        totalQueryByteRate = totalQueryByteRate / 1000000.0;
+        Monitor.totalQueryByteRate = totalQueryByteRate;
+        Monitor.totalEntries = totalEntries;
+        Monitor.totalTabletCount = totalTabletCount;
+        Monitor.onlineTabletCount = onlineTabletCount;
+        Monitor.totalHoldTime = totalHoldTime;
+        Monitor.totalLookups = totalLookups;
+        
+        ingestRateOverTime.add(new Pair<Long,Double>(currentTime, totalIngestRate));
+        ingestByteRateOverTime.add(new Pair<Long,Double>(currentTime, totalIngestByteRate));
+        recoveriesOverTime.add(new Pair<Long,Integer>(currentTime, mmi.recovery.size()));
+        
+        double totalLoad = 0.;
+        for (TabletServerStatus status : mmi.tServerInfo) {
+          if (status != null)
+            totalLoad += status.osLoad;
+        }
+        loadOverTime.add(new Pair<Long,Double>(currentTime, totalLoad));
+        
+        minorCompactionsOverTime.add(new Pair<Long,Integer>(currentTime, minorCompactions));
+        majorCompactionsOverTime.add(new Pair<Long,Integer>(currentTime, majorCompactions));
+        
+        lookupsOverTime.add(new Pair<Long,Double>(currentTime, lookupRateTracker.calculateRate()));
+        
+        queryRateOverTime.add(new Pair<Long,Integer>(currentTime, (int) totalQueryRate));
+        queryByteRateOverTime.add(new Pair<Long,Double>(currentTime, totalQueryByteRate));
+        
+        scanRateOverTime.add(new Pair<Long,Integer>(currentTime, (int) totalScanRate));
+        
+        calcCacheHitRate(indexCacheHitRateOverTime, currentTime, indexCacheHitTracker, indexCacheRequestTracker);
+        calcCacheHitRate(dataCacheHitRateOverTime, currentTime, dataCacheHitTracker, dataCacheRequestTracker);
+      }
       
       try {
         Monitor.problemSummary = ProblemReports.getInstance().summarize();



Mime
View raw message