Class SolrQueryMetrics

java.lang.Object
com.lucidworks.cloud.api.solr.SolrQueryMetrics
All Implemented Interfaces:
SolrMetricsCollector

public class SolrQueryMetrics extends Object implements SolrMetricsCollector
Stores metric information accumulated during processing of a Solr query. Provides capability to capture all the collected information to the various prometheus metrics.
  • Field Details

    • CALL_TIME_SECS

      public static final io.prometheus.client.Histogram CALL_TIME_SECS
    • CALL_OUTCOME_TOTAL

      public static final io.prometheus.client.Counter CALL_OUTCOME_TOTAL
    • COLLECTION_CALL_TIME_SECS

      public static final io.prometheus.client.Histogram COLLECTION_CALL_TIME_SECS
    • log

      protected static final org.slf4j.Logger log
    • startTime

      protected Instant startTime
  • Constructor Details

    • SolrQueryMetrics

      public SolrQueryMetrics(String collectionId, String requestHandler, String httpMethod)
      Parameters:
      collectionId - collection ID the solr query is for (null if not for a collection)
      requestHandler - request handler being queried (null if not querying a request handler)
      httpMethod - httpmethod being used to issue the query
  • Method Details

    • collectWithTime

      public void collectWithTime(String metricError, long responseTimeMillis)
      Description copied from interface: SolrMetricsCollector
      Collect the metric with external timer value.
      Specified by:
      collectWithTime in interface SolrMetricsCollector
    • setTargetInstancePort

      public void setTargetInstancePort(String targetInstancePort)
    • setTargetInstanceHost

      public void setTargetInstanceHost(String targetInstanceHost)
    • collect

      public void collect(String metricError)
      Description copied from interface: SolrMetricsCollector
      Save the response result of current call
      Specified by:
      collect in interface SolrMetricsCollector
      Parameters:
      metricError - - error which occurred during the response, Http status code or exception class name. In case of no error use "none".