This is an automated email from the ASF dual-hosted git repository.

bbannier pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mesos.git

commit 91c78396a72c445f450db8b22c13b96faf431bce
Author: Benjamin Bannier <[email protected]>
AuthorDate: Wed Jul 31 13:46:41 2019 +0200

    Added expected drain end time to webui's agent screen.
    
    Review: https://reviews.apache.org/r/71184/
---
 src/webui/app/agents/agent.html | 4 ++--
 src/webui/app/controllers.js    | 7 +++++++
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/src/webui/app/agents/agent.html b/src/webui/app/agents/agent.html
index 02c5462..b929872 100644
--- a/src/webui/app/agents/agent.html
+++ b/src/webui/app/agents/agent.html
@@ -61,8 +61,8 @@
         <dl class="inline clearfix">
           <dt>Mark gone:</dt>
           <dd>{{agent.drain_config.mark_gone}}</dd>
-          <dt ng-if="agent.drain_config.max_grace_period.nanoseconds">Max. 
grace period:</dt>
-          <dd 
ng-if="agent.drain_config.max_grace_period.nanoseconds">{{agent.drain_config.max_grace_period.nanoseconds
 / 1000000000}} seconds</dd>
+          <dt ng-if="agent.estimated_drain_end_time_seconds">Estimated drain 
end time:</dt>
+          <dd 
ng-if="agent.estimated_drain_end_time_seconds"><time>{{agent.estimated_drain_end_time_seconds
 * 1000| isoDate}}</time></dd>
         </dl>
       </span>
 
diff --git a/src/webui/app/controllers.js b/src/webui/app/controllers.js
index 725230f..58cc76d 100644
--- a/src/webui/app/controllers.js
+++ b/src/webui/app/controllers.js
@@ -721,6 +721,13 @@
           // of these flags are set.
           $scope.agent.log_file_attached = $scope.state.external_log_file || 
$scope.state.log_dir;
 
+          $scope.agent.drain_config = response.drain_config;
+          if (response.estimated_drain_start_time_seconds && 
response.drain_config.max_grace_period) {
+            $scope.agent.estimated_drain_end_time_seconds =
+              response.estimated_drain_start_time_seconds +
+              (response.drain_config.max_grace_period.nanoseconds / 
1000000000);
+          }
+
           // Convert the reserved resources map into an array for inclusion
           // in an `ng-repeat` table.
           $scope.agent.reserved_resources_as_array = 
_($scope.state.reserved_resources)

Reply via email to