[ https://issues.apache.org/jira/browse/BEAM-2046?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15979464#comment-15979464 ]
Ismaël Mejía commented on BEAM-2046: ------------------------------------ Huge +1, also it would be nice a method that receives a list (or vargs) of names in a namespace and return a map with the associate existing values for the given metrics. > Better API for querying metrics > ------------------------------- > > Key: BEAM-2046 > URL: https://issues.apache.org/jira/browse/BEAM-2046 > Project: Beam > Issue Type: Improvement > Components: sdk-java-core > Affects Versions: First stable release > Reporter: Malo Denielou > Assignee: Davor Bonaci > > 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. -- This message was sent by Atlassian JIRA (v6.3.15#6346)