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

 ##########
 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]())
 
 Review comment:
   There can be multiple  `FeedResponse` with each having a set of 
`QueryMetrics` attached and they would need to be accumulated.  Hence need to 
use `Buffer` so as to append them and cannot use `List.empty`.

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


With regards,
Apache Git Services

Reply via email to