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

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

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

相关资料

ElasticSearch之Index stats API的更多相关文章

  1. elasticsearch中常用的API

    elasticsearch中常用的API分类如下: 文档API: 提供对文档的增删改查操作 搜索API: 提供对文档进行某个字段的查询 索引API: 提供对索引进行操作,查看索引信息等 查看API: ...

  2. Elasticsearch 单模式下API的增删改查操作

    <pre name="code" class="html">Elasticsearch 单模式下API的增删改查操作 http://192.168. ...

  3. Elasticsearch Java Rest Client API 整理总结 (二) —— SearchAPI

    目录 引言 Search APIs Search API Search Request 可选参数 使用 SearchSourceBuilder 构建查询条件 指定排序 高亮请求 聚合请求 建议请求 R ...

  4. ElasticSearch入门-搜索(java api)

    ElasticSearch入门-搜索(java api) package com.qlyd.searchhelper; import java.util.Map; import net.sf.json ...

  5. Elasticsearch Java Rest Client API 整理总结 (三)——Building Queries

    目录 上篇回顾 Building Queries 匹配所有的查询 全文查询 Full Text Queries 什么是全文查询? Match 全文查询 API 列表 基于词项的查询 Term Term ...

  6. 使用curator 来管理elasticsearch的index

    这里我们参考官网安装curator https://www.cookiesinn.org/elasticsearch_curator_delete_indices/ https://www.elast ...

  7. Atitit.index manager api design 索引管理api设计

    Atitit.index manager api design 索引管理api设计 1. kw 1 1.1. 索引类型 unique,normal,fulltxt 1 1.2. 聚集索引(cluste ...

  8. Atitit.index manager api design 索引管理api设计

    Atitit.index manager api design 索引管理api设计 1. kw1 1.1. 索引类型 unique,normal,fulltxt1 1.2. 聚集索引(clustere ...

  9. elasticsearch 第四篇(API约定)

    对多个indices进行操作 es中大多resetapi支持请求多个index, 例如”test1,test2,test3”,index也可以使用通配符, 例如”test*“, 还可以使用+,-来包含 ...

  10. Elasticsearch批处理操作——bulk API

    Elasticsearch提供的批量处理功能,是通过使用_bulk API实现的.这个功能之所以重要,在于它提供了非常高效的机制来尽可能快的完成多个操作,与此同时使用尽可能少的网络往返. 1.批量索引 ...

随机推荐

  1. Unity 游戏开发、01 基础知识大全、简单功能脚本实现

    2.3 窗口布局 Unity默认窗口布局 Hierarchy 层级窗口 Scene 场景窗口,3D视图窗口 Game 游戏播放窗口 Inspector 检查器窗口,属性窗口 Project 项目窗口 ...

  2. 触动精灵生成的APK文件如何加固保护

    触动精灵是一款模拟手机触摸.按键操作的软件,通过制作脚本,可以让触动精灵代替双手,自动执行一系列触摸.按键操作, 深受一些极客开发者喜爱. 触动精灵生成的APK文件自带了一些基础的加密,可以保护APK ...

  3. 使用aop(肉夹馍)为BlazorServer实现统一异常处理

    背景 用户做一个操作往往对应一个方法的执行,而方法内部会调用别的方法,内部可能又会调用别的方法,从而形成一个调用链.我们一般是在最顶层的方法去加try,而不是调用链的每一层都去加try. 在web开发 ...

  4. matlab快速入门笔记

    命名规则: clc:清除命令行的所有命令 clear all:清除所有工作区的内容 注释:两个% + 空格 %% matlab的数据类型 1.数字 3 3 * 5 3 / 5 3 + 5 3 - 5 ...

  5. k8s集群证书过期,重新生成证书

    Kubernetes集群证书过期后,使用kubeadm重新颁发证书 默认情况下部署kubernetes集群的证书一年内便过期,如果不及时升级证书导致证书过期,Kubernetes控制节点便会不可用,所 ...

  6. Python 文件处理指南:打开、读取、写入、追加、创建和删除文件

    文件处理是任何Web应用程序的重要部分.Python有多个用于创建.读取.更新和删除文件的函数. 文件处理 在Python中处理文件的关键函数是open()函数.open()函数接受两个参数:文件名和 ...

  7. SHA256算法加密工具类

    代码如下,请自取 /** * @description: SHA256算法加密 * @author: luolei * @Date: 2022-10-31 17:16 */ public class ...

  8. parallel-comparator-200

    直接上来就是c代码,这种题还是第一次做,直接写代码逆向回去就行了 但是奈何水平太低写不回去... 分析 需要下面的两个字符串相等才能得到正确的程序,若要相等就只能让result等于0 那就意味着亦或的 ...

  9. MySQL-管理员root@'locahost' 丢失,怎么处理?

    版权声明:原创作品,谢绝转载!否则将追究法律责任. ----- 作者:kirin 跳过授权表 ----> 不开启验证功能(无密码登录) --skip-grant-tables 阻止所有tcp/i ...

  10. 赛意SMOM和金蝶云星空单据接口对接

    赛意SMOM和金蝶云星空单据接口对接 数据源系统:金蝶云星空 金蝶K/3Cloud在总结百万家客户管理最佳实践的基础上,提供了标准的管理模式:通过标准的业务架构:多会计准则.多币别.多地点.多组织.多 ...