瀏覽代碼

HUE-1499 [hbase] Extraneous GA logs

Kevin Wang 12 年之前
父節點
當前提交
62116e0
共有 3 個文件被更改,包括 9 次插入6 次删除
  1. 2 2
      apps/hbase/static/js/app.js
  2. 0 2
      apps/hbase/static/js/controls.js
  3. 7 2
      apps/hbase/static/js/utils.js

+ 2 - 2
apps/hbase/static/js/app.js

@@ -107,7 +107,7 @@ routie({
       routed = true;
     },
     ':cluster/:table': function(cluster, table) {
-      //logGA('view_table'); taken care of in reload()\
+      logGA('view_table');
       Router.setTable(cluster, table);
       resetSearch();
       app.station('table');
@@ -137,7 +137,7 @@ routie({
       routed = true;
     },
     '*': function() {
-      logGA();
+      logGA('');
       if(!routed)
         history.back();
       routed = false;

+ 0 - 2
apps/hbase/static/js/controls.js

@@ -85,7 +85,6 @@ var DataTableViewModel = function(options) {
   };
   var _reload = self.reload;
   self.reload = function(callback) {
-    logGA('view_cluster');
     if(self._table) {
       self._table.fnClearTable();
       self._table.fnDestroy();
@@ -310,7 +309,6 @@ var SmartViewModel = function(options) {
   };
   var _reload = self.reload;
   self.reload = function(callback) {
-  	logGA('view_table');
     var queryStart = new Date();
     _reload(function() {
       self.lastReloadTime((new Date() - queryStart)/1000);

+ 7 - 2
apps/hbase/static/js/utils.js

@@ -220,10 +220,15 @@ function prepForTransport(value) {
 };
 
 function logGA(postfix) {
+  function doLog() {
+    trackOnGA('hbase/' + postfix);
+  }
   if(postfix == null)
-    postfix = ""
+    postfix = "";
   if (typeof trackOnGA == 'function') {
-    trackOnGA('hbase/' + postfix);
+    doLog();
+  } else {
+    setTimeout(doLog, 10);
   }
 };