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 2022/03/15 21:07:53 UTC

[GitHub] [beam] pabloem commented on a change in pull request #17064: [BEAM-12164]: add metrics for partition reads, queries, and latencies for Spanner Change Streams Connector

pabloem commented on a change in pull request #17064:
URL: https://github.com/apache/beam/pull/17064#discussion_r827416400



##########
File path: sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/spanner/changestreams/ChangeStreamMetrics.java
##########
@@ -84,6 +88,25 @@
   public static final Counter DATA_RECORD_COUNT =
       Metrics.counter(ChangeStreamMetrics.class, "data_record_count");
 
+  /** Counter for the total number of queries issued during the execution of the Connector. */
+  public static final Counter QUERY_COUNT =
+      Metrics.counter(ChangeStreamMetrics.class, "query_count");
+
+  /** Counter for record latencies [0, 1000) ms during the execution of the Connector. */
+  public static final Counter DATA_RECORD_COMMITTED_TO_EMITTED_0MS_TO_1000MS_COUNT =
+      Metrics.counter(
+          ChangeStreamMetrics.class, "data_record_committed_to_emitted_0ms_to_1000ms_count");
+
+  /** Counter for record latencies [1000, 3000) ms during the execution of the Connector. */
+  public static final Counter DATA_RECORD_COMMITTED_TO_EMITTED_1000MS_TO_3000MS_COUNT =
+      Metrics.counter(
+          ChangeStreamMetrics.class, "data_record_committed_to_emitted_1000ms_to_3000ms_count");
+
+  /** Counter for record latencies equal or above 3000ms during the execution of the Connector. */
+  public static final Counter DATA_RECORD_COMMITTED_TO_EMITTED_3000MS_TO_INF_COUNT =
+      Metrics.counter(
+          ChangeStreamMetrics.class, "data_record_committed_to_emitted_3000ms_to_inf_count");

Review comment:
       we also have a `Metrics.distribution` that you can use for cases like these. Did you consider it?




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