ElasticSearch之Index stats API

2023-12-07 09:04
文章标签 elasticsearch api index stats

本文主要是介绍ElasticSearch之Index stats API,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

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

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

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 API
  • Suggesters
  • Refresh API
  • Text type family
  • Flush API
  • Index API
  • Merge
  • Shard request cache settings
  • Translog

这篇关于ElasticSearch之Index stats API的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/465278

相关文章

ElasticSearch+Kibana通过Docker部署到Linux服务器中操作方法

《ElasticSearch+Kibana通过Docker部署到Linux服务器中操作方法》本文介绍了Elasticsearch的基本概念,包括文档和字段、索引和映射,还详细描述了如何通过Docker... 目录1、ElasticSearch概念2、ElasticSearch、Kibana和IK分词器部署

Java调用DeepSeek API的最佳实践及详细代码示例

《Java调用DeepSeekAPI的最佳实践及详细代码示例》:本文主要介绍如何使用Java调用DeepSeekAPI,包括获取API密钥、添加HTTP客户端依赖、创建HTTP请求、处理响应、... 目录1. 获取API密钥2. 添加HTTP客户端依赖3. 创建HTTP请求4. 处理响应5. 错误处理6.

Deepseek R1模型本地化部署+API接口调用详细教程(释放AI生产力)

《DeepseekR1模型本地化部署+API接口调用详细教程(释放AI生产力)》本文介绍了本地部署DeepSeekR1模型和通过API调用将其集成到VSCode中的过程,作者详细步骤展示了如何下载和... 目录前言一、deepseek R1模型与chatGPT o1系列模型对比二、本地部署步骤1.安装oll

浅析如何使用Swagger生成带权限控制的API文档

《浅析如何使用Swagger生成带权限控制的API文档》当涉及到权限控制时,如何生成既安全又详细的API文档就成了一个关键问题,所以这篇文章小编就来和大家好好聊聊如何用Swagger来生成带有... 目录准备工作配置 Swagger权限控制给 API 加上权限注解查看文档注意事项在咱们的开发工作里,API

一分钟带你上手Python调用DeepSeek的API

《一分钟带你上手Python调用DeepSeek的API》最近DeepSeek非常火,作为一枚对前言技术非常关注的程序员来说,自然都想对接DeepSeek的API来体验一把,下面小编就来为大家介绍一下... 目录前言免费体验API-Key申请首次调用API基本概念最小单元推理模型智能体自定义界面总结前言最

JAVA调用Deepseek的api完成基本对话简单代码示例

《JAVA调用Deepseek的api完成基本对话简单代码示例》:本文主要介绍JAVA调用Deepseek的api完成基本对话的相关资料,文中详细讲解了如何获取DeepSeekAPI密钥、添加H... 获取API密钥首先,从DeepSeek平台获取API密钥,用于身份验证。添加HTTP客户端依赖使用Jav

C#使用DeepSeek API实现自然语言处理,文本分类和情感分析

《C#使用DeepSeekAPI实现自然语言处理,文本分类和情感分析》在C#中使用DeepSeekAPI可以实现多种功能,例如自然语言处理、文本分类、情感分析等,本文主要为大家介绍了具体实现步骤,... 目录准备工作文本生成文本分类问答系统代码生成翻译功能文本摘要文本校对图像描述生成总结在C#中使用Deep

Java实现Elasticsearch查询当前索引全部数据的完整代码

《Java实现Elasticsearch查询当前索引全部数据的完整代码》:本文主要介绍如何在Java中实现查询Elasticsearch索引中指定条件下的全部数据,通过设置滚动查询参数(scrol... 目录需求背景通常情况Java 实现查询 Elasticsearch 全部数据写在最后需求背景通常情况下

5分钟获取deepseek api并搭建简易问答应用

《5分钟获取deepseekapi并搭建简易问答应用》本文主要介绍了5分钟获取deepseekapi并搭建简易问答应用,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需... 目录1、获取api2、获取base_url和chat_model3、配置模型参数方法一:终端中临时将加

使用DeepSeek API 结合VSCode提升开发效率

《使用DeepSeekAPI结合VSCode提升开发效率》:本文主要介绍DeepSeekAPI与VisualStudioCode(VSCode)结合使用,以提升软件开发效率,具有一定的参考价值... 目录引言准备工作安装必要的 VSCode 扩展配置 DeepSeek API1. 创建 API 请求文件2.