You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openwhisk.apache.org by cs...@apache.org on 2018/08/23 20:10:26 UTC

[incubator-openwhisk] branch master updated: Log activation retrieval from activation store for block invocations (#3980)

This is an automated email from the ASF dual-hosted git repository.

csantanapr pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-openwhisk.git


The following commit(s) were added to refs/heads/master by this push:
     new 71cd88a  Log activation retrieval from activation store for block invocations (#3980)
71cd88a is described below

commit 71cd88ad1d555347066d11f3037a2c565f861100
Author: James Dubee <jw...@us.ibm.com>
AuthorDate: Thu Aug 23 16:10:20 2018 -0400

    Log activation retrieval from activation store for block invocations (#3980)
---
 common/scala/src/main/scala/whisk/common/Logging.scala            | 2 ++
 .../scala/whisk/core/controller/actions/PrimitiveActions.scala    | 8 +++++++-
 docs/metrics.md                                                   | 4 ++++
 3 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/common/scala/src/main/scala/whisk/common/Logging.scala b/common/scala/src/main/scala/whisk/common/Logging.scala
index 31d42a7..8149774 100644
--- a/common/scala/src/main/scala/whisk/common/Logging.scala
+++ b/common/scala/src/main/scala/whisk/common/Logging.scala
@@ -260,6 +260,8 @@ object LoggingMarkers {
   // Time of the activation in controller until it is delivered to Kafka
   val CONTROLLER_ACTIVATION = LogMarkerToken(controller, activation, start)
   val CONTROLLER_ACTIVATION_BLOCKING = LogMarkerToken(controller, "blockingActivation", start)
+  val CONTROLLER_ACTIVATION_BLOCKING_DATABASE_RETRIEVAL =
+    LogMarkerToken(controller, "blockingActivationDatabaseRetrieval", count)
 
   // Time that is needed load balance the activation
   val CONTROLLER_LOADBALANCER = LogMarkerToken(controller, loadbalancer, start)
diff --git a/core/controller/src/main/scala/whisk/core/controller/actions/PrimitiveActions.scala b/core/controller/src/main/scala/whisk/core/controller/actions/PrimitiveActions.scala
index 4a0b0ec..d0d4f60 100644
--- a/core/controller/src/main/scala/whisk/core/controller/actions/PrimitiveActions.scala
+++ b/core/controller/src/main/scala/whisk/core/controller/actions/PrimitiveActions.scala
@@ -613,7 +613,13 @@ protected[actions] trait PrimitiveActions {
     if (!result.isCompleted && retries < maxRetries) {
       val schedule = actorSystem.scheduler.scheduleOnce(wait(retries)) {
         activationStore.get(ActivationId(docid.asString), context).onComplete {
-          case Success(activation)             => result.trySuccess(Right(activation))
+          case Success(activation) =>
+            transid.mark(
+              this,
+              LoggingMarkers.CONTROLLER_ACTIVATION_BLOCKING_DATABASE_RETRIEVAL,
+              s"retrieved activation for blocking invocation via DB polling",
+              logLevel = InfoLevel)
+            result.trySuccess(Right(activation))
           case Failure(_: NoDocumentException) => pollActivation(docid, context, result, wait, retries + 1, maxRetries)
           case Failure(t: Throwable)           => result.tryFailure(t)
         }
diff --git a/docs/metrics.md b/docs/metrics.md
index 3569c9a..33e2b7e 100644
--- a/docs/metrics.md
+++ b/docs/metrics.md
@@ -110,6 +110,10 @@ Metrics below are emitted from within a Controller instance.
   * Example _openwhisk.counter.controller_startup0_count_
   * Records count of controller instance startup
 
+##### Controller Activation Retrieval During Blocking Invocations
+
+* `openwhisk.counter.controller_blockingActivationDatabaseRetrieval_count` (counter) - Records the count of activations the controller has retrieved from the activation store during blocking invocations
+
 ##### Activation Submission
 
 Following metrics record stats around activation handling within Controller