Interface SinkWriterMetricGroup
-
- All Superinterfaces:
MetricGroup
,OperatorMetricGroup
- All Known Implementing Classes:
InternalSinkWriterMetricGroup
@PublicEvolving public interface SinkWriterMetricGroup extends OperatorMetricGroup
Pre-defined metrics for sinks.You should only update the metrics in the main operator thread.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description 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.-
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
-
Methods inherited from interface org.apache.flink.metrics.groups.OperatorMetricGroup
getIOMetricGroup
-
-
-
-
Method Detail
-
getNumRecordsOutErrorsCounter
Counter getNumRecordsOutErrorsCounter()
The total number of records failed to send.
-
getNumRecordsSendErrorsCounter
Counter getNumRecordsSendErrorsCounter()
The total number of records failed to send.This metric has the same value as
numRecordsOutError
.
-
getNumRecordsSendCounter
Counter getNumRecordsSendCounter()
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
getNumRecordsSendErrorsCounter()
.This metric has the same value as
numRecordsOut
of the operator.
-
getNumBytesSendCounter
Counter getNumBytesSendCounter()
The total number of output send bytes since the task started.This metric has the same value as
numBytesOut
of the operator
-
setCurrentSendTimeGauge
void setCurrentSendTimeGauge(Gauge<Long> currentSendTimeGauge)
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.
-
-