Class InternalSinkWriterMetricGroup
- java.lang.Object
-
- org.apache.flink.runtime.metrics.groups.ProxyMetricGroup<MetricGroup>
-
- org.apache.flink.runtime.metrics.groups.InternalSinkWriterMetricGroup
-
- All Implemented Interfaces:
OperatorMetricGroup
,SinkWriterMetricGroup
,MetricGroup
@Internal public class InternalSinkWriterMetricGroup extends ProxyMetricGroup<MetricGroup> implements SinkWriterMetricGroup
SpecialMetricGroup
representing an Operator.
-
-
Field Summary
-
Fields inherited from class org.apache.flink.runtime.metrics.groups.ProxyMetricGroup
parentMetricGroup
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description OperatorIOMetricGroup
getIOMetricGroup()
Counter
getNumBytesSendCounter()
The total number of output send bytes since the task started.Counter
getNumRecordsOutErrorsCounter()
The total number of records failed to send.Counter
getNumRecordsSendCounter()
The total number of records have been sent to the downstream system.Counter
getNumRecordsSendErrorsCounter()
The total number of records failed to send.void
setCurrentSendTimeGauge(Gauge<Long> currentSendTimeGauge)
Sets an optional gauge for the time it takes to send the last record.static InternalSinkWriterMetricGroup
wrap(OperatorMetricGroup operatorMetricGroup)
-
Methods inherited from class org.apache.flink.runtime.metrics.groups.ProxyMetricGroup
addGroup, addGroup, addSpan, counter, counter, gauge, getAllVariables, getMetricIdentifier, getMetricIdentifier, getScopeComponents, histogram, meter
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.flink.metrics.MetricGroup
addGroup, addGroup, addGroup, addSpan, counter, counter, counter, counter, gauge, gauge, getAllVariables, getMetricIdentifier, getMetricIdentifier, getScopeComponents, histogram, histogram, meter, meter
-
-
-
-
Method Detail
-
wrap
public static InternalSinkWriterMetricGroup wrap(OperatorMetricGroup operatorMetricGroup)
-
getIOMetricGroup
public OperatorIOMetricGroup getIOMetricGroup()
- Specified by:
getIOMetricGroup
in interfaceOperatorMetricGroup
-
getNumRecordsOutErrorsCounter
public Counter getNumRecordsOutErrorsCounter()
Description copied from interface:SinkWriterMetricGroup
The total number of records failed to send.- Specified by:
getNumRecordsOutErrorsCounter
in interfaceSinkWriterMetricGroup
-
getNumRecordsSendErrorsCounter
public Counter getNumRecordsSendErrorsCounter()
Description copied from interface:SinkWriterMetricGroup
The total number of records failed to send.This metric has the same value as
numRecordsOutError
.- Specified by:
getNumRecordsSendErrorsCounter
in interfaceSinkWriterMetricGroup
-
getNumRecordsSendCounter
public Counter getNumRecordsSendCounter()
Description copied from interface:SinkWriterMetricGroup
The total number of records have been sent to the downstream system.Note: this counter will count all records the SinkWriter sent. From SinkWirter's perspective, these records have been sent to the downstream system, but the downstream system may have issue to perform the persistence action within its scope. Therefore, this count may include the number of records that are failed to write by the downstream system, which should be counted by
SinkWriterMetricGroup.getNumRecordsSendErrorsCounter()
.This metric has the same value as
numRecordsOut
of the operator.- Specified by:
getNumRecordsSendCounter
in interfaceSinkWriterMetricGroup
-
getNumBytesSendCounter
public Counter getNumBytesSendCounter()
Description copied from interface:SinkWriterMetricGroup
The total number of output send bytes since the task started.This metric has the same value as
numBytesOut
of the operator- Specified by:
getNumBytesSendCounter
in interfaceSinkWriterMetricGroup
-
setCurrentSendTimeGauge
public void setCurrentSendTimeGauge(Gauge<Long> currentSendTimeGauge)
Description copied from interface:SinkWriterMetricGroup
Sets an optional gauge for the time it takes to send the last record.This metric is an instantaneous value recorded for the last processed record.
If this metric is eagerly calculated, this metric should NOT be updated for each record. Instead, update this metric for each batch of record or sample every X records.
Note for asynchronous sinks, the time must be accessible from the main operator thread. For example, a `volatile` field could be set in the async thread and lazily read in the gauge.
- Specified by:
setCurrentSendTimeGauge
in interfaceSinkWriterMetricGroup
-
-