beam-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Davor Bonaci (JIRA)" <j...@apache.org>
Subject [jira] [Assigned] (BEAM-2046) Better API for querying metrics
Date Tue, 25 Apr 2017 00:56:04 GMT

     [ https://issues.apache.org/jira/browse/BEAM-2046?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Davor Bonaci reassigned BEAM-2046:
----------------------------------

    Assignee: Ben Chambers  (was: Davor Bonaci)

> 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: Ben Chambers
>
> 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)

Mime
View raw message