Class FlinkMetricContainer
- java.lang.Object
-
- org.apache.beam.runners.flink.metrics.FlinkMetricContainer
-
public class FlinkMetricContainer extends java.lang.ObjectHelper class for holding aMetricsContainerImpland 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
Fields Modifier and Type Field Description static java.lang.StringACCUMULATOR_NAMEprotected org.apache.beam.runners.core.metrics.MetricsContainerStepMapmetricsContainers
-
Constructor Summary
Constructors Constructor Description FlinkMetricContainer(org.apache.flink.api.common.functions.RuntimeContext runtimeContext)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.apache.flink.metrics.MetricGroupgetMetricGroup()org.apache.beam.runners.core.metrics.MetricsContainerImplgetMetricsContainer(java.lang.String stepName)voidregisterMetricsForPipelineResult()This should be called at the end of the Flink job and sets up an accumulator to push the metrics to the PipelineResult.voidupdateMetrics(java.lang.String stepName, java.util.List<org.apache.beam.model.pipeline.v1.MetricsApi.MonitoringInfo> monitoringInfos)Update this container with metrics from the passedMetricsApi.MonitoringInfos, and send updates along to Flink's internal metrics framework.
-
-
-
Field Detail
-
ACCUMULATOR_NAME
public static final java.lang.String ACCUMULATOR_NAME
- See Also:
- Constant Field Values
-
metricsContainers
protected final org.apache.beam.runners.core.metrics.MetricsContainerStepMap metricsContainers
-
-
Method Detail
-
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(java.lang.String stepName)
-
updateMetrics
public void updateMetrics(java.lang.String stepName, java.util.List<org.apache.beam.model.pipeline.v1.MetricsApi.MonitoringInfo> monitoringInfos)Update this container with metrics from the passedMetricsApi.MonitoringInfos, and send updates along to Flink's internal metrics framework.
-
-