首页 > 其他分享 >ElasticSearch之Index stats API

ElasticSearch之Index stats API

时间:2023-12-02 17:35:26浏览次数:30  
标签:Index stats millis bytes current API time total size

获取指定索引的统计数据。

获取指定索引的全部统计数据,命令样例如下:

curl -X GET "https://localhost:9200/testindex_001/_stats?pretty" --cacert $ES_HOME/config/certs/http_ca.crt -u "elastic:ohCxPH=QBE+s5=*lo7F9"

执行结果的样例,如下:

{
  "_shards" : {
    "total" : 2,
    "successful" : 1,
    "failed" : 0
  },
  "_all" : {
    "primaries" : {
      "docs" : {
        "count" : 0,
        "deleted" : 0
      },
      "shard_stats" : {
        "total_count" : 1
      },
      "store" : {
        "size_in_bytes" : 249,
        "total_data_set_size_in_bytes" : 249,
        "reserved_in_bytes" : 0
      },
      "indexing" : {
        "index_total" : 0,
        "index_time_in_millis" : 0,
        "index_current" : 0,
        "index_failed" : 0,
        "delete_total" : 0,
        "delete_time_in_millis" : 0,
        "delete_current" : 0,
        "noop_update_total" : 0,
        "is_throttled" : false,
        "throttle_time_in_millis" : 0,
        "write_load" : 0.0
      },
      "get" : {
        "total" : 0,
        "time_in_millis" : 0,
        "exists_total" : 0,
        "exists_time_in_millis" : 0,
        "missing_total" : 0,
        "missing_time_in_millis" : 0,
        "current" : 0
      },
      "search" : {
        "open_contexts" : 0,
        "query_total" : 0,
        "query_time_in_millis" : 0,
        "query_current" : 0,
        "fetch_total" : 0,
        "fetch_time_in_millis" : 0,
        "fetch_current" : 0,
        "scroll_total" : 0,
        "scroll_time_in_millis" : 0,
        "scroll_current" : 0,
        "suggest_total" : 0,
        "suggest_time_in_millis" : 0,
        "suggest_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,
        "total_stopped_time_in_millis" : 0,
        "total_throttled_time_in_millis" : 0,
        "total_auto_throttle_in_bytes" : 20971520
      },
      "refresh" : {
        "total" : 8,
        "total_time_in_millis" : 50,
        "external_total" : 5,
        "external_total_time_in_millis" : 52,
        "listeners" : 0
      },
      "flush" : {
        "total" : 1,
        "periodic" : 1,
        "total_time_in_millis" : 174
      },
      "warmer" : {
        "current" : 0,
        "total" : 4,
        "total_time_in_millis" : 1
      },
      "query_cache" : {
        "memory_size_in_bytes" : 0,
        "total_count" : 0,
        "hit_count" : 0,
        "miss_count" : 0,
        "cache_size" : 0,
        "cache_count" : 0,
        "evictions" : 0
      },
      "fielddata" : {
        "memory_size_in_bytes" : 0,
        "evictions" : 0,
        "global_ordinals" : {
          "build_time_in_millis" : 0
        }
      },
      "completion" : {
        "size_in_bytes" : 0
      },
      "segments" : {
        "count" : 0,
        "memory_in_bytes" : 0,
        "terms_memory_in_bytes" : 0,
        "stored_fields_memory_in_bytes" : 0,
        "term_vectors_memory_in_bytes" : 0,
        "norms_memory_in_bytes" : 0,
        "points_memory_in_bytes" : 0,
        "doc_values_memory_in_bytes" : 0,
        "index_writer_memory_in_bytes" : 0,
        "version_map_memory_in_bytes" : 0,
        "fixed_bit_set_memory_in_bytes" : 0,
        "max_unsafe_auto_id_timestamp" : -1,
        "file_sizes" : { }
      },
      "translog" : {
        "operations" : 0,
        "size_in_bytes" : 55,
        "uncommitted_operations" : 0,
        "uncommitted_size_in_bytes" : 55,
        "earliest_last_modified_age" : 26213582
      },
      "request_cache" : {
        "memory_size_in_bytes" : 0,
        "evictions" : 0,
        "hit_count" : 0,
        "miss_count" : 0
      },
      "recovery" : {
        "current_as_source" : 0,
        "current_as_target" : 0,
        "throttle_time_in_millis" : 0
      },
      "bulk" : {
        "total_operations" : 0,
        "total_time_in_millis" : 0,
        "total_size_in_bytes" : 0,
        "avg_time_in_millis" : 0,
        "avg_size_in_bytes" : 0
      },
      "dense_vector" : {
        "value_count" : 0
      }
    },
    "total" : {
      "docs" : {
        "count" : 0,
        "deleted" : 0
      },
      "shard_stats" : {
        "total_count" : 1
      },
      "store" : {
        "size_in_bytes" : 249,
        "total_data_set_size_in_bytes" : 249,
        "reserved_in_bytes" : 0
      },
      "indexing" : {
        "index_total" : 0,
        "index_time_in_millis" : 0,
        "index_current" : 0,
        "index_failed" : 0,
        "delete_total" : 0,
        "delete_time_in_millis" : 0,
        "delete_current" : 0,
        "noop_update_total" : 0,
        "is_throttled" : false,
        "throttle_time_in_millis" : 0,
        "write_load" : 0.0
      },
      "get" : {
        "total" : 0,
        "time_in_millis" : 0,
        "exists_total" : 0,
        "exists_time_in_millis" : 0,
        "missing_total" : 0,
        "missing_time_in_millis" : 0,
        "current" : 0
      },
      "search" : {
        "open_contexts" : 0,
        "query_total" : 0,
        "query_time_in_millis" : 0,
        "query_current" : 0,
        "fetch_total" : 0,
        "fetch_time_in_millis" : 0,
        "fetch_current" : 0,
        "scroll_total" : 0,
        "scroll_time_in_millis" : 0,
        "scroll_current" : 0,
        "suggest_total" : 0,
        "suggest_time_in_millis" : 0,
        "suggest_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,
        "total_stopped_time_in_millis" : 0,
        "total_throttled_time_in_millis" : 0,
        "total_auto_throttle_in_bytes" : 20971520
      },
      "refresh" : {
        "total" : 8,
        "total_time_in_millis" : 50,
        "external_total" : 5,
        "external_total_time_in_millis" : 52,
        "listeners" : 0
      },
      "flush" : {
        "total" : 1,
        "periodic" : 1,
        "total_time_in_millis" : 174
      },
      "warmer" : {
        "current" : 0,
        "total" : 4,
        "total_time_in_millis" : 1
      },
      "query_cache" : {
        "memory_size_in_bytes" : 0,
        "total_count" : 0,
        "hit_count" : 0,
        "miss_count" : 0,
        "cache_size" : 0,
        "cache_count" : 0,
        "evictions" : 0
      },
      "fielddata" : {
        "memory_size_in_bytes" : 0,
        "evictions" : 0,
        "global_ordinals" : {
          "build_time_in_millis" : 0
        }
      },
      "completion" : {
        "size_in_bytes" : 0
      },
      "segments" : {
        "count" : 0,
        "memory_in_bytes" : 0,
        "terms_memory_in_bytes" : 0,
        "stored_fields_memory_in_bytes" : 0,
        "term_vectors_memory_in_bytes" : 0,
        "norms_memory_in_bytes" : 0,
        "points_memory_in_bytes" : 0,
        "doc_values_memory_in_bytes" : 0,
        "index_writer_memory_in_bytes" : 0,
        "version_map_memory_in_bytes" : 0,
        "fixed_bit_set_memory_in_bytes" : 0,
        "max_unsafe_auto_id_timestamp" : -1,
        "file_sizes" : { }
      },
      "translog" : {
        "operations" : 0,
        "size_in_bytes" : 55,
        "uncommitted_operations" : 0,
        "uncommitted_size_in_bytes" : 55,
        "earliest_last_modified_age" : 26213582
      },
      "request_cache" : {
        "memory_size_in_bytes" : 0,
        "evictions" : 0,
        "hit_count" : 0,
        "miss_count" : 0
      },
      "recovery" : {
        "current_as_source" : 0,
        "current_as_target" : 0,
        "throttle_time_in_millis" : 0
      },
      "bulk" : {
        "total_operations" : 0,
        "total_time_in_millis" : 0,
        "total_size_in_bytes" : 0,
        "avg_time_in_millis" : 0,
        "avg_size_in_bytes" : 0
      },
      "dense_vector" : {
        "value_count" : 0
      }
    }
  },
  "indices" : {
    "testindex_001" : {
      "uuid" : "7iGJRFfxRd2jD3qP-KDRmQ",
      "health" : "yellow",
      "status" : "open",
      "primaries" : {
        "docs" : {
          "count" : 0,
          "deleted" : 0
        },
        "shard_stats" : {
          "total_count" : 1
        },
        "store" : {
          "size_in_bytes" : 249,
          "total_data_set_size_in_bytes" : 249,
          "reserved_in_bytes" : 0
        },
        "indexing" : {
          "index_total" : 0,
          "index_time_in_millis" : 0,
          "index_current" : 0,
          "index_failed" : 0,
          "delete_total" : 0,
          "delete_time_in_millis" : 0,
          "delete_current" : 0,
          "noop_update_total" : 0,
          "is_throttled" : false,
          "throttle_time_in_millis" : 0,
          "write_load" : 0.0
        },
        "get" : {
          "total" : 0,
          "time_in_millis" : 0,
          "exists_total" : 0,
          "exists_time_in_millis" : 0,
          "missing_total" : 0,
          "missing_time_in_millis" : 0,
          "current" : 0
        },
        "search" : {
          "open_contexts" : 0,
          "query_total" : 0,
          "query_time_in_millis" : 0,
          "query_current" : 0,
          "fetch_total" : 0,
          "fetch_time_in_millis" : 0,
          "fetch_current" : 0,
          "scroll_total" : 0,
          "scroll_time_in_millis" : 0,
          "scroll_current" : 0,
          "suggest_total" : 0,
          "suggest_time_in_millis" : 0,
          "suggest_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,
          "total_stopped_time_in_millis" : 0,
          "total_throttled_time_in_millis" : 0,
          "total_auto_throttle_in_bytes" : 20971520
        },
        "refresh" : {
          "total" : 8,
          "total_time_in_millis" : 50,
          "external_total" : 5,
          "external_total_time_in_millis" : 52,
          "listeners" : 0
        },
        "flush" : {
          "total" : 1,
          "periodic" : 1,
          "total_time_in_millis" : 174
        },
        "warmer" : {
          "current" : 0,
          "total" : 4,
          "total_time_in_millis" : 1
        },
        "query_cache" : {
          "memory_size_in_bytes" : 0,
          "total_count" : 0,
          "hit_count" : 0,
          "miss_count" : 0,
          "cache_size" : 0,
          "cache_count" : 0,
          "evictions" : 0
        },
        "fielddata" : {
          "memory_size_in_bytes" : 0,
          "evictions" : 0,
          "global_ordinals" : {
            "build_time_in_millis" : 0
          }
        },
        "completion" : {
          "size_in_bytes" : 0
        },
        "segments" : {
          "count" : 0,
          "memory_in_bytes" : 0,
          "terms_memory_in_bytes" : 0,
          "stored_fields_memory_in_bytes" : 0,
          "term_vectors_memory_in_bytes" : 0,
          "norms_memory_in_bytes" : 0,
          "points_memory_in_bytes" : 0,
          "doc_values_memory_in_bytes" : 0,
          "index_writer_memory_in_bytes" : 0,
          "version_map_memory_in_bytes" : 0,
          "fixed_bit_set_memory_in_bytes" : 0,
          "max_unsafe_auto_id_timestamp" : -1,
          "file_sizes" : { }
        },
        "translog" : {
          "operations" : 0,
          "size_in_bytes" : 55,
          "uncommitted_operations" : 0,
          "uncommitted_size_in_bytes" : 55,
          "earliest_last_modified_age" : 26213582
        },
        "request_cache" : {
          "memory_size_in_bytes" : 0,
          "evictions" : 0,
          "hit_count" : 0,
          "miss_count" : 0
        },
        "recovery" : {
          "current_as_source" : 0,
          "current_as_target" : 0,
          "throttle_time_in_millis" : 0
        },
        "bulk" : {
          "total_operations" : 0,
          "total_time_in_millis" : 0,
          "total_size_in_bytes" : 0,
          "avg_time_in_millis" : 0,
          "avg_size_in_bytes" : 0
        },
        "dense_vector" : {
          "value_count" : 0
        }
      },
      "total" : {
        "docs" : {
          "count" : 0,
          "deleted" : 0
        },
        "shard_stats" : {
          "total_count" : 1
        },
        "store" : {
          "size_in_bytes" : 249,
          "total_data_set_size_in_bytes" : 249,
          "reserved_in_bytes" : 0
        },
        "indexing" : {
          "index_total" : 0,
          "index_time_in_millis" : 0,
          "index_current" : 0,
          "index_failed" : 0,
          "delete_total" : 0,
          "delete_time_in_millis" : 0,
          "delete_current" : 0,
          "noop_update_total" : 0,
          "is_throttled" : false,
          "throttle_time_in_millis" : 0,
          "write_load" : 0.0
        },
        "get" : {
          "total" : 0,
          "time_in_millis" : 0,
          "exists_total" : 0,
          "exists_time_in_millis" : 0,
          "missing_total" : 0,
          "missing_time_in_millis" : 0,
          "current" : 0
        },
        "search" : {
          "open_contexts" : 0,
          "query_total" : 0,
          "query_time_in_millis" : 0,
          "query_current" : 0,
          "fetch_total" : 0,
          "fetch_time_in_millis" : 0,
          "fetch_current" : 0,
          "scroll_total" : 0,
          "scroll_time_in_millis" : 0,
          "scroll_current" : 0,
          "suggest_total" : 0,
          "suggest_time_in_millis" : 0,
          "suggest_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,
          "total_stopped_time_in_millis" : 0,
          "total_throttled_time_in_millis" : 0,
          "total_auto_throttle_in_bytes" : 20971520
        },
        "refresh" : {
          "total" : 8,
          "total_time_in_millis" : 50,
          "external_total" : 5,
          "external_total_time_in_millis" : 52,
          "listeners" : 0
        },
        "flush" : {
          "total" : 1,
          "periodic" : 1,
          "total_time_in_millis" : 174
        },
        "warmer" : {
          "current" : 0,
          "total" : 4,
          "total_time_in_millis" : 1
        },
        "query_cache" : {
          "memory_size_in_bytes" : 0,
          "total_count" : 0,
          "hit_count" : 0,
          "miss_count" : 0,
          "cache_size" : 0,
          "cache_count" : 0,
          "evictions" : 0
        },
        "fielddata" : {
          "memory_size_in_bytes" : 0,
          "evictions" : 0,
          "global_ordinals" : {
            "build_time_in_millis" : 0
          }
        },
        "completion" : {
          "size_in_bytes" : 0
        },
        "segments" : {
          "count" : 0,
          "memory_in_bytes" : 0,
          "terms_memory_in_bytes" : 0,
          "stored_fields_memory_in_bytes" : 0,
          "term_vectors_memory_in_bytes" : 0,
          "norms_memory_in_bytes" : 0,
          "points_memory_in_bytes" : 0,
          "doc_values_memory_in_bytes" : 0,
          "index_writer_memory_in_bytes" : 0,
          "version_map_memory_in_bytes" : 0,
          "fixed_bit_set_memory_in_bytes" : 0,
          "max_unsafe_auto_id_timestamp" : -1,
          "file_sizes" : { }
        },
        "translog" : {
          "operations" : 0,
          "size_in_bytes" : 55,
          "uncommitted_operations" : 0,
          "uncommitted_size_in_bytes" : 55,
          "earliest_last_modified_age" : 26213582
        },
        "request_cache" : {
          "memory_size_in_bytes" : 0,
          "evictions" : 0,
          "hit_count" : 0,
          "miss_count" : 0
        },
        "recovery" : {
          "current_as_source" : 0,
          "current_as_target" : 0,
          "throttle_time_in_millis" : 0
        },
        "bulk" : {
          "total_operations" : 0,
          "total_time_in_millis" : 0,
          "total_size_in_bytes" : 0,
          "avg_time_in_millis" : 0,
          "avg_size_in_bytes" : 0
        },
        "dense_vector" : {
          "value_count" : 0
        }
      }
    }
  }
}

