You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2021/06/04 15:11:35 UTC

[GitHub] [pulsar] cckellogg commented on a change in pull request #10819: Log number of seconds it takes the broker to bootstrap

cckellogg commented on a change in pull request #10819:
URL: https://github.com/apache/pulsar/pull/10819#discussion_r645648185



##########
File path: pulsar-broker/src/main/java/org/apache/pulsar/broker/PulsarService.java
##########
@@ -801,12 +803,16 @@ public Boolean get() {
                 this.resourceUsageTransportManager = (ResourceUsageTransportManager) object;
             }
 
+            long now = System.currentTimeMills();
+            double elapsedSeconds = (now - serviceStartTime) / 1000d;

Review comment:
       We could use the TimeUnit class to make the conversion for us.
   ```
   final long bootstrapTimeSeconds =
                       TimeUnit.MILLISECONDS.toSeconds(System.currentTimeMillis() - startTimestamp);
   ```

##########
File path: pulsar-broker/src/main/java/org/apache/pulsar/broker/PulsarService.java
##########
@@ -801,12 +803,16 @@ public Boolean get() {
                 this.resourceUsageTransportManager = (ResourceUsageTransportManager) object;
             }
 
+            long now = System.currentTimeMills();
+            double elapsedSeconds = (now - serviceStartTime) / 1000d;
+            
             final String bootstrapMessage = "bootstrap service "
                     + (config.getWebServicePort().isPresent() ? "port = " + config.getWebServicePort().get() : "")
                     + (config.getWebServicePortTls().isPresent() ? ", tls-port = " + config.getWebServicePortTls() : "")
                     + (config.getBrokerServicePort().isPresent() ? ", broker url= " + brokerServiceUrl : "")
                     + (config.getBrokerServicePortTls().isPresent() ? ", broker tls url= " + brokerServiceUrlTls : "");
             LOG.info("messaging service is ready");

Review comment:
       Instead of adding new log we could add to the log above.
   ```
   LOG.info("messaging service is ready bootstrap_seconds={}", bootstrapTimeSeconds)
   ```




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org