incubator-blur-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cr...@apache.org
Subject [1/2] git commit: Finished Dashboard
Date Mon, 18 Nov 2013 03:42:10 GMT
Updated Branches:
  refs/heads/blur-console-v2 f102d62a7 -> d3099d7b7


Finished Dashboard


Project: http://git-wip-us.apache.org/repos/asf/incubator-blur/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-blur/commit/43de53df
Tree: http://git-wip-us.apache.org/repos/asf/incubator-blur/tree/43de53df
Diff: http://git-wip-us.apache.org/repos/asf/incubator-blur/diff/43de53df

Branch: refs/heads/blur-console-v2
Commit: 43de53dfff2662995c612a1a89377e6d610ec5db
Parents: f102d62
Author: Chris Rohr <crohr@nearinfinity.com>
Authored: Sun Nov 17 22:37:41 2013 -0500
Committer: Chris Rohr <crohr@nearinfinity.com>
Committed: Sun Nov 17 22:37:41 2013 -0500

----------------------------------------------------------------------
 .../org/apache/blur/console/util/QueryUtil.java | 22 ++++-----
 .../apache/blur/console/webapp/css/console.css  | 49 ++------------------
 .../apache/blur/console/webapp/js/dashboard.js  | 16 +++----
 .../apache/blur/console/webapp/js/directives.js |  4 +-
 .../console/webapp/partials/dashboard.tpl.html  |  4 +-
 5 files changed, 26 insertions(+), 69 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/43de53df/contrib/blur-console/src/main/java/org/apache/blur/console/util/QueryUtil.java
