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/06/03 17:25:41 UTC

[GitHub] [beam] kennknowles opened a new issue, #18341: Better API for querying metrics

kennknowles opened a new issue, #18341:
URL: https://github.com/apache/beam/issues/18341

   I just want to read a metric :-).
   
   Can we have a better API than this:
   
   Iterable<MetricResult<Long\>\> seenMetrics = job.metrics()
               .queryMetrics(
                   MetricsFilter.builder()
                       .addNameFilter(MetricNameFilter.named("XX", "YY"))
                       .build())
               .counters();
   long seenSentinels = Iterables.isEmpty(seenMetrics) ? 0
               : Iterables.getFirst(seenMetrics, null).committed();
   
   This is very clunky :-P.
   
   Ideally I'd like to read a metric with a name, and provide a default value if the metric is not there.
   
   Imported from Jira [BEAM-2046](https://issues.apache.org/jira/browse/BEAM-2046). Original Jira may contain additional context.
   Reported by: malo@google.com.


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

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