Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(199)

Unified Diff: gm/rebaseline_server/static/loader.js

Issue 189833008: rebaseline_server: display how long it took to render the list (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: delete comment Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | gm/rebaseline_server/static/view.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/rebaseline_server/static/loader.js
diff --git a/gm/rebaseline_server/static/loader.js b/gm/rebaseline_server/static/loader.js
index 9926193fc2564bdc494ec32f00f8cbc47172d8e0..254d0fda05e1956ab39537fc7663bb443414c520 100644
--- a/gm/rebaseline_server/static/loader.js
+++ b/gm/rebaseline_server/static/loader.js
@@ -8,6 +8,21 @@ var Loader = angular.module(
['ConstantsModule', 'diff_viewer']
);
+Loader.directive(
+ 'resultsUpdatedCallbackDirective',
+ ['$timeout',
+ function($timeout) {
+ return function(scope, element, attrs) {
+ if (scope.$last) {
+ $timeout(function() {
+ scope.resultsUpdatedCallback();
+ });
+ }
+ };
+ }
+ ]
+);
+
// TODO(epoger): Combine ALL of our filtering operations (including
// truncation) into this one filter, so that runs most efficiently?
// (We would have to make sure truncation still took place after
@@ -44,7 +59,7 @@ Loader.filter(
Loader.controller(
'Loader.Controller',
- function($scope, $http, $filter, $location, $timeout, constants) {
+ function($scope, $http, $filter, $location, $log, $timeout, constants) {
$scope.constants = constants;
$scope.windowTitle = "Loading GM Results...";
$scope.resultsToLoad = $location.search().resultsToLoad;
@@ -77,7 +92,6 @@ Loader.controller(
$scope.imageSets = data[constants.KEY__IMAGESETS];
$scope.sortColumnSubdict = constants.KEY__DIFFERENCE_DATA;
$scope.sortColumnKey = constants.KEY__DIFFERENCE_DATA__WEIGHTED_DIFF;
- $scope.showTodos = false;
$scope.showSubmitAdvancedSettings = false;
$scope.submitAdvancedSettings = {};
@@ -357,6 +371,8 @@ Loader.controller(
* can be bookmarked.
*/
$scope.updateResults = function() {
+ $scope.renderStartTime = window.performance.now();
+ $log.debug("renderStartTime: " + $scope.renderStartTime);
$scope.displayLimit = $scope.displayLimitPending;
// TODO(epoger): Every time we apply a filter, AngularJS creates
// another copy of the array. Is there a way we can filter out
@@ -404,6 +420,15 @@ Loader.controller(
}
/**
+ * This function is called when the results have been completely rendered
+ * after updateResults().
+ */
+ $scope.resultsUpdatedCallback = function() {
+ $scope.renderEndTime = window.performance.now();
+ $log.debug("renderEndTime: " + $scope.renderEndTime);
+ }
+
+ /**
* Re-sort the displayed results.
*
* @param subdict (string): which subdictionary
« no previous file with comments | « no previous file | gm/rebaseline_server/static/view.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698