Author: dmorozov
Date: 2007-06-15 09:27:33 -0400 (Fri, 15 Jun 2007)
New Revision: 1201
Modified:
trunk/sandbox/scrollable-grid/src/main/javascript/ClientUI/common/box/ScrollableBox.js
trunk/sandbox/scrollable-grid/src/main/javascript/ClientUI/controls/grid/FakeArrayDataModel.js
trunk/sandbox/scrollable-grid/src/main/javascript/ClientUI/controls/grid/Grid.js
trunk/sandbox/scrollable-grid/src/main/javascript/ClientUI/controls/grid/GridBody.js
trunk/sandbox/scrollable-grid/src/main/javascript/ClientUI/controls/grid/ScrollableGrid.js
trunk/sandbox/scrollable-grid/src/main/javascript/ClientUILib.js
Log:
Remove unneceserry logs. Add logs needed to check data loading from server performance by
scroll event
Modified:
trunk/sandbox/scrollable-grid/src/main/javascript/ClientUI/common/box/ScrollableBox.js
===================================================================
---
trunk/sandbox/scrollable-grid/src/main/javascript/ClientUI/common/box/ScrollableBox.js 2007-06-15
12:35:29 UTC (rev 1200)
+++
trunk/sandbox/scrollable-grid/src/main/javascript/ClientUI/common/box/ScrollableBox.js 2007-06-15
13:27:33 UTC (rev 1201)
@@ -64,7 +64,6 @@
updateLayout: function() {
// NOTE: not implemented in this class
ClientUI.common.box.ScrollableBox.parentClass.method("updateLayout").call(this);
- ClientUILib.log(ClientUILogger.INFO, "ScrollableBox::updateLayout");
},
getViewportScrollX: function() {
var scrollX = 0;
Modified:
trunk/sandbox/scrollable-grid/src/main/javascript/ClientUI/controls/grid/FakeArrayDataModel.js
===================================================================
---
trunk/sandbox/scrollable-grid/src/main/javascript/ClientUI/controls/grid/FakeArrayDataModel.js 2007-06-15
12:35:29 UTC (rev 1200)
+++
trunk/sandbox/scrollable-grid/src/main/javascript/ClientUI/controls/grid/FakeArrayDataModel.js 2007-06-15
13:27:33 UTC (rev 1201)
@@ -46,7 +46,7 @@
},
loadRows: function(options) {
-
+ window.loadingStartTime = (new Date()).getTime();
var state_options = options;
var state_input = $(this.gridId + "_state_input");
var submit_input = $(this.gridId + "_submit_input");
Modified:
trunk/sandbox/scrollable-grid/src/main/javascript/ClientUI/controls/grid/Grid.js
===================================================================
---
trunk/sandbox/scrollable-grid/src/main/javascript/ClientUI/controls/grid/Grid.js 2007-06-15
12:35:29 UTC (rev 1200)
+++
trunk/sandbox/scrollable-grid/src/main/javascript/ClientUI/controls/grid/Grid.js 2007-06-15
13:27:33 UTC (rev 1201)
@@ -63,9 +63,6 @@
},
createControl: function() {
- //TODO: delete
- document.gridStartTime = (new Date()).getTime();
-
var grid = this;
var layout = new ClientUI.layouts.GridLayoutManager(null, this.getElement());
this.layout = layout;
@@ -73,53 +70,26 @@
this.templates.each(function(item) {
switch(item.pane) {
case GridLayout_Enum.HEADER: {
- //TODO: delete
- document.headerStartTime = (new Date()).getTime();
-
var header = new ClientUI.controls.grid.GridHeader($(item.ref), grid);
layout.addPane(GridLayout_Enum.HEADER, header);
-
- //TODO: delete
- document.headerStopTime = (new Date()).getTime();
-
break;
}
case GridLayout_Enum.BODY: {
- //TODO: delete
- document.bodyStartTime = (new Date()).getTime();
-
var body = new ClientUI.controls.grid.GridBody($(item.ref), grid);
layout.addPane(GridLayout_Enum.BODY, body);
-
- //TODO: delete
- document.bodyStopTime = (new Date()).getTime();
-
break;
}
case GridLayout_Enum.FOOTER: {
- //TODO: delete
- document.footerStartTime = (new Date()).getTime();
-
var footer = new ClientUI.controls.grid.GridFooter($(item.ref), grid);
layout.addPane(GridLayout_Enum.FOOTER, footer);
-
- //TODO: delete
- document.footerStopTime = (new Date()).getTime();
-
break;
}
}
});
- //TODO: delete
- document.gridParseTime = (new Date()).getTime();
-
this.currentScrollPos = 0;
this.controlCreated = true;
this.updateLayout();
-
- //TODO: delete
- document.gridEndTime = (new Date()).getTime();
},
updateLayout: function() {
if(!this.controlCreated || this.getHeight()==0) {
Modified:
trunk/sandbox/scrollable-grid/src/main/javascript/ClientUI/controls/grid/GridBody.js
===================================================================
---
trunk/sandbox/scrollable-grid/src/main/javascript/ClientUI/controls/grid/GridBody.js 2007-06-15
12:35:29 UTC (rev 1200)
+++
trunk/sandbox/scrollable-grid/src/main/javascript/ClientUI/controls/grid/GridBody.js 2007-06-15
13:27:33 UTC (rev 1201)
@@ -71,18 +71,11 @@
},
_onDataReady: function(options) {
// load rows data
- var currTime = (new Date()).getTime();
+ window.loadingUpdateTime = (new Date()).getTime();
this.invalidate(options);
- var loadTime = (new Date()).getTime();
-
- ClientUILib.log(ClientUILogger.ERROR, "Total time of data loading of
"+options.count+" rows is: " + (loadTime - this.taskDefineTime) + "
miliseconds.");
- ClientUILib.log(ClientUILogger.WARNING, "start index: " + options.index +
", and startRow: " + options.startRow);
- ClientUILib.log(ClientUILogger.WARNING, "data prepare time: " +
(this.taskStartLoadingTime - this.taskStartTime));
-
- ClientUILib.log(ClientUILogger.WARNING, "data load time: " + (currTime -
document.cntStart));
- ClientUILib.log(ClientUILogger.WARNING, "invalidation time: " + (loadTime -
currTime));
+ window.loadingInvalidateTime = (new Date()).getTime();
},
_onContentVScroll: function(ypos) {
this.helpObject1.moveToY(this.sizeBox.getHeight()+ this.defaultRowHeight + 5);
@@ -366,8 +359,6 @@
}
this.updateStarted = true;
- this.taskStartTime = (new Date()).getTime();
-
var task = this._getPendingTask();
var range = $R(task.from, task.to);
var switchType = 5;
@@ -421,8 +412,6 @@
}
}
- this.taskStartLoadingTime = (new Date()).getTime();
-
var process = true;
if(startIndex > (task.first + this.dataVisible) ||
(startIndex + countToLoad) < task.first) {
@@ -430,13 +419,10 @@
}
if(countToLoad > 0 && process) {
this.updateStarted = true;
- ClientUILib.log(ClientUILogger.WARNING, "Start loading...");
- ClientUILib.log(ClientUILogger.WARNING, "start index: " + startIndex +
", and startRow: " + startRowIndx + ", and count: " + countToLoad);
+ ClientUILib.log(ClientUILogger.WARNING, "Start loading: index: " +
startIndex + ", and startRow: " + startRowIndx + ", and count: " +
countToLoad);
this.currRange = range;
this.currentPos = task.pos;
- this.taskDefineTime = (new Date()).getTime();
-
this.showSplash();
this.container.hide();
@@ -617,8 +603,6 @@
* @param {Object} options
*/
invalidate: function(options) {
-
- ClientUILib.log(ClientUILogger.WARNING, "Stop loading.");
screen.updateInterval = this.updateInterval;
setTimeout(function () {
Modified:
trunk/sandbox/scrollable-grid/src/main/javascript/ClientUI/controls/grid/ScrollableGrid.js
===================================================================
---
trunk/sandbox/scrollable-grid/src/main/javascript/ClientUI/controls/grid/ScrollableGrid.js 2007-06-15
12:35:29 UTC (rev 1200)
+++
trunk/sandbox/scrollable-grid/src/main/javascript/ClientUI/controls/grid/ScrollableGrid.js 2007-06-15
13:27:33 UTC (rev 1201)
@@ -36,7 +36,8 @@
init: function(){
// mark that grid control initialized
- this.initialized = true;
+ if(!this.isInitialized) {
+ this.isInitialized = true;
ClientUI.controls.grid.ScrollableGrid.parentClass.constructor().call(this,
this.client_id, this.dataModel, this.templates);
var progress = new ClientUI.common.box.SplashBox(this.splash_id, null, 300, true);
@@ -48,6 +49,7 @@
if (this.startUpTime) {
ClientUILib.log(ClientUILogger.ERROR, "Load Time'" + (new
Date().getTime() - this.startUpTime) + "' ms");
}
+ }
},
onSortComplete : function(request, event, data){
@@ -60,10 +62,19 @@
onScrollComplete : function(request, event, data){
var options = this.dataModel.getCurrentOptions();
+ window.loadingServerTime = (new Date()).getTime();
Utils.AJAX.updateRows(options,request,this,this.client_id,
[this.updateSelectionCallBack]);
if (this.selectionManager) {
this.selectionManager.restoreState();
}
+ window.loadingEndTime = (new Date()).getTime();
+
+ // TODO: remove this time statistic logging
+ ClientUILib.log(ClientUILogger.ERROR, "Total time of data loading of
"+options.count+" rows is: " + (window.loadingEndTime -
window.loadingStartTime) + " miliseconds.");
+ ClientUILib.log(ClientUILogger.WARNING, "...Server load time: " +
(window.loadingServerTime - window.loadingStartTime));
+ ClientUILib.log(ClientUILogger.WARNING, "...DOM updated time: " +
(window.loadingUpdateTime - window.loadingServerTime));
+ ClientUILib.log(ClientUILogger.WARNING, "...Grid invalidation time: " +
(window.loadingInvalidateTime - window.loadingUpdateTime));
+ ClientUILib.log(ClientUILogger.WARNING, "...Selection mng time: " +
(window.loadingEndTime - window.loadingInvalidateTime));
},
onSorted: function(sortEvent) {
Modified: trunk/sandbox/scrollable-grid/src/main/javascript/ClientUILib.js
===================================================================
--- trunk/sandbox/scrollable-grid/src/main/javascript/ClientUILib.js 2007-06-15 12:35:29
UTC (rev 1200)
+++ trunk/sandbox/scrollable-grid/src/main/javascript/ClientUILib.js 2007-06-15 13:27:33
UTC (rev 1201)
@@ -81,7 +81,6 @@
}
});
this.packages[libName] = true;
- ClientUILib.log(ClientUILogger.INFO, "ClientUILib::declarePackage '" +
libName + "'");
},
log: function(level, infoText) {
if(ClientUILogger.isCreated)
@@ -124,7 +123,7 @@
// flag logger is initialized
isCreated: false,
width: 460,
- height: 150,
+ height: 90,
create: function() {
this.logElement = $(document.createElement("div"));
this.logElement.setStyle({position: 'absolute'});
@@ -149,8 +148,11 @@
this.logElement.setStyle({width: this.width + 'px'});
this.logElement.setStyle({height: this.height + 'px'});
//this.logElement.setStyle({top: (this.getWindowHeight() - this.height - 10) +
'px'});
- this.logElement.setStyle({top: 10 + 'px'});
- this.logElement.setStyle({left: (this.getWindowWidth() - this.width - 10) +
'px'});
+ //this.logElement.setStyle({top: 10 + 'px'});
+ //this.logElement.setStyle({left: (this.getWindowWidth() - this.width - 10) +
'px'});
+ this.logElement.setStyle({top: '0px'});
+ this.logElement.setStyle({left: '250px'});
+ this.logElement.setStyle({zIndex: '1000'});
}
},
log: function(level, infoText) {