You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by ps...@apache.org on 2019/03/28 12:30:14 UTC

[hbase] branch branch-1.4 updated: HBASE-21781 list_deadservers elapsed time is incorrect

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

psomogyi pushed a commit to branch branch-1.4
in repository https://gitbox.apache.org/repos/asf/hbase.git


The following commit(s) were added to refs/heads/branch-1.4 by this push:
     new 8a7a65d  HBASE-21781 list_deadservers elapsed time is incorrect
8a7a65d is described below

commit 8a7a65d6608e8e2df087984410fec1cf3f6c6f75
Author: xuqinya <xu...@163.com>
AuthorDate: Thu Mar 28 13:24:49 2019 +0100

    HBASE-21781 list_deadservers elapsed time is incorrect
---
 hbase-shell/src/main/ruby/shell/commands/clear_deadservers.rb | 7 ++++++-
 hbase-shell/src/main/ruby/shell/commands/list_deadservers.rb  | 3 ++-
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/hbase-shell/src/main/ruby/shell/commands/clear_deadservers.rb b/hbase-shell/src/main/ruby/shell/commands/clear_deadservers.rb
index 19f1fcd..74585cc 100644
--- a/hbase-shell/src/main/ruby/shell/commands/clear_deadservers.rb
+++ b/hbase-shell/src/main/ruby/shell/commands/clear_deadservers.rb
@@ -34,7 +34,10 @@ module Shell
         EOF
       end
 
+      # rubocop:disable Metrics/AbcSize
+      # rubocop:disable Metrics/MethodLength
       def command(*dead_servers)
+        now = Time.now
         servers = admin.clear_deadservers(dead_servers)
         if servers.size <= 0
           formatter.row(['true'])
@@ -44,9 +47,11 @@ module Shell
           servers.each do |server|
             formatter.row([server.toString])
           end
-          formatter.footer(servers.size)
+          formatter.footer(now, servers.size)
         end
       end
+      # rubocop:enable Metrics/AbcSize
+      # rubocop:enable Metrics/MethodLength
     end
   end
 end
diff --git a/hbase-shell/src/main/ruby/shell/commands/list_deadservers.rb b/hbase-shell/src/main/ruby/shell/commands/list_deadservers.rb
index be3f0bf..69c7e72 100644
--- a/hbase-shell/src/main/ruby/shell/commands/list_deadservers.rb
+++ b/hbase-shell/src/main/ruby/shell/commands/list_deadservers.rb
@@ -29,6 +29,7 @@ module Shell
       end
 
       def command
+        now = Time.now
         formatter.header(['SERVERNAME'])
 
         servers = admin.list_deadservers
@@ -36,7 +37,7 @@ module Shell
           formatter.row([server.toString])
         end
 
-        formatter.footer(servers.size)
+        formatter.footer(now, servers.size)
       end
     end
   end