markusthoemmes commented on a change in pull request #2968: add additional
metrics and logs
URL:
https://github.com/apache/incubator-openwhisk/pull/2968#discussion_r155719943
##########
File path:
core/invoker/src/main/scala/whisk/core/containerpool/ContainerPool.scala
##########
@@ -78,27 +73,56 @@ class ContainerPool(childFactory: ActorRefFactory =>
ActorRef,
}
}
+ def logContainerStart(r: Run, containerState: String): Unit = {
+ val namespaceName = r.msg.user.namespace.name
+ val actionName = r.action.name.name
+ val activationId = r.msg.activationId.toString
+
+ r.msg.transid.mark(
+ this,
+ LoggingMarkers.INVOKER_CONTAINER_START(actionName, namespaceName,
containerState),
+ s"containerStart containerState: $containerState action: $actionName
namespace: $namespaceName activationId: $activationId",
+ akka.event.Logging.InfoLevel)
+ }
+
def receive: Receive = {
// A job to run on a container
case r: Run =>
val container = if (busyPool.size < maxActiveContainers) {
+
// Schedule a job to a warm container
ContainerPool
.schedule(r.action, r.msg.user.namespace, freePool)
+ .map(container => {
Review comment:
These are all `Option`, not `Future`. We unfortunately cannot move this
outside of the innerts of the logic (now) because at the end you just get an
ActorRef. You cannot determine from which branch it was.
We could, of course, create wrapping types for each possible return and log
based on that at the very end of the decision.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services