You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@openwhisk.apache.org by GitBox <gi...@apache.org> on 2019/11/19 04:43:32 UTC

[GitHub] [openwhisk] chetanmeh commented on a change in pull request #4726: Recording metrics for action result response statusCode in user-events service.

chetanmeh commented on a change in pull request #4726: Recording metrics for action result response statusCode in user-events service. 
URL: https://github.com/apache/openwhisk/pull/4726#discussion_r347728552
 
 

 ##########
 File path: common/scala/src/main/scala/org/apache/openwhisk/core/connector/Message.scala
 ##########
 @@ -340,7 +345,22 @@ object Activation extends DefaultJsonProtocol {
       "conductor",
       "memory",
       "causedBy",
-      "size")
+      "size",
+      "actionStatusCode")
+
+  /** Get "StatusCode" from result response **/
+  def getActivationStatusCode(result: Option[JsValue]): Option[Int] = {
+    val statusCode = JsHelpers.getFieldPath(result.get.asJsObject, ERROR_FIELD, "statusCode")
+
+    statusCode match {
+      case Some(value) => Some(value.convertTo[Int])
 
 Review comment:
   Can be simplified  a bit here and also below
   ```scala
   Some(JsNumber(code)) => Some(code.intValue())
   ```

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