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

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

Signed-off-by: tedyu <yuzhihong@gmail.com>
This commit is contained in:
Zach York 2017-06-15 17:10:07 -07:00 committed by Michael Stack
parent b5a24b6696
commit 036fce3cf8
2 changed files with 5 additions and 1 deletions

View File

@ -122,6 +122,9 @@ public interface MetricsMasterWrapper {
*/ */
long getMergePlanCount(); long getMergePlanCount();
/**
* Get the time in Millis when the master finished initializing/becoming the active master
*/
/** /**
* Get the time in Millis when the master finished initializing/becoming the active master * Get the time in Millis when the master finished initializing/becoming the active master
*/ */

View File

@ -894,7 +894,8 @@ public class HMaster extends HRegionServer implements MasterServices, Server {
} }
status.markComplete("Initialization successful"); 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(); this.masterFinishedInitializationTime = System.currentTimeMillis();
configurationManager.registerObserver(this.balancer); configurationManager.registerObserver(this.balancer);