ihji commented on a change in pull request #12852:
URL: https://github.com/apache/beam/pull/12852#discussion_r561556902



##########
File path: 
runners/core-java/src/main/java/org/apache/beam/runners/core/metrics/MetricsContainerImpl.java
##########
@@ -411,20 +412,23 @@ public int hashCode() {
   }
 
   /**
-   * Match a MetricName with a given namespace and a name. If the namespace or 
the name is null, it
-   * will be ignored for the match.
+   * Match a MetricName with a given metric filter. If the metric filter is 
null, the method always
+   * returns true.
    */
   private boolean matchMetricName(
-      MetricName metricName, @Nullable String namespace, @Nullable String 
name) {
-    return (namespace == null || namespace.equals(metricName.getNamespace()))
-        && (name == null || name.equals(metricName.getName()));
+      MetricName metricName, @Nullable Set<KV<String, String>> metricFilter) {

Review comment:
       Done. Using MetricName instead.

##########
File path: 
sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/bigquery/StreamingWriteFn.java
##########
@@ -70,6 +73,15 @@
   /** Tracks bytes written, exposed as "ByteCount" Counter. */
   private Counter byteCounter = SinkMetrics.bytesWritten();
 
+  private Set<KV<String, String>> metricFilter =
+      ImmutableSet.of(
+          KV.of(
+              LatencyRecordingHttpRequestInitializer.HISTOGRAM_URN.split(":", 
2)[0],

Review comment:
       Done.




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

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


Reply via email to