@Internal public class InternalSinkWriterMetricGroup extends ProxyMetricGroup<MetricGroup> implements SinkWriterMetricGroup
MetricGroup
representing an Operator.parentMetricGroup
Modifier and Type | Method and Description |
---|---|
OperatorIOMetricGroup |
getIOMetricGroup() |
Counter |
getNumRecordsOutErrorsCounter()
The total number of records failed to send.
|
static InternalSinkWriterMetricGroup |
mock(MetricGroup metricGroup) |
static InternalSinkWriterMetricGroup |
mock(MetricGroup metricGroup,
OperatorIOMetricGroup operatorIOMetricGroup) |
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, counter, counter, gauge, getAllVariables, getMetricIdentifier, getMetricIdentifier, getScopeComponents, histogram, meter
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addGroup, addGroup, addGroup, counter, counter, counter, counter, gauge, gauge, getAllVariables, getMetricIdentifier, getMetricIdentifier, getScopeComponents, histogram, histogram, meter, meter
public static InternalSinkWriterMetricGroup wrap(OperatorMetricGroup operatorMetricGroup)
@VisibleForTesting public static InternalSinkWriterMetricGroup mock(MetricGroup metricGroup)
@VisibleForTesting public static InternalSinkWriterMetricGroup mock(MetricGroup metricGroup, OperatorIOMetricGroup operatorIOMetricGroup)
public OperatorIOMetricGroup getIOMetricGroup()
getIOMetricGroup
in interface OperatorMetricGroup
public Counter getNumRecordsOutErrorsCounter()
SinkWriterMetricGroup
getNumRecordsOutErrorsCounter
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–2023 The Apache Software Foundation. All rights reserved.