Class VeniceProducerMetrics

java.lang.Object
com.linkedin.venice.stats.AbstractVeniceStats
com.linkedin.venice.producer.VeniceProducerMetrics

public class VeniceProducerMetrics extends AbstractVeniceStats
Metrics for Venice Producer operations.

Latency Metrics

  • queue_wait_latency: Time waiting in worker queue (submit to worker start)
  • preprocessing_latency: Worker start to preprocess end (serialization + schema lookup)
  • produce_to_durable_buffer_latency: Preprocess end to broker ack
  • caller_to_pubsub_producer_buffer_latency: Caller submit to PubSub producer buffer
  • end_to_end_latency: Caller submit to future completion (full round-trip)

Operation Counters

  • write_operation: Total write operations (put + delete + update)
  • put_operation, delete_operation, update_operation: Per-type counters
  • success_write_operation, failed_write_operation: Outcome counters
  • pending_write_operation: Current in-flight operations (gauge)

Queue Size Gauges

  • total_worker_queue_size: Sum of all worker queue depths
  • callback_queue_size: Callback executor queue depth
  • Constructor Details

    • VeniceProducerMetrics

      public VeniceProducerMetrics(io.tehuti.metrics.MetricsRepository metricsRepository, String storeName)
  • Method Details

    • registerQueueMetrics

      public void registerQueueMetrics(PartitionedProducerExecutor executor)
      Called after executor is created to register queue size gauges.
      Parameters:
      executor - the partitioned producer executor
    • recordPutRequest

      public void recordPutRequest()
    • recordDeleteRequest

      public void recordDeleteRequest()
    • recordUpdateRequest

      public void recordUpdateRequest()
    • recordSuccessfulRequestWithLatency

      public void recordSuccessfulRequestWithLatency(double latencyMs)
    • recordFailedRequest

      public void recordFailedRequest()
    • recordPreprocessingLatency

      public void recordPreprocessingLatency(double latencyMs)
    • recordEndToEndLatency

      public void recordEndToEndLatency(double latencyMs)
      Record the end-to-end latency (from submission to future completion).
      Parameters:
      latencyMs - end-to-end latency in milliseconds
    • recordQueueWaitLatency

      public void recordQueueWaitLatency(double latencyMs)
      Records the queue wait latency - the time a task spent waiting in the worker queue before being picked up by a worker thread.
      Parameters:
      latencyMs - latency in milliseconds
    • recordCallerToPubSubBufferLatency

      public void recordCallerToPubSubBufferLatency(double latencyMs)
      Records the caller to PubSub producer buffer latency - the total time from caller submission to when the write is queued to the PubSub producer's buffer. This includes queue wait time, preprocessing, and the synchronous time to submit to VeniceWriter.
      Parameters:
      latencyMs - latency in milliseconds (supports sub-millisecond precision as a double)