Class FlinkMetricContainer
java.lang.Object
org.apache.beam.runners.flink.metrics.FlinkMetricContainer
Helper class for holding a
MetricsContainerImpl
and forwarding Beam metrics to Flink
accumulators and metrics.
Using accumulators can be turned off because it is memory and network intensive. The accumulator results are only meaningful in batch applications or testing streaming applications which have a defined end. They are not essential during execution because metrics will also be reported using the configured metrics reporter.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
protected final org.apache.beam.runners.core.metrics.MetricsContainerStepMap
-
Constructor Summary
ConstructorsConstructorDescriptionFlinkMetricContainer
(org.apache.flink.api.common.functions.RuntimeContext runtimeContext) -
Method Summary
Modifier and TypeMethodDescriptionorg.apache.flink.metrics.MetricGroup
org.apache.beam.runners.core.metrics.MetricsContainerImpl
getMetricsContainer
(String stepName) void
This should be called at the end of the Flink job and sets up an accumulator to push the metrics to the PipelineResult.void
updateMetrics
(String stepName, List<org.apache.beam.model.pipeline.v1.MetricsApi.MonitoringInfo> monitoringInfos) Update this container with metrics from the passedMetricsApi.MonitoringInfo
s, and send updates along to Flink's internal metrics framework.
-
Field Details
-
ACCUMULATOR_NAME
- See Also:
-
metricsContainers
protected final org.apache.beam.runners.core.metrics.MetricsContainerStepMap metricsContainers
-
-
Constructor Details
-
FlinkMetricContainer
public FlinkMetricContainer(org.apache.flink.api.common.functions.RuntimeContext runtimeContext)
-
-
Method Details
-
registerMetricsForPipelineResult
public void registerMetricsForPipelineResult()This should be called at the end of the Flink job and sets up an accumulator to push the metrics to the PipelineResult. This should not be called beforehand, to avoid the overhead which accumulators cause at runtime. -
getMetricGroup
public org.apache.flink.metrics.MetricGroup getMetricGroup() -
getMetricsContainer
public org.apache.beam.runners.core.metrics.MetricsContainerImpl getMetricsContainer(String stepName) -
updateMetrics
public void updateMetrics(String stepName, List<org.apache.beam.model.pipeline.v1.MetricsApi.MonitoringInfo> monitoringInfos) Update this container with metrics from the passedMetricsApi.MonitoringInfo
s, and send updates along to Flink's internal metrics framework.
-