beam-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Malo Denielou (JIRA)" <>
Subject [jira] [Created] (BEAM-2046) Better API for querying metrics
Date Fri, 21 Apr 2017 17:46:04 GMT
Malo Denielou created BEAM-2046:

             Summary: Better API for querying metrics
                 Key: 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()
                    .addNameFilter(MetricNameFilter.named("XX", "YY"))
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

View raw message