Getting Search Statistics

    +
    Statistics for the Search Service can be retrieved with the GET /api/nsstats HTTP method and URI.

    HTTP method and URI

    GET /api/nsstats

    Description

    This retrieves statistics on the Search Service. Information is provided on documents, partition indexes, mutations, compactions, queries, and more.

    Curl Syntax

    curl -X GET -u <username>:<password>
       http://<host>:<port>/api/nsstats

    The user authenticated by the username and password must have been assigned the Full Admin or Cluster Admin role for the cluster; or the Bucket Admin role for the bucket or buckets on which search indexes have been created. The host must be a node that hosts the Search Service. The port must be 8094 or (for secure access) 18094.

    Responses

    If the call is successful, 200 OK is given, and an object containing search-related statistics is returned.

    A malformed URI gives 400 Object Not Found. Failure to authenticate gives 401 Unauthorized.

    Successful authentication by a user who has not been assigned an appropriate role gives 403 Forbidden, and returns an object similar to the following:

    {
      "message": "Forbidden. User needs one of the following permissions",
      "permissions": [
        "cluster.fts!read"
      ]
    }

    Example

    In the following example, the command-line output is piped to the jq command, to facilitate readability.

    curl -v -u Administrator:password -XGET \
    http://10.143.194.102:8094/api/nsstats | jq '.'

    If successful, the call returns an object similar to the following. Note that extensive statistics are returned on the two indexes that have been defined for the travel-sample bucket: travel-sample-index and geoIndex.

    {
      "batch_bytes_added": 0,
      "batch_bytes_removed": 0,
      "curr_batches_blocked_by_herder": 0,
      "num_bytes_used_ram": 213924088,
      "pct_cpu_gc": 0.001428879394431173,
      "tot_batches_flushed_on_maxops": 0,
      "tot_batches_flushed_on_timer": 0,
      "tot_bleve_dest_closed": 0,
      "tot_bleve_dest_opened": 12,
      "tot_grpc_listeners_closed": 0,
      "tot_grpc_listeners_opened": 1,
      "tot_grpc_queryreject_on_memquota": 0,
      "tot_grpcs_listeners_closed": 0,
      "tot_grpcs_listeners_opened": 1,
      "tot_http_limitlisteners_closed": 0,
      "tot_http_limitlisteners_opened": 1,
      "tot_https_limitlisteners_closed": 0,
      "tot_https_limitlisteners_opened": 1,
      "tot_queryreject_on_memquota": 0,
      "tot_remote_grpc": 0,
      "tot_remote_grpc_tls": 0,
      "tot_remote_http": 0,
      "tot_remote_http2": 0,
      "total_gc": 1861,
      "total_queries_rejected_by_herder": 0,
      "travel-sample:geoIndex:avg_grpc_internal_queries_latency": 0,
      "travel-sample:geoIndex:avg_grpc_queries_latency": 0,
      "travel-sample:geoIndex:avg_internal_queries_latency": 0,
      "travel-sample:geoIndex:avg_queries_latency": 41.771365,
      "travel-sample:geoIndex:batch_merge_count": 0,
      "travel-sample:geoIndex:doc_count": 16694,
      "travel-sample:geoIndex:iterator_next_count": 0,
      "travel-sample:geoIndex:iterator_seek_count": 0,
      "travel-sample:geoIndex:last_access_time": "2020-03-30T04:42:53.701-07:00",
      "travel-sample:geoIndex:num_bytes_live_data": 0,
      "travel-sample:geoIndex:num_bytes_used_disk": 295152367,
      "travel-sample:geoIndex:num_bytes_used_disk_by_root": 99845092,
      "travel-sample:geoIndex:num_files_on_disk": 52,
      "travel-sample:geoIndex:num_mutations_to_index": 0,
      "travel-sample:geoIndex:num_persister_nap_merger_break": 6,
      "travel-sample:geoIndex:num_persister_nap_pause_completed": 6,
      "travel-sample:geoIndex:num_pindexes_actual": 6,
      "travel-sample:geoIndex:num_pindexes_target": 6,
      "travel-sample:geoIndex:num_recs_to_persist": 0,
      "travel-sample:geoIndex:num_root_filesegments": 6,
      "travel-sample:geoIndex:num_root_memorysegments": 0,
      "travel-sample:geoIndex:reader_get_count": 0,
      "travel-sample:geoIndex:reader_multi_get_count": 0,
      "travel-sample:geoIndex:reader_prefix_iterator_count": 0,
      "travel-sample:geoIndex:reader_range_iterator_count": 0,
      "travel-sample:geoIndex:timer_batch_store_count": 0,
      "travel-sample:geoIndex:timer_data_delete_count": 0,
      "travel-sample:geoIndex:timer_data_update_count": 0,
      "travel-sample:geoIndex:timer_opaque_get_count": 2731,
      "travel-sample:geoIndex:timer_opaque_set_count": 1024,
      "travel-sample:geoIndex:timer_rollback_count": 0,
      "travel-sample:geoIndex:timer_snapshot_start_count": 0,
      "travel-sample:geoIndex:total_bytes_indexed": 0,
      "travel-sample:geoIndex:total_bytes_query_results": 13730,
      "travel-sample:geoIndex:total_compaction_written_bytes": 0,
      "travel-sample:geoIndex:total_compactions": 0,
      "travel-sample:geoIndex:total_grpc_internal_queries": 0,
      "travel-sample:geoIndex:total_grpc_queries": 0,
      "travel-sample:geoIndex:total_grpc_queries_error": 0,
      "travel-sample:geoIndex:total_grpc_queries_slow": 0,
      "travel-sample:geoIndex:total_grpc_queries_timeout": 0,
      "travel-sample:geoIndex:total_grpc_request_time": 0,
      "travel-sample:geoIndex:total_internal_queries": 0,
      "travel-sample:geoIndex:total_queries": 9,
      "travel-sample:geoIndex:total_queries_error": 1,
      "travel-sample:geoIndex:total_queries_slow": 0,
      "travel-sample:geoIndex:total_queries_timeout": 0,
      "travel-sample:geoIndex:total_request_time": 376022106,
      "travel-sample:geoIndex:total_term_searchers": 2226,
      "travel-sample:geoIndex:total_term_searchers_finished": 2226,
      "travel-sample:geoIndex:writer_execute_batch_count": 0,
      "travel-sample:travel-sample-index:avg_grpc_internal_queries_latency": 0,
      "travel-sample:travel-sample-index:avg_grpc_queries_latency": 0,
      "travel-sample:travel-sample-index:avg_internal_queries_latency": 0,
      "travel-sample:travel-sample-index:avg_queries_latency": 18.477376,
      "travel-sample:travel-sample-index:batch_merge_count": 0,
      "travel-sample:travel-sample-index:doc_count": 16694,
      "travel-sample:travel-sample-index:iterator_next_count": 0,
      "travel-sample:travel-sample-index:iterator_seek_count": 0,
      "travel-sample:travel-sample-index:last_access_time": "2020-03-31T05:56:15.264-07:00",
      "travel-sample:travel-sample-index:num_bytes_live_data": 0,
      "travel-sample:travel-sample-index:num_bytes_used_disk": 247966801,
      "travel-sample:travel-sample-index:num_bytes_used_disk_by_root": 104572509,
      "travel-sample:travel-sample-index:num_files_on_disk": 54,
      "travel-sample:travel-sample-index:num_mutations_to_index": 0,
      "travel-sample:travel-sample-index:num_persister_nap_merger_break": 6,
      "travel-sample:travel-sample-index:num_persister_nap_pause_completed": 6,
      "travel-sample:travel-sample-index:num_pindexes_actual": 6,
      "travel-sample:travel-sample-index:num_pindexes_target": 6,
      "travel-sample:travel-sample-index:num_recs_to_persist": 0,
      "travel-sample:travel-sample-index:num_root_filesegments": 10,
      "travel-sample:travel-sample-index:num_root_memorysegments": 0,
      "travel-sample:travel-sample-index:reader_get_count": 0,
      "travel-sample:travel-sample-index:reader_multi_get_count": 0,
      "travel-sample:travel-sample-index:reader_prefix_iterator_count": 0,
      "travel-sample:travel-sample-index:reader_range_iterator_count": 0,
      "travel-sample:travel-sample-index:timer_batch_store_count": 0,
      "travel-sample:travel-sample-index:timer_data_delete_count": 0,
      "travel-sample:travel-sample-index:timer_data_update_count": 0,
      "travel-sample:travel-sample-index:timer_opaque_get_count": 2715,
      "travel-sample:travel-sample-index:timer_opaque_set_count": 1024,
      "travel-sample:travel-sample-index:timer_rollback_count": 0,
      "travel-sample:travel-sample-index:timer_snapshot_start_count": 0,
      "travel-sample:travel-sample-index:total_bytes_indexed": 0,
      "travel-sample:travel-sample-index:total_bytes_query_results": 308694,
      "travel-sample:travel-sample-index:total_compaction_written_bytes": 0,
      "travel-sample:travel-sample-index:total_compactions": 0,
      "travel-sample:travel-sample-index:total_grpc_internal_queries": 0,
      "travel-sample:travel-sample-index:total_grpc_queries": 0,
      "travel-sample:travel-sample-index:total_grpc_queries_error": 0,
      "travel-sample:travel-sample-index:total_grpc_queries_slow": 0,
      "travel-sample:travel-sample-index:total_grpc_queries_timeout": 0,
      "travel-sample:travel-sample-index:total_grpc_request_time": 0,
      "travel-sample:travel-sample-index:total_internal_queries": 0,
      "travel-sample:travel-sample-index:total_queries": 34,
      "travel-sample:travel-sample-index:total_queries_error": 5,
      "travel-sample:travel-sample-index:total_queries_slow": 0,
      "travel-sample:travel-sample-index:total_queries_timeout": 0,
      "travel-sample:travel-sample-index:total_request_time": 628280816,
      "travel-sample:travel-sample-index:total_term_searchers": 1669,
      "travel-sample:travel-sample-index:total_term_searchers_finished": 1669,
      "travel-sample:travel-sample-index:writer_execute_batch_count": 0
    }