----------------------------------------------------------------------
diff --git a/contrib/blur-console/src/main/java/org/apache/blur/console/util/QueryUtil.java
b/contrib/blur-console/src/main/java/org/apache/blur/console/util/QueryUtil.java
index cc9c325..44ec68d 100644
--- a/contrib/blur-console/src/main/java/org/apache/blur/console/util/QueryUtil.java
+++ b/contrib/blur-console/src/main/java/org/apache/blur/console/util/QueryUtil.java
@@ -66,12 +66,12 @@ public class QueryUtil {
 		slowThreshold.add(Calendar.MINUTE, -1);
 		
 		Map<String, Map<Long, Long>> queryCounts = new HashMap<String, Map<Long,
Long>>();
-		Map<String, Map<Long, Long>> queryPerformances = new HashMap<String, Map<Long,
Long>>();
+		Map<String, Map<Long, Double>> queryPerformances = new HashMap<String, Map<Long,
Double>>();
 		
 		for (String cluster : clusters) {
 			List<String> tables = client.tableListByCluster(cluster);
 
-			Map<Long, List<Long>> queryPerfs = new TreeMap<Long, List<Long>>();
+			Map<Long, List<Double>> queryPerfs = new TreeMap<Long, List<Double>>();
 			Map<Long, Long> clusterQueries = new TreeMap<Long,Long>();
 			
 			for (String table : tables) {
@@ -83,7 +83,7 @@ public class QueryUtil {
 						cal.set(Calendar.SECOND, 0);
 						cal.set(Calendar.MILLISECOND, 0);
 						clusterQueries.put(cal.getTimeInMillis(), 0L);
-						queryPerfs.put(cal.getTimeInMillis(), new ArrayList<Long>(Arrays.asList(new Long[]{0L})));
+						queryPerfs.put(cal.getTimeInMillis(), new ArrayList<Double>(Arrays.asList(new
Double[]{0.0})));
 					} else {
 						for (String queryId : queryIds) {
 							BlurQueryStatus status = client.queryStatusById(table, queryId);
@@ -103,10 +103,10 @@ public class QueryUtil {
 					}
 				}
 			}
-			Map<Long, Long> clusterQueryPerfs = new TreeMap<Long,Long>();
-			for (Map.Entry<Long, List<Long>> perfEntry : queryPerfs.entrySet()) {
-				long sum = 0;
-				for (Long perf : perfEntry.getValue()) {
+			Map<Long, Double> clusterQueryPerfs = new TreeMap<Long,Double>();
+			for (Map.Entry<Long, List<Double>> perfEntry : queryPerfs.entrySet()) {
+				double sum = 0.0;
+				for (Double perf : perfEntry.getValue()) {
 					sum += perf;
 				}
 				clusterQueryPerfs.put(perfEntry.getKey(), (sum/perfEntry.getValue().size()));
@@ -132,16 +132,16 @@ public class QueryUtil {
 		queries.put(cal.getTimeInMillis(), previousCount + 1);
 	}
 	
-	private static void collectQueryPerformance(Map<Long, List<Long>> queries, Calendar
cal, BlurQueryStatus status) {
-		List<Long> perfs = queries.get(cal.getTimeInMillis());
+	private static void collectQueryPerformance(Map<Long, List<Double>> queries,
Calendar cal, BlurQueryStatus status) {
+		List<Double> perfs = queries.get(cal.getTimeInMillis());
 		if (perfs == null) {
-			perfs = new ArrayList<Long>();
+			perfs = new ArrayList<Double>();
 			queries.put(cal.getTimeInMillis(), perfs);
 		}
 		
 		Map<String, CpuTime> cpuTimes = status.getCpuTimes();
 		for (CpuTime cpu : cpuTimes.values()) {
-			perfs.add(cpu.getRealTime());
+			perfs.add(cpu.getRealTime()/1000000.0);
 		}
 	}
 }

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/43de53df/contrib/blur-console/src/main/resources/org/apache/blur/console/webapp/css/console.css
----------------------------------------------------------------------
diff --git a/contrib/blur-console/src/main/resources/org/apache/blur/console/webapp/css/console.css
b/contrib/blur-console/src/main/resources/org/apache/blur/console/webapp/css/console.css
index 7b1f161..b7bb6b4 100644
--- a/contrib/blur-console/src/main/resources/org/apache/blur/console/webapp/css/console.css
+++ b/contrib/blur-console/src/main/resources/org/apache/blur/console/webapp/css/console.css
@@ -49,44 +49,6 @@ nav.navbar-inverse .navbar-brand { color: #fff; }
     border: none;
 }
 
-/* Remove border on bottom, left, right */
-/*.tabs-left > .nav-tabs { border-bottom: 0; }*/
-
-/* Show/hide tabbable areas */
-/*.tab-content > .tab-pane { display: none; }
-.tab-content > .active { display: block; }
-
-.tabs-left > .nav-tabs > li {
-    float: none;
-}
-.tabs-left > .nav-tabs > li > a {
-    min-width: 74px;
-    margin-right: 0;
-    margin-bottom: 3px;
-}
-
-.tabs-left > .nav-tabs {
-   float: left;
-   margin-right: 19px;
-   border-right: 1px solid #ddd;
-}
-.tabs-left > .nav-tabs > li > a {
-    margin-right: -1px;
-    -webkit-border-radius: 4px 0 0 4px;
-    -moz-border-radius: 4px 0 0 4px;
-    border-radius: 4px 0 0 4px;
-}
-.tabs-left > .nav-tabs > li > a:hover,
-.tabs-left > .nav-tabs > li > a:focus {
-    border-color: #eee #ddd #eee #eee;
-}
-.tabs-left > .nav-tabs .active > a,
-.tabs-left > .nav-tabs .active > a:hover,
-.tabs-left > .nav-tabs .active > a:focus {
-    border-color: #ddd transparent #ddd #ddd;
-    *border-right-color: #fff;
-}*/
-
 .tab-content {
     overflow: auto; /* prevent content from running below tabs */
 }
@@ -101,11 +63,6 @@ nav.navbar-inverse .navbar-brand { color: #fff; }
     margin-bottom: 5px;
 }
 
-.horizontal-chart-holder {
-    border-right: 1px solid #CCC;
-}
-
-.vertical-chart-holder {
-    border-top: 1px solid #CCC;
-    margin-top: 29px;
-}
+.dashboard-tile-odd {
+    background-color: #EEE;
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/43de53df/contrib/blur-console/src/main/resources/org/apache/blur/console/webapp/js/dashboard.js
----------------------------------------------------------------------
diff --git a/contrib/blur-console/src/main/resources/org/apache/blur/console/webapp/js/dashboard.js
b/contrib/blur-console/src/main/resources/org/apache/blur/console/webapp/js/dashboard.js
index 66876cd..f126cac 100644
--- a/contrib/blur-console/src/main/resources/org/apache/blur/console/webapp/js/dashboard.js
+++ b/contrib/blur-console/src/main/resources/org/apache/blur/console/webapp/js/dashboard.js
@@ -95,11 +95,11 @@ blurApp.controller('DashboardCtrl', function($scope, $http, $timeout)
{
                     }
                 });
             });
-            angular.forEach(counterCopy, function(cluster){
-                if (cluster['data'].length > 10) {
-                    cluster['data'] = cluster['data'].slice();
+            for (var i = 0; i < counterCopy.length; i++) {
+                if (counterCopy[i]['data'].length > 10) {
+                    counterCopy[i]['data'].shift();
                 }
-            });
+            }
             $scope.queryData.counters = counterCopy;
 
             var perfCopy = angular.copy($scope.queryData.performance);
@@ -133,11 +133,11 @@ blurApp.controller('DashboardCtrl', function($scope, $http, $timeout)
{
                     }
                 });
             });
-            angular.forEach(perfCopy, function(cluster){
-                if (cluster['data'].length > 10) {
-                    cluster['data'] = cluster['data'].slice();
+            for (var i = 0; i < perfCopy.length; i++) {
+                if (perfCopy[i]['data'].length > 10) {
+                    perfCopy[i]['data'].shift();
                 }
-            });
+            }
             $scope.queryData.performance = perfCopy;
             $scope.queryData.clusters = data.clusters;
 

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/43de53df/contrib/blur-console/src/main/resources/org/apache/blur/console/webapp/js/directives.js
----------------------------------------------------------------------
diff --git a/contrib/blur-console/src/main/resources/org/apache/blur/console/webapp/js/directives.js
b/contrib/blur-console/src/main/resources/org/apache/blur/console/webapp/js/directives.js
index 8b823f8..e42d856 100644
--- a/contrib/blur-console/src/main/resources/org/apache/blur/console/webapp/js/directives.js
+++ b/contrib/blur-console/src/main/resources/org/apache/blur/console/webapp/js/directives.js
@@ -185,7 +185,7 @@ blurApp.directive('linechart', ['flotrService', '$window', function(flotrService
 					if (!data) return;
 
 					var width = element.parent()[0].clientWidth - 150,
-						height = width;
+						height = width/2;
 
 					element.css('height', height);
 					element.css('width', width);
@@ -199,7 +199,7 @@ blurApp.directive('linechart', ['flotrService', '$window', function(flotrService
 						xaxisobj['mode'] = 'time'
 						xaxisobj['timeMode'] = 'Local'
 						xaxisobj['timeFormat'] = "%h:%M"
-						xaxisobj['noTicks'] = data[0]['data'].length == 0 ? 1 : data[0]['data'].length
+						xaxisobj['noTicks'] = data[0] == null || data[0]['data'].length == 0 ? 1 : data[0]['data'].length
 					}
 
 					Flotr.draw(element[0], data, {

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/43de53df/contrib/blur-console/src/main/resources/org/apache/blur/console/webapp/partials/dashboard.tpl.html
----------------------------------------------------------------------
diff --git a/contrib/blur-console/src/main/resources/org/apache/blur/console/webapp/partials/dashboard.tpl.html
b/contrib/blur-console/src/main/resources/org/apache/blur/console/webapp/partials/dashboard.tpl.html
index 829e84e..7b85740 100644
--- a/contrib/blur-console/src/main/resources/org/apache/blur/console/webapp/partials/dashboard.tpl.html
+++ b/contrib/blur-console/src/main/resources/org/apache/blur/console/webapp/partials/dashboard.tpl.html
@@ -23,7 +23,7 @@ Licensed to the Apache Software Foundation (ASF) under one
     <div class="row">
         <div class="col-md-8">
             <div class="row">
-                <div class="col-md-6 text-center horizontal-chart-holder">
+                <div class="col-md-6 text-center dashboard-tile-odd">
                     <h4>Zookeepers</h4>
                     <div ng-if="!nodeData.zookeepers.errmsg">
                         <div piechart chartdata="nodeData.zookeepers.chart"></div>
@@ -67,7 +67,7 @@ Licensed to the Apache Software Foundation (ASF) under one
         </div>
         <div class="col-md-4">
             <div class="row">
-                <div class="col-md-12 text-center">
+                <div class="col-md-12 text-center dashboard-tile-odd">
                     <h4>Shards</h4>
                     <div ng-repeat="cluster in nodeData.clusters" class="text-center">
                         <div ng-if="!cluster.errmsg">


Mime
View raw message