You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by GitBox <gi...@apache.org> on 2021/08/16 17:49:54 UTC

[GitHub] [beam] benWize commented on a change in pull request #15328: [BEAM-11987] Python Datastore - Implement IO Request Count metric

benWize commented on a change in pull request #15328:
URL: https://github.com/apache/beam/pull/15328#discussion_r689739066



##########
File path: sdks/python/apache_beam/io/gcp/datastore/v1new/datastoreio_test.py
##########
@@ -338,6 +346,26 @@ def test_DatastoreWriteLargeEntities(self):
 
       self.assertEqual(2, commit_count[0])
 
+  def test_DatastoreWrite_monitoring_info(self):
+    num_entities_to_write = 1
+    self.check_DatastoreWriteFn(num_entities_to_write)
+    resource = resource_identifiers.DatastoreNamespace(self._PROJECT, None)
+    labels = {
+        monitoring_infos.SERVICE_LABEL: 'Datastore',
+        monitoring_infos.METHOD_LABEL: 'BatchDatastoreWrite',
+        monitoring_infos.RESOURCE_LABEL: resource,
+        monitoring_infos.DATASTORE_NAMESPACE_LABEL: None,
+        monitoring_infos.DATASTORE_PROJECT_ID_LABEL: self._PROJECT,
+        monitoring_infos.STATUS_LABEL: 'ok'
+    }
+
+    metric_name = MetricName(
+        None, None, urn=monitoring_infos.API_REQUEST_COUNT_URN, labels=labels)
+    metric_value = MetricsEnvironment.process_wide_container().get_counter(

Review comment:
       Thanks for your comments. I changed the test to match the example assertions https://github.com/apache/beam/blob/1e994538fb848f7175f810d5d2f69ea36bc00d66/sdks/python/apache_beam/io/gcp/datastore/v1new/datastoreio_test.py#L183




-- 
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: github-unsubscribe@beam.apache.org

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