openwhisk-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [incubator-openwhisk] SugandhaAgrawal commented on a change in pull request #4520: Log more diagnostic info when invoker / controller cluster status changes
Date Tue, 25 Jun 2019 12:31:55 GMT
SugandhaAgrawal commented on a change in pull request #4520: Log more diagnostic info when
invoker / controller cluster status changes
URL: https://github.com/apache/incubator-openwhisk/pull/4520#discussion_r297161769
 
 

 ##########
 File path: core/controller/src/main/scala/org/apache/openwhisk/core/loadBalancer/ShardingContainerPoolBalancer.scala
 ##########
 @@ -542,7 +553,20 @@ case class ShardingContainerPoolBalancerState(
       _invokerSlots = _invokers.map { invoker =>
         new NestedSemaphore[FullyQualifiedEntityName](getInvokerSlot(invoker.id.userMemory).toMB.toInt)
       }
-      logging.info(this, s"loadbalancer cluster size changed to $actualSize active nodes.")(TransactionId.loadbalancer)
+      // Directly after startup, no invokers have registered yet. This needs to be handled
gracefully.
+      val invokerCount = _invokers.size
+      val totalInvokerMemory =
+        _invokers.foldLeft(0L)((total, invoker) => total + getInvokerSlot(invoker.id.userMemory).toMB).MB
+      val averageInvokerMemory =
+        if (totalInvokerMemory.toMB > 0 && invokerCount > 0) {
+          (totalInvokerMemory / invokerCount).toMB.MB
+        } else {
+          0.MB
+        }
+      logging.info(
+        this,
+        s"loadbalancer cluster size changed to $actualSize active nodes. ${invokerCount}
invokers with ${averageInvokerMemory} average memory size - total invoker memory ${totalInvokerMemory}.")(
 
 Review comment:
   cluster size from $_clusterSize to $actualSize would be better 

----------------------------------------------------------------
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


With regards,
Apache Git Services

Mime
View raw message