获取指定索引的指定指标的统计数据,命令样例如下:

curl -X GET "https://localhost:9200/testindex_001/_stats/completion?pretty" --cacert $ES_HOME/config/certs/http_ca.crt -u "elastic:ohCxPH=QBE+s5=*lo7F9"

执行结果的样例,如下:

{
  "_shards" : {
    "total" : 2,
    "successful" : 1,
    "failed" : 0
  },
  "_all" : {
    "primaries" : {
      "completion" : {
        "size_in_bytes" : 0
      }
    },
    "total" : {
      "completion" : {
        "size_in_bytes" : 0
      }
    }
  },
  "indices" : {
    "testindex_001" : {
      "uuid" : "7iGJRFfxRd2jD3qP-KDRmQ",
      "health" : "yellow",
      "status" : "open",
      "primaries" : {
        "completion" : {
          "size_in_bytes" : 0
        }
      },
      "total" : {
        "completion" : {
          "size_in_bytes" : 0
        }
      }
    }
  }
}

允许指定的指标,如下:

  • _all,默认值,即全部指标,无需显式指定。
  • completion
  • docs
  • fielddata
  • flush
  • get
  • indexing
  • merge
  • query_cache
  • refresh
  • request_cache
  • search
  • segments
  • store
  • translog

方法参数
level,指标的统计级别,可选值:

  • cluster
  • indices
  • shards

