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 2022/05/26 07:15:24 UTC

[GitHub] [openwhisk] jiangpengcheng commented on a diff in pull request #5222: Add containerPool container histogram metric

jiangpengcheng commented on code in PR #5222:
URL: https://github.com/apache/openwhisk/pull/5222#discussion_r882385662


##########
common/scala/src/main/scala/org/apache/openwhisk/common/Logging.scala:
##########
@@ -412,6 +412,15 @@ object LoggingMarkers {
     LogMarkerToken(invoker, "sharedPackage", counter, None, Map("path" -> path))(MeasurementUnit.none)
   def INVOKER_CONTAINERPOOL_MEMORY(state: String) =
     LogMarkerToken(invoker, "containerPoolMemory", counter, Some(state), Map("state" -> state))(MeasurementUnit.none)
+  def INVOKER_CONTAINERPOOL_CONTAINER(state: String, tags: Option[Map[String, String]] = None) = {
+    var map = Map("state" -> state)
+    tags.foreach { mapTags =>
+      for ((k, v) <- mapTags) {
+        map += (k -> v)
+      }
+    }
+    LogMarkerToken(invoker, "containerPoolContainer", counter, Some(state), map)(MeasurementUnit.none)

Review Comment:
   we can use ` tags.map(Map("state" -> "state") ++: _).getOrElse(map)` here



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

To unsubscribe, e-mail: issues-unsubscribe@openwhisk.apache.org

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