@Internal public class InternalSinkWriterMetricGroup extends ProxyMetricGroup<MetricGroup> implements SinkWriterMetricGroup
MetricGroup
representing an Operator.parentMetricGroup
Modifier and Type | Method and 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) |
addGroup, addGroup, addSpan, counter, counter, gauge, getAllVariables, getMetricIdentifier, getMetricIdentifier, getScopeComponents, histogram, meter
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addGroup, addGroup, addGroup, addSpan, counter, counter, counter, counter, gauge, gauge, getAllVariables, getMetricIdentifier, getMetricIdentifier, getScopeComponents, histogram, histogram, meter, meter
public static InternalSinkWriterMetricGroup wrap(OperatorMetricGroup operatorMetricGroup)
public OperatorIOMetricGroup getIOMetricGroup()
getIOMetricGroup
in interface OperatorMetricGroup
public Counter getNumRecordsOutErrorsCounter()
SinkWriterMetricGroup
getNumRecordsOutErrorsCounter
in interface SinkWriterMetricGroup
public Counter getNumRecordsSendErrorsCounter()
SinkWriterMetricGroup
This metric has the same value as numRecordsOutError
.
getNumRecordsSendErrorsCounter
in interface SinkWriterMetricGroup
public Counter getNumRecordsSendCounter()
SinkWriterMetricGroup
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.
getNumRecordsSendCounter
in interface SinkWriterMetricGroup
public Counter getNumBytesSendCounter()
SinkWriterMetricGroup
This metric has the same value as numBytesOut
of the operator
getNumBytesSendCounter
in interface SinkWriterMetricGroup
public void setCurrentSendTimeGauge(Gauge<Long> currentSendTimeGauge)
SinkWriterMetricGroup
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.
setCurrentSendTimeGauge
in interface SinkWriterMetricGroup
Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.