HBASE-18520 Add jmx value to determine true Master Start time

This is to determine how long it took in total for the master to start and 
finish initializing.

Signed-off-by: tedyu <yuzhih...@gmail.com>


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/dab22184
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/dab22184
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/dab22184

Branch: refs/heads/branch-1.4
Commit: dab22184ec684ea24cb86d5785e962f8ff2cf670
Parents: 747156a
Author: Zach York <zy...@amazon.com>
Authored: Thu Jun 15 17:10:07 2017 -0700
Committer: Michael Stack <st...@apache.org>
Committed: Tue Aug 8 16:06:13 2017 +0800

----------------------------------------------------------------------
 .../src/main/java/org/apache/hadoop/hbase/master/HMaster.java     | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/dab22184/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java
----------------------------------------------------------------------
diff --git 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java
index 950ea4a..5b1aed6 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java
@@ -894,7 +894,8 @@ public class HMaster extends HRegionServer implements 
MasterServices, Server {
     }
 
     status.markComplete("Initialization successful");
-    LOG.info("Master has completed initialization");
+    LOG.info(String.format("Master has completed initialization %.3fsec",
+       (System.currentTimeMillis() - masterActiveTime) / 1000.0f));
     this.masterFinishedInitializationTime = System.currentTimeMillis();
     configurationManager.registerObserver(this.balancer);
 

Reply via email to