[ 
https://issues.apache.org/jira/browse/BEAM-4374?focusedWorklogId=410569&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-410569
 ]

ASF GitHub Bot logged work on BEAM-4374:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 26/Mar/20 20:01
            Start Date: 26/Mar/20 20:01
    Worklog Time Spent: 10m 
      Work Description: lukecwik commented on pull request #11184: [BEAM-4374] 
Update protos related to MonitoringInfo.
URL: https://github.com/apache/beam/pull/11184#discussion_r398855313
 
 

 ##########
 File path: 
runners/core-java/src/test/java/org/apache/beam/runners/core/metrics/MonitoringInfoMatchers.java
 ##########
 @@ -28,30 +31,17 @@
    * Matches a {@link MonitoringInfo} with that has the set fields in the 
provide MonitoringInfo.
    *
    * <p>This is useful for tests which do not want to match the specific value 
(execution times).
-   * Currently this will only check for URNs, labels, type URNs and 
int64Values.
+   * Currently this will only check for URNs, labels, type URNs and payloads.
    */
   public static TypeSafeMatcher<MonitoringInfo> matchSetFields(final 
MonitoringInfo mi) {
     return new TypeSafeMatcher<MonitoringInfo>() {
 
       @Override
       protected boolean matchesSafely(MonitoringInfo item) {
-        if (!item.getUrn().equals(mi.getUrn())) {
-          return false;
-        }
-        if (!item.getLabels().equals(mi.getLabels())) {
-          return false;
-        }
-        if (!item.getType().equals(mi.getType())) {
-          return false;
-        }
-
-        if (mi.getMetric().hasCounterData()) {
-          long valueToMatch = mi.getMetric().getCounterData().getInt64Value();
-          if (valueToMatch != 
item.getMetric().getCounterData().getInt64Value()) {
-            return false;
-          }
-        }
-        return true;
+        return (mi.getUrn().isEmpty() || mi.getUrn().equals(item.getUrn()))
 
 Review comment:
   The contract of the matcher states that it only compares **set** fields and 
it seemed it was incorrectly implemented. I can change it back to the existing 
implementation where `urn`, `labels`, and `type` must always be specified and 
fix the comment.
 
----------------------------------------------------------------
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:
us...@infra.apache.org


Issue Time Tracking
-------------------

    Worklog Id:     (was: 410569)
    Time Spent: 30h 50m  (was: 30h 40m)

> Update existing metrics in the FN API to use new Metric Schema
> --------------------------------------------------------------
>
>                 Key: BEAM-4374
>                 URL: https://issues.apache.org/jira/browse/BEAM-4374
>             Project: Beam
>          Issue Type: New Feature
>          Components: beam-model
>            Reporter: Alex Amato
>            Priority: Major
>          Time Spent: 30h 50m
>  Remaining Estimate: 0h
>
> Update existing metrics to use the new proto and cataloging schema defined in:
> [_https://s.apache.org/beam-fn-api-metrics_]
>  * Check in new protos
>  * Define catalog file for metrics
>  * Port existing metrics to use this new format, based on catalog 
> names+metadata



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to