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/02/25 16:18:03 UTC

[GitHub] tysonnorris commented on a change in pull request #4275: Collect and log CosmosDB query metrics when extra logging is enabled

tysonnorris commented on a change in pull request #4275: Collect and log CosmosDB query metrics when extra logging is enabled
URL: https://github.com/apache/incubator-openwhisk/pull/4275#discussion_r259901909
 
 

 ##########
 File path: common/scala/src/main/scala/org/apache/openwhisk/core/database/cosmosdb/CosmosDBArtifactStore.scala
 ##########
 @@ -223,11 +224,22 @@ class CosmosDBArtifactStore[DocumentAbstraction <: DocumentSerializer](protected
 
     val querySpec = viewMapper.prepareQuery(ddoc, viewName, startKey, endKey, realLimit, realIncludeDocs, descending)
 
+    val options = newFeedOptions()
+    val queryMetrics = if (transid.meta.extraLogging) {
+      options.setPopulateQueryMetrics(true)
+      Some(scala.collection.mutable.Buffer[QueryMetrics]())
+    } else None
+
+    def collectQueryMetrics(r: FeedResponse[Document]): Unit = {
+      collectMetrics(queryToken, r.getRequestCharge)
 
 Review comment:
   should `collectMetrics()` be skipped if `queryMetrics.isEmpty`?

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services