Query metrics MBean

Troubleshoot query performance, tune DSE Search configuration and tune server resources.

Use the query metrics MBean to troubleshoot query performance; tune DSE Search configuration, such as the search index schema and caches; and tune server resources, such as the JVM heap. The query metrics MBean records the amount of time spent to run several main phases of a distributed query on the search index.

The query metrics MBean measures latency in microseconds.

To group by query, provide an additional query.name parameter. For example, for a search index named demo.solr with an indexed field named type, use this URL to provide the additional query.name parameter:
http://localhost:8983/solr/demo.solr/select/?q=type:1&query.name=myquery
All metrics collected under a given query name are recorded and retrieved separately. If a query name is not provided, all metrics are recorded together.

Main operational phases

The main phases of a distributed query operation are:
COORDINATE
Comprises the total amount of time spent by the coordinator node to distribute the query and gather/process results from shards. This value is computed only on query coordinator nodes.
EXECUTE
Comprises the time spent by a single shard to execute the actual index query. This value is computed on the local node executing the shard query.
RETRIEVE
Comprises the time spent by a node to retrieve a single row from the database. This value will be computed on the local node hosting the requested data.

Query metrics MBean set operations

Operations are:

  • setEnabled(boolean enabled)

    Enables/disables metrics recording. Enabled by default.

  • isEnabled()

    Checks if metrics recording is enabled.

  • getLatencyPercentile(String phase, String query, double percentile)

    Gets a query latency percentile by its query name, which is optional and can be null, and phase.

  • getRecordedLatencyCount(String phase, String query)

    Gets the total count of recorded latency metrics by its query name, which is optional and can be null, and phase.

  • getUnrecordedLatencyCount()

    Gets the total count of unrecorded latency values due to exceeding the maximum tracked latency, which is 10 minutes.

  • resetLatency(String query)

    Resets latency metrics for the given query name, which is optional and can be null.

  • resetLatencies()

    Resets all latency metrics.