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


##########
core/invoker/src/main/scala/org/apache/openwhisk/core/containerpool/kubernetes/KubernetesClient.scala:
##########
@@ -176,6 +183,11 @@ class KubernetesClient(
         waitForPod(namespace, createdPod, start.start, config.timeouts.run)
           .map { readyPod =>
             transid.finished(this, start, logLevel = InfoLevel)
+            val t1 = System.currentTimeMillis()
+            MetricEmitter.emitHistogramMetric(
+              LogMarkerToken("kubeapi", "create", "duration", Some("create"), 
Map("cmd" -> "create"))(
+                MeasurementUnit.time.milliseconds),

Review Comment:
   The related transaction already exists. And it is better to use transid than 
to calculate time directly.
   
   ```
       val start = transid.started(
         this,
         LoggingMarkers.INVOKER_KUBEAPI_CMD("create"),
         s"launching pod $name (image:$image, mem: ${memory.toMB}) (timeout: 
${config.timeouts.run.toSeconds}s)",
         logLevel = akka.event.Logging.InfoLevel)
   ```



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to