Query metrics MBean
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.
Record the amount of time spent to run several main phases of a distributed query on the search index.
Measure 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 the following URL to provide the additional query.name parameter:
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.
The main phases of a distributed query operation are:
Comprises the time spent by a query request waiting for a thread to 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.
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.
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. Includes RETRIEVE and EXECUTE in the total.
Comprises the total server-side time for a search query. Includes COORDINATE and ENQEUE in the total.
- setEnabled(boolean enabled)
Enables/disables metrics recording. Enabled by default.
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.
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.
Resets all latency metrics.
Indicates whether metrics recording is enabled or disabled.
Indicates the number of client requests that are currently waiting for a query thread.
If the value of the EnqueuedRequestCount MBean increases, or stabilizes above zero for a prolonged period, then DSE Search has reached a point of maximum throughput, where additional load will only increases latencies.
To access this attribute, use the
-foption with the
nodetool sjkcommand, as shown in the following example.
nodetool sjk -p 7199 mx -mg \ -b com.datastax.bdp:type=search,index=demo.solr,name=QueryMetrics \ -f EnqueuedRequestCount
The total count of unrecorded latency values due to exceeding the maximum tracked latency, which is 10 minutes.