Class PartitionIngestionMonitor
java.lang.Object
com.linkedin.davinci.kafka.consumer.PartitionIngestionMonitor
Lightweight per-partition metric accumulator using
LongAdder for lock-free concurrent recording.
Only instantiated when a monitoring session is active for a partition.
All counters use LongAdder where increment/add operations are ~10-20ns with no contention.
Latency tracking uses sum+count pairs (not histograms) to minimize overhead.
snapshotAndReset(long) atomically reads and resets all counters via sumThenReset(),
computes rates and averages, and returns a PartitionIngestionSnapshot POJO.
Minor temporal smearing at reset boundaries is acceptable for a monitoring tool.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidrecordE2EProcessingLatencyNs(long nanos) voidrecordIngested(int bytes) Record an ingested record with its size in bytes.voidrecordLeaderCallbackLatencyNs(long nanos) voidrecordLeaderCompletionLatencyNs(long nanos) voidrecordLeaderPreprocessingLatencyNs(long nanos) voidrecordLeaderProduced(long bytes) Record a leader-produced record with its size in bytes.voidrecordLeaderProduceLatencyNs(long nanos) voidrecordRmdLookupLatencyNs(long nanos) voidrecordStoragePutLatencyNs(long nanos) voidrecordValueLookupLatencyNs(long nanos) snapshotAndReset(long elapsedMs) Atomically reads and resets all counters, computes rates and averages, and returns aPartitionIngestionSnapshot.
-
Constructor Details
-
PartitionIngestionMonitor
public PartitionIngestionMonitor()
-
-
Method Details
-
recordIngested
public void recordIngested(int bytes) Record an ingested record with its size in bytes. -
recordLeaderProduced
public void recordLeaderProduced(long bytes) Record a leader-produced record with its size in bytes. -
recordE2EProcessingLatencyNs
public void recordE2EProcessingLatencyNs(long nanos) -
recordLeaderPreprocessingLatencyNs
public void recordLeaderPreprocessingLatencyNs(long nanos) -
recordLeaderProduceLatencyNs
public void recordLeaderProduceLatencyNs(long nanos) -
recordLeaderCompletionLatencyNs
public void recordLeaderCompletionLatencyNs(long nanos) -
recordLeaderCallbackLatencyNs
public void recordLeaderCallbackLatencyNs(long nanos) -
recordStoragePutLatencyNs
public void recordStoragePutLatencyNs(long nanos) -
recordValueLookupLatencyNs
public void recordValueLookupLatencyNs(long nanos) -
recordRmdLookupLatencyNs
public void recordRmdLookupLatencyNs(long nanos) -
snapshotAndReset
Atomically reads and resets all counters, computes rates and averages, and returns aPartitionIngestionSnapshot.- Parameters:
elapsedMs- the elapsed time in milliseconds since the last snapshot- Returns:
- snapshot with computed rates and averages
-