[
https://issues.apache.org/jira/browse/BEAM-4775?focusedWorklogId=204916&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-204916
]
ASF GitHub Bot logged work on BEAM-4775:
----------------------------------------
Author: ASF GitHub Bot
Created on: 27/Feb/19 01:43
Start Date: 27/Feb/19 01:43
Worklog Time Spent: 10m
Work Description: ajamato commented on pull request #7934: [DO NOT MERGE]
[BEAM-4775] add GetJobMetrics RPC
URL: https://github.com/apache/beam/pull/7934#discussion_r260557882
##########
File path:
runners/core-java/src/main/java/org/apache/beam/runners/core/metrics/MetricsContainerImpl.java
##########
@@ -139,53 +136,6 @@ public MetricUpdates getUpdates() {
extractUpdates(counters), extractUpdates(distributions),
extractUpdates(gauges));
}
- /**
- * @param metricUpdate
- * @return The MonitoringInfo generated from the metricUpdate.
- */
- @Nullable
- private MonitoringInfo counterUpdateToMonitoringInfo(MetricUpdate<Long>
metricUpdate) {
- SimpleMonitoringInfoBuilder builder = new
SimpleMonitoringInfoBuilder(true);
- MetricName metricName = metricUpdate.getKey().metricName();
- if (metricName instanceof MonitoringInfoMetricName) {
- MonitoringInfoMetricName monitoringInfoName = (MonitoringInfoMetricName)
metricName;
- // Represents a specific MonitoringInfo for a specific URN.
- builder.setUrn(monitoringInfoName.getUrn());
- for (Entry<String, String> e :
monitoringInfoName.getLabels().entrySet()) {
- builder.setLabel(e.getKey(), e.getValue());
- }
- } else { // Note: (metricName instanceof MetricName) is always True.
- // Represents a user counter.
- builder.setUrnForUserMetric(
- metricUpdate.getKey().metricName().getNamespace(),
- metricUpdate.getKey().metricName().getName());
- // Drop if the stepname is not set. All user counters must be
- // defined for a PTransform. They must be defined on a container bound
to a step.
- if (this.stepName == null) {
- return null;
- }
- builder.setPTransformLabel(metricUpdate.getKey().stepName());
- }
- builder.setInt64Value(metricUpdate.getUpdate());
- builder.setTimestampToNow();
- return builder.build();
- }
-
- /** Return the cumulative values for any metrics in this container as
MonitoringInfos. */
- public Iterable<MonitoringInfo> getMonitoringInfos() {
Review comment:
Please keep this method, just have it call the counter update conversion
here, instead of making all the call sites do it.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 204916)
Time Spent: 24h 20m (was: 24h 10m)
> JobService should support returning metrics
> -------------------------------------------
>
> Key: BEAM-4775
> URL: https://issues.apache.org/jira/browse/BEAM-4775
> Project: Beam
> Issue Type: Bug
> Components: beam-model
> Reporter: Eugene Kirpichov
> Assignee: Ryan Williams
> Priority: Major
> Labels: triaged
> Time Spent: 24h 20m
> Remaining Estimate: 0h
>
> Design doc: [https://s.apache.org/get-metrics-api].
> h1. Relevant PRs in flight:
> h2. Approved / Ready to merge:
> * [#7938|https://github.com/apache/beam/pull/7938]: move MonitoringInfo
> protos to model/pipeline module
> * [#7867|https://github.com/apache/beam/pull/7867]: key MetricResult by a
> MetricKey
> h2. Ready for Review:
> * [#7934|https://github.com/apache/beam/pull/7934]: add GetJobMetrics RPC,
> Java+Python SDK support for it
> *
> ** will need to be rebased on top of
> [#7938|https://github.com/apache/beam/pull/7938]
> * #[7915|https://github.com/apache/beam/pull/7915]: use MonitoringInfo data
> model in Java SDK metrics
> ** Depends on [#7867|https://github.com/apache/beam/pull/7867]
> ** will be need to be rebased on top of
> [#7938|https://github.com/apache/beam/pull/7938]
> ** Both of these require adding a {{sdks/java/core}} dependency on the
> {{model/fn-execution}} protos module.
> *** I want to discuss whether that's ok.
> *** It may not be totally necessary; see discussion on
> #[7915|https://github.com/apache/beam/pull/7915].
> h2. Iterating / Discussing:
> * [#7868|https://github.com/apache/beam/pull/7868]: MonitoringInfo URN tweaks
> h2. Merged
> * [#7883|https://github.com/apache/beam/pull/7883]: Add
> MetricQueryResults.allMetrics() helper
> * [#7866|https://github.com/apache/beam/pull/7866]: move function helpers
> from fn-harness to sdks/java/core
> * [#7890|https://github.com/apache/beam/pull/7890]: consolidate MetricResult
> implementations
> h2. Closed
> * [#7876|https://github.com/apache/beam/pull/7876]: Clean up metric protos;
> support integer distributions, gauges
> h1. Likely pieces still to come:
> Per recent discussion with [~robertwb], I'm going to move the MonitoringInfo
> protos into the {{model/pipeline}} module, which the Job API, Fn API, and
> sdks/java/core all depend on already, as it's a good/central place for them.
> h1. Previous Description:
> [https://github.com/apache/beam/blob/master/model/job-management/src/main/proto/beam_job_api.proto]
> currently doesn't appear to have a way for JobService to return metrics to a
> user, even though
> [https://github.com/apache/beam/blob/master/model/fn-execution/src/main/proto/beam_fn_api.proto]
> includes support for reporting SDK metrics to the runner harness.
> Metrics are apparently necessary to run any ValidatesRunner tests because
> PAssert needs to validate that the assertions succeeded. However, this
> statement should be double-checked: perhaps it's possible to somehow work
> with PAssert without metrics support.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)