Saturday, 21 November 2015

Elasticsearch: Get index statistics

In previous post, I explained how to get node level statistics. In the same way you can get index level statistics.

Syntax
GET indexName/_stats

GET books/_stats
Response like below.
{
   "_shards": {
      "total": 10,
      "successful": 5,
      "failed": 0
   },
   "_all": {
      "primaries": {
         "docs": {
            "count": 2,
            "deleted": 0
         },
         "store": {
            "size_in_bytes": 5584,
            "throttle_time_in_millis": 0
         },
         "indexing": {
            "index_total": 2,
            "index_time_in_millis": 236,
            "index_current": 0,
            "delete_total": 0,
            "delete_time_in_millis": 0,
            "delete_current": 0,
            "noop_update_total": 0,
            "is_throttled": false,
            "throttle_time_in_millis": 0
         },
         "get": {
            "total": 7,
            "time_in_millis": 84,
            "exists_total": 1,
            "exists_time_in_millis": 81,
            "missing_total": 6,
            "missing_time_in_millis": 3,
            "current": 0
         },
         "search": {
            "open_contexts": 0,
            "query_total": 5,
            "query_time_in_millis": 0,
            "query_current": 0,
            "fetch_total": 2,
            "fetch_time_in_millis": 119,
            "fetch_current": 0
         },
         "merges": {
            "current": 0,
            "current_docs": 0,
            "current_size_in_bytes": 0,
            "total": 0,
            "total_time_in_millis": 0,
            "total_docs": 0,
            "total_size_in_bytes": 0
         },
         "refresh": {
            "total": 7,
            "total_time_in_millis": 794
         },
         "flush": {
            "total": 2,
            "total_time_in_millis": 3347
         },
         "warmer": {
            "current": 0,
            "total": 14,
            "total_time_in_millis": 2
         },
         "filter_cache": {
            "memory_size_in_bytes": 0,
            "evictions": 0
         },
         "id_cache": {
            "memory_size_in_bytes": 0
         },
         "fielddata": {
            "memory_size_in_bytes": 0,
            "evictions": 0
         },
         "percolate": {
            "total": 0,
            "time_in_millis": 0,
            "current": 0,
            "memory_size_in_bytes": -1,
            "memory_size": "-1b",
            "queries": 0
         },
         "completion": {
            "size_in_bytes": 0
         },
         "segments": {
            "count": 2,
            "memory_in_bytes": 11476,
            "index_writer_memory_in_bytes": 0,
            "index_writer_max_memory_in_bytes": 2560000,
            "version_map_memory_in_bytes": 0,
            "fixed_bit_set_memory_in_bytes": 0
         },
         "translog": {
            "operations": 0,
            "size_in_bytes": 17
         },
         "suggest": {
            "total": 0,
            "time_in_millis": 0,
            "current": 0
         },
         "query_cache": {
            "memory_size_in_bytes": 0,
            "evictions": 0,
            "hit_count": 0,
            "miss_count": 0
         }
      },
      "total": {
         "docs": {
            "count": 2,
            "deleted": 0
         },
         "store": {
            "size_in_bytes": 5584,
            "throttle_time_in_millis": 0
         },
         "indexing": {
            "index_total": 2,
            "index_time_in_millis": 236,
            "index_current": 0,
            "delete_total": 0,
            "delete_time_in_millis": 0,
            "delete_current": 0,
            "noop_update_total": 0,
            "is_throttled": false,
            "throttle_time_in_millis": 0
         },
         "get": {
            "total": 7,
            "time_in_millis": 84,
            "exists_total": 1,
            "exists_time_in_millis": 81,
            "missing_total": 6,
            "missing_time_in_millis": 3,
            "current": 0
         },
         "search": {
            "open_contexts": 0,
            "query_total": 5,
            "query_time_in_millis": 0,
            "query_current": 0,
            "fetch_total": 2,
            "fetch_time_in_millis": 119,
            "fetch_current": 0
         },
         "merges": {
            "current": 0,
            "current_docs": 0,
            "current_size_in_bytes": 0,
            "total": 0,
            "total_time_in_millis": 0,
            "total_docs": 0,
            "total_size_in_bytes": 0
         },
         "refresh": {
            "total": 7,
            "total_time_in_millis": 794
         },
         "flush": {
            "total": 2,
            "total_time_in_millis": 3347
         },
         "warmer": {
            "current": 0,
            "total": 14,
            "total_time_in_millis": 2
         },
         "filter_cache": {
            "memory_size_in_bytes": 0,
            "evictions": 0
         },
         "id_cache": {
            "memory_size_in_bytes": 0
         },
         "fielddata": {
            "memory_size_in_bytes": 0,
            "evictions": 0
         },
         "percolate": {
            "total": 0,
            "time_in_millis": 0,
            "current": 0,
            "memory_size_in_bytes": -1,
            "memory_size": "-1b",
            "queries": 0
         },
         "completion": {
            "size_in_bytes": 0
         },
         "segments": {
            "count": 2,
            "memory_in_bytes": 11476,
            "index_writer_memory_in_bytes": 0,
            "index_writer_max_memory_in_bytes": 2560000,
            "version_map_memory_in_bytes": 0,
            "fixed_bit_set_memory_in_bytes": 0
         },
         "translog": {
            "operations": 0,
            "size_in_bytes": 17
         },
         "suggest": {
            "total": 0,
            "time_in_millis": 0,
            "current": 0
         },
         "query_cache": {
            "memory_size_in_bytes": 0,
            "evictions": 0,
            "hit_count": 0,
            "miss_count": 0
         }
      }
   },
   "indices": {
      "books": {
         "primaries": {
            "docs": {
               "count": 2,
               "deleted": 0
            },
            "store": {
               "size_in_bytes": 5584,
               "throttle_time_in_millis": 0
            },
            "indexing": {
               "index_total": 2,
               "index_time_in_millis": 236,
               "index_current": 0,
               "delete_total": 0,
               "delete_time_in_millis": 0,
               "delete_current": 0,
               "noop_update_total": 0,
               "is_throttled": false,
               "throttle_time_in_millis": 0
            },
            "get": {
               "total": 7,
               "time_in_millis": 84,
               "exists_total": 1,
               "exists_time_in_millis": 81,
               "missing_total": 6,
               "missing_time_in_millis": 3,
               "current": 0
            },
            "search": {
               "open_contexts": 0,
               "query_total": 5,
               "query_time_in_millis": 0,
               "query_current": 0,
               "fetch_total": 2,
               "fetch_time_in_millis": 119,
               "fetch_current": 0
            },
            "merges": {
               "current": 0,
               "current_docs": 0,
               "current_size_in_bytes": 0,
               "total": 0,
               "total_time_in_millis": 0,
               "total_docs": 0,
               "total_size_in_bytes": 0
            },
            "refresh": {
               "total": 7,
               "total_time_in_millis": 794
            },
            "flush": {
               "total": 2,
               "total_time_in_millis": 3347
            },
            "warmer": {
               "current": 0,
               "total": 14,
               "total_time_in_millis": 2
            },
            "filter_cache": {
               "memory_size_in_bytes": 0,
               "evictions": 0
            },
            "id_cache": {
               "memory_size_in_bytes": 0
            },
            "fielddata": {
               "memory_size_in_bytes": 0,
               "evictions": 0
            },
            "percolate": {
               "total": 0,
               "time_in_millis": 0,
               "current": 0,
               "memory_size_in_bytes": -1,
               "memory_size": "-1b",
               "queries": 0
            },
            "completion": {
               "size_in_bytes": 0
            },
            "segments": {
               "count": 2,
               "memory_in_bytes": 11476,
               "index_writer_memory_in_bytes": 0,
               "index_writer_max_memory_in_bytes": 2560000,
               "version_map_memory_in_bytes": 0,
               "fixed_bit_set_memory_in_bytes": 0
            },
            "translog": {
               "operations": 0,
               "size_in_bytes": 17
            },
            "suggest": {
               "total": 0,
               "time_in_millis": 0,
               "current": 0
            },
            "query_cache": {
               "memory_size_in_bytes": 0,
               "evictions": 0,
               "hit_count": 0,
               "miss_count": 0
            }
         },
         "total": {
            "docs": {
               "count": 2,
               "deleted": 0
            },
            "store": {
               "size_in_bytes": 5584,
               "throttle_time_in_millis": 0
            },
            "indexing": {
               "index_total": 2,
               "index_time_in_millis": 236,
               "index_current": 0,
               "delete_total": 0,
               "delete_time_in_millis": 0,
               "delete_current": 0,
               "noop_update_total": 0,
               "is_throttled": false,
               "throttle_time_in_millis": 0
            },
            "get": {
               "total": 7,
               "time_in_millis": 84,
               "exists_total": 1,
               "exists_time_in_millis": 81,
               "missing_total": 6,
               "missing_time_in_millis": 3,
               "current": 0
            },
            "search": {
               "open_contexts": 0,
               "query_total": 5,
               "query_time_in_millis": 0,
               "query_current": 0,
               "fetch_total": 2,
               "fetch_time_in_millis": 119,
               "fetch_current": 0
            },
            "merges": {
               "current": 0,
               "current_docs": 0,
               "current_size_in_bytes": 0,
               "total": 0,
               "total_time_in_millis": 0,
               "total_docs": 0,
               "total_size_in_bytes": 0
            },
            "refresh": {
               "total": 7,
               "total_time_in_millis": 794
            },
            "flush": {
               "total": 2,
               "total_time_in_millis": 3347
            },
            "warmer": {
               "current": 0,
               "total": 14,
               "total_time_in_millis": 2
            },
            "filter_cache": {
               "memory_size_in_bytes": 0,
               "evictions": 0
            },
            "id_cache": {
               "memory_size_in_bytes": 0
            },
            "fielddata": {
               "memory_size_in_bytes": 0,
               "evictions": 0
            },
            "percolate": {
               "total": 0,
               "time_in_millis": 0,
               "current": 0,
               "memory_size_in_bytes": -1,
               "memory_size": "-1b",
               "queries": 0
            },
            "completion": {
               "size_in_bytes": 0
            },
            "segments": {
               "count": 2,
               "memory_in_bytes": 11476,
               "index_writer_memory_in_bytes": 0,
               "index_writer_max_memory_in_bytes": 2560000,
               "version_map_memory_in_bytes": 0,
               "fixed_bit_set_memory_in_bytes": 0
            },
            "translog": {
               "operations": 0,
               "size_in_bytes": 17
            },
            "suggest": {
               "total": 0,
               "time_in_millis": 0,
               "current": 0
            },
            "query_cache": {
               "memory_size_in_bytes": 0,
               "evictions": 0,
               "hit_count": 0,
               "miss_count": 0
            }
         }
      }
   }
}

Note:
1. To get all index statistics
GET _all/_stats

2. To get more than one index statistics

GET index1,index2/_stats



Prevoius                                                 Next                                                 Home

No comments:

Post a Comment