You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by be...@apache.org on 2012/12/20 19:34:17 UTC
svn commit: r1424619 -
/incubator/mesos/trunk/src/webui/master/static/controllers.js
Author: benh
Date: Thu Dec 20 18:34:16 2012
New Revision: 1424619
URL: http://svn.apache.org/viewvc?rev=1424619&view=rev
Log:
Changed the webui polling interval to be based on the cluster size
(i.e., number of nodes).
From: Ben Mahler <be...@gmail.com>
Review: https://reviews.apache.org/r/8135
Modified:
incubator/mesos/trunk/src/webui/master/static/controllers.js
Modified: incubator/mesos/trunk/src/webui/master/static/controllers.js
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/src/webui/master/static/controllers.js?rev=1424619&r1=1424618&r2=1424619&view=diff
==============================================================================
--- incubator/mesos/trunk/src/webui/master/static/controllers.js (original)
+++ incubator/mesos/trunk/src/webui/master/static/controllers.js Thu Dec 20 18:34:16 2012
@@ -76,6 +76,30 @@ function pailer(host, path, window_title
}
+function updateInterval(num_slaves) {
+ // TODO(bmahler): Increasing the update interval for large clusters
+ // is done purely to mitigate webui performance issues. Ideally we can
+ // keep a consistently fast rate for updating statistical information.
+ // For the full system state updates, it may make sense to break
+ // it up using pagination and/or splitting the endpoint.
+ if (num_slaves < 10) {
+ return 3000;
+ } else if (num_slaves < 50) {
+ return 4000;
+ } else if (num_slaves < 100) {
+ return 5000;
+ } else if (num_slaves < 500) {
+ return 10000;
+ } else if (num_slaves < 1000) {
+ return 20000;
+ } else if (num_slaves < 5000) {
+ return 30000;
+ } else {
+ return 60000;
+ }
+}
+
+
// Update the outermost scope with the new state.
function update($scope, $defer, data) {
// Don't do anything if the data hasn't changed.
@@ -252,7 +276,7 @@ function MainCntl($scope, $http, $route,
{transformResponse: function(data) { return data; }})
.success(function(data) {
if (update($scope, $defer, data)) {
- $scope.delay = 2000;
+ $scope.delay = updateInterval(_.size($scope.slaves));
$defer(poll, $scope.delay);
}
})