Interface ConsumerMetrics

All Known Implementing Classes:
OtelMetrics

public interface ConsumerMetrics
Interface for tracking and recording metrics related to the processing of messages and requests in the Consumer. Provides methods to increment counters, record timing metrics, and capture other performance-related data points.
  • Field Details

  • Method Details

    • incrementInputMsgCounter

      default void incrementInputMsgCounter()
      Increments the counter for input messages.
    • incrementInputMsgCounter

      void incrementInputMsgCounter(long delta)
      Increments the counter for input messages.
      Parameters:
      delta - increase the counter by this value
    • incrementCollapsedCounter

      void incrementCollapsedCounter()
      Increments the counter for collapsed "add" requests.
    • incrementInputReqCounter

      default void incrementInputReqCounter(String type, String subType)
      Increments the counter for input requests by type and subtype.
      Parameters:
      type - request type, one of MirroredSolrRequest.Type values.
      subType - additional subtype: add, delete_by_id, delete_by_query, or action for other request types.
    • incrementInputReqCounter

      void incrementInputReqCounter(String type, String subType, int delta)
      Increments the counter for input requests by type, subtype, and delta.
      Parameters:
      type - request type, one of MirroredSolrRequest.Type values.
      subType - additional subtype: add, delete_by_id, delete_by_query, or action for other request types.
      delta - increase the counter by this value
    • incrementOutputCounter

      default void incrementOutputCounter(String type, String result)
      Increments the counter for output requests by type and result.
      Parameters:
      type - the type of the request
      result - the result of the request, such as success or failure
    • incrementOutputCounter

      void incrementOutputCounter(String type, String result, int delta)
      Increments the counter for output requests by type, result, and delta.
      Parameters:
      type - the type of the request
      result - the result of the request, such as success or failure
      delta - the value by which the counter should be increased
    • recordOutputBatchSize

      void recordOutputBatchSize(MirroredSolrRequest.Type type, org.apache.solr.client.solrj.SolrRequest<?> solrRequest)
      Records the batch size of the output request. Batch size is defined as the number of operations in an output SolrRequest (which may be different from the input size due to collapsing).
      Parameters:
      type - the type of the request, corresponding to one of the MirroredSolrRequest.getType() values
      solrRequest - SolrRequest object for which the batch size is being recorded
    • recordOutputBackoffTime

      void recordOutputBackoffTime(MirroredSolrRequest.Type type, long backoffTimeMs)
      Records the backoff time for output requests. Backoff time represents the delay before the next retry for the specified request type.
      Parameters:
      type - the type of the request, corresponding to one of the MirroredSolrRequest.getType() values.
      backoffTimeMs - the backoff time in milliseconds.
    • recordOutputFirstAttemptTime

      void recordOutputFirstAttemptTime(MirroredSolrRequest.Type type, long firstAttemptTimeMs)
      Records the latency between the time when the message was sent at source and the time of the first attempt at processing.
      Parameters:
      type - the type of the request, corresponding to one of the MirroredSolrRequest.getType() values
      firstAttemptTimeMs - the latency of the first attempt in milliseconds.
    • startOutputTimeTimer

      ConsumerMetrics.ConsumerTimer startOutputTimeTimer(String requestType)
      Starts a timer to measure the duration of an output request processing by the given request type.
      Parameters:
      requestType - the type of the request for which the timer is started
      Returns:
      a ConsumerMetrics.ConsumerTimer that allows to measure the elapsed time