相关资料

标签:Index,stats,millis,bytes,current,API,time,total,size
From: https://www.cnblogs.com/jackieathome/p/17871897.html

相关文章

  • 前端学习-JavaScript学习-js基础-API02-轮播图案例
    自己写的<!DOCTYPEhtml><htmllang="en"><head><metacharset="UTF-8"><metaname="viewport"content="width=device-width,initial-scale=1.0"><title>Document</title>......
  • ElasticSearch之Get index settings API
    获取指定索引的参数的值。获取指定索引的全部参数,命令样例如下:curl-XGET"https://localhost:9200/testindex_002/_settings?pretty"--cacert$ES_HOME/config/certs/http_ca.crt-u"elastic:ohCxPH=QBE+s5=*lo7F9"执行结果的样例,如下:{"testindex_002":{"......
  • 探索 Web API:SpeechSynthesis 与文本语言转换技术
    一、引言随着科技的不断发展,人机交互的方式也在不断演变。语音识别和合成技术在人工智能领域中具有重要地位,它们为残障人士和日常生活中的各种场景提供了便利。WebAPI是Web应用程序接口的一种,允许开发者构建与浏览器和操作系统集成的应用程序。本文将探讨WebAPI中的Spe......
  • 【JavaSE】时间API
    JDK8版本之前的时间API(了解)Data类SimpleDateFormat类SimpleDateFormat类指定格式查API帮助文档即可SimpleDateFormatDemo.javaimportjava.text.ParseException;importjava.text.SimpleDateFormat;importjava.util.Date;publicclassSimpleDateFormatDemo{pu......
  • ElasticSearch之Get index API
    获取指定索引的基本信息。命令样例如下:curl-XGET"https://localhost:9200/testindex_001?pretty"--cacert$ES_HOME/config/certs/http_ca.crt-u"elastic:ohCxPH=QBE+s5=*lo7F9"执行结果的样例,如下:{"testindex_002":{"aliases":{},......
  • ElasticSearch之Exists API
    检查指定名称的索引是否存在。命令样例如下:curl-I"https://localhost:9200/testindex_002?pretty"--cacert$ES_HOME/config/certs/http_ca.crt-u"elastic:ohCxPH=QBE+s5=*lo7F9"假如索引不存在,则执行结果的样例,如下:HTTP/1.1404NotFoundX-elastic-product:Elastics......
  • ElasticSearch之Open index API
    打开指定的索引。命令样例如下:curl-XPOST"https://localhost:9200/testindex_003/_open?pretty"--cacert$ES_HOME/config/certs/http_ca.crt-u"elastic:ohCxPH=QBE+s5=*lo7F9"执行结果的样例,如下:{"acknowledged":true,"shards_acknowledge......
  • 学习笔记4:JavaSE & API(网络编程 & 多线程)
    1、java.net.Socket:(1)定义:Socket(套接字)封装了TCP协议的通讯细节,是的我们使用它可以与服务端建立网络链接,并通过它获取两个流(一个输入一个输出),然后使用这两个流的读写操作完成与服务端的数据交互。(2)方法getInputStream():获取输入流,返回值是InputStream的一个子类实例。ge......
  • ElasticSearch之Close index API
    关闭指定的索引。索引关闭之后:停止对读、写操作的响应。停止检索操作的响应。在索引关闭前,允许执行的操作,关闭之后均不允许执行。ElasticSearch取消对索引的相关维护操作,包含内存中的数据结构,以及保存在存储中的数据。占用的存储空间,并不会主动释放。ElasticSearch不会删除......
  • ElasticSearch之Clone index API
    使用已有的索引,复制得到一个索引。关闭testindex_001的写入操作,命令样例如下:curl-XPUT"https://localhost:9200/testindex_001/_settings?pretty"-H'Content-Type:application/json'-d'{"settings":{"index.blocks.write":true}}......