当前位置:   article > 正文

Elasticsearch——索引统计(_stats)详解_elasticsearch stats

elasticsearch stats

作者简介:大家好,我是smart哥,前中兴通讯、美团架构师,现某互联网公司CTO

联系qq:184480602,加我进群,大家一起学习,一起进步,一起对抗互联网寒冬

学习必须往深处挖,挖的越深,基础越扎实!

阶段1、深入多线程

阶段2、深入多线程设计模式

阶段3、深入juc源码解析


阶段4、深入jdk其余源码解析


阶段5、深入jvm源码解析

码哥源码部分

码哥讲源码-原理源码篇【2024年最新大厂关于线程池使用的场景题】

码哥讲源码【炸雷啦!炸雷啦!黄光头他终于跑路啦!】

码哥讲源码-【jvm课程前置知识及c/c++调试环境搭建】

​​​​​​码哥讲源码-原理源码篇【揭秘join方法的唤醒本质上决定于jvm的底层析构函数】

码哥源码-原理源码篇【Doug Lea为什么要将成员变量赋值给局部变量后再操作?】

码哥讲源码【你水不是你的错,但是你胡说八道就是你不对了!】

码哥讲源码【谁再说Spring不支持多线程事务,你给我抽他!】

终结B站没人能讲清楚红黑树的历史,不服等你来踢馆!

打脸系列【020-3小时讲解MESI协议和volatile之间的关系,那些将x86下的验证结果当作最终结果的水货们请闭嘴】

索引统计

1、docs - 文档数量

可以不指定索引 、也可以指定具体索引、也可以指定模糊索引:

  1. //获取所有索引的docs数量
  2. GET /_stats/docs
  3. //获取指定索引的docs数量
  4. GET /bank/_stats/docs
  5. //获取同类索引的docs数量
  6. GET /log-*/_stats/docs

返回结果:

  1. {
  2. "_shards" : {
  3. "total" : 2,
  4. "successful" : 1,
  5. "failed" : 0
  6. },
  7. "_all" : {
  8. "primaries" : {
  9. "docs" : {
  10. "count" : 1000,
  11. "deleted" : 2
  12. }
  13. },
  14. "total" : {
  15. "docs" : {
  16. "count" : 1000,
  17. "deleted" : 2
  18. }
  19. }
  20. },
  21. "indices" : {
  22. "bank" : {
  23. "uuid" : "1Ny9g32eTSutDG8gfLzQZg",
  24. "primaries" : {
  25. "docs" : {
  26. "count" : 1000,
  27. "deleted" : 2
  28. }
  29. },
  30. "total" : {
  31. "docs" : {
  32. "count" : 1000,
  33. "deleted" : 2
  34. }
  35. }
  36. }
  37. }
  38. }
  • _shards :分片信息:总数、成功返回数、失败返回数

  • _all :统计的总信息

    • primaries:主分片上的统计信息
    • total : 所有分片(主分片+副本分片)上的统计信息
  • indices :索引维度统计信息详情

2、store - 索引存储大小

  1. //获取所有索引的store大小
  2. GET /_stats/store
  3. //获取所有索引的store大小
  4. GET /bank/_stats/store
  5. //获取同类索引的store大小
  6. GET /log-*/_stats/store

返回:单位字节

  1. {
  2. "_shards": {
  3. "total": 3565,
  4. "successful": 3565,
  5. "failed": 0
  6. },
  7. "_all": {
  8. "primaries": {
  9. "store": {
  10. "size_in_bytes": 34003971241
  11. }
  12. },
  13. "total": {
  14. "store": {
  15. "size_in_bytes": 67412754240
  16. }
  17. }
  18. },
  19. "indices": {
  20. "book-20210107": {
  21. "uuid": "m0txeABPUtmNQ3u-VgIRUg",
  22. "primaries": {
  23. "store": {
  24. "size_in_bytes": 5470681
  25. }
  26. },
  27. "total": {
  28. "store": {
  29. "size_in_bytes": 10941362
  30. }
  31. }
  32. },
  33. ...
  34. }
  35. }
  • _shards :分片信息:总数、成功返回数、失败返回数

  • _all :统计的总信息

    • primaries:主分片上的统计信息
    • total : 所有分片(主分片+副本分片)上的统计信息
  • indices :索引维度统计信息详情

3、indexing - 索引操作统计信息

索引操作信息(CRUD)统计

  1. //获取所有索引的indexing信息
  2. GET /_stats/indexing
  3. //获取所有索引的indexing信息
  4. GET /bank/_stats/indexing
  5. //获取同类索引的indexing信息
  6. GET /log-*/_stats/indexing

返回:

  1. {
  2. "_shards": {
  3. "total": 32,
  4. "successful": 32,
  5. "failed": 0
  6. },
  7. "_all": {
  8. "primaries": {
  9. "indexing": {
  10. // 索引操作总次数
  11. "index_total": 3093133,
  12. // 索引操作总耗时
  13. "index_time_in_millis": 349332,
  14. // 当前正在执行索引操作的个数
  15. "index_current": 0,
  16. // 失败的索引操作次数
  17. "index_failed": 0,
  18. // 执行删除索引操作的次数
  19. "delete_total": 0,
  20. // 删除索引操作总耗时
  21. "delete_time_in_millis": 0,
  22. // 当前正在执行删除索引操作的个数
  23. "delete_current": 0,
  24. // 空更新总次数(检测到空更新的次数)
  25. "noop_update_total": 0,
  26. // 索引是否处在merge throttling control(合并节流控制状态)
  27. "is_throttled": false,
  28. // 索引处在merge throttling control(合并节流状态)的时间开销
  29. "throttle_time_in_millis": 0
  30. }
  31. },
  32. "total": {
  33. "indexing": {
  34. "index_total": 6986261,
  35. "index_time_in_millis": 783341,
  36. "index_current": 0,
  37. "index_failed": 0,
  38. "delete_total": 0,
  39. "delete_time_in_millis": 0,
  40. "delete_current": 0,
  41. "noop_update_total": 0,
  42. "is_throttled": false,
  43. "throttle_time_in_millis": 0
  44. }
  45. }
  46. },
  47. "indices": {
  48. "log-20210109": {
  49. "uuid": "_5G171lSRsGez7_tKtQyDw",
  50. "primaries": {
  51. "indexing": {
  52. "index_total": 221821,
  53. "index_time_in_millis": 25891,
  54. "index_current": 0,
  55. "index_failed": 0,
  56. "delete_total": 0,
  57. "delete_time_in_millis": 0,
  58. "delete_current": 0,
  59. "noop_update_total": 0,
  60. "is_throttled": false,
  61. "throttle_time_in_millis": 0
  62. }
  63. },
  64. "total": {
  65. "indexing": {
  66. "index_total": 443642,
  67. "index_time_in_millis": 47894,
  68. "index_current": 0,
  69. "index_failed": 0,
  70. "delete_total": 0,
  71. "delete_time_in_millis": 0,
  72. "delete_current": 0,
  73. "noop_update_total": 0,
  74. "is_throttled": false,
  75. "throttle_time_in_millis": 0
  76. }
  77. }
  78. },
  79. ...
  80. }
  81. }

4、get - 索引get统计信息

get api 操作统计信息,报错missing统计。

  1. //获取所有索引的get信息
  2. GET /_stats/get
  3. //获取所有索引的get信息
  4. GET /bank/_stats/get
  5. //获取同类索引的get信息
  6. GET /log-*/_stats/get

返回:

  1. {
  2. "_shards": {
  3. "total": 2,
  4. "successful": 2,
  5. "failed": 0
  6. },
  7. "_all": {
  8. "primaries": {
  9. "get": {
  10. // get api总调用次数
  11. "total": 0,
  12. // get api总耗时。
  13. "time_in_millis": 0,
  14. // 命中的次数
  15. "exists_total": 0,
  16. // 命中的操作总耗时
  17. "exists_time_in_millis": 0,
  18. // 未命中的总次数
  19. "missing_total": 0,
  20. // 未命中的操作的总耗时
  21. "missing_time_in_millis": 0,
  22. // 当前正在执行的个数
  23. "current": 0
  24. }
  25. },
  26. "total": {
  27. "get": {
  28. "total": 0,
  29. "time_in_millis": 0,
  30. "exists_total": 0,
  31. "exists_time_in_millis": 0,
  32. "missing_total": 0,
  33. "missing_time_in_millis": 0,
  34. "current": 0
  35. }
  36. }
  37. },
  38. "indices": {
  39. "book-20210109": {
  40. "uuid": "_SRsG5Ge171lQz7_tKtyDw",
  41. "primaries": {
  42. "get": {
  43. "total": 0,
  44. "time_in_millis": 0,
  45. "exists_total": 0,
  46. "exists_time_in_millis": 0,
  47. "missing_total": 0,
  48. "missing_time_in_millis": 0,
  49. "current": 0
  50. }
  51. },
  52. "total": {
  53. "get": {
  54. "total": 0,
  55. "time_in_millis": 0,
  56. "exists_total": 0,
  57. "exists_time_in_millis": 0,
  58. "missing_total": 0,
  59. "missing_time_in_millis": 0,
  60. "current": 0
  61. }
  62. }
  63. },
  64. ...
  65. }
  66. }

5、search - 索引search统计信息

搜索统计信息,包括建议统计信息。

  1. //获取所有索引的search信息
  2. GET /_stats/search
  3. //获取所有索引的search信息
  4. GET /bank/_stats/search
  5. //获取同类索引的search信息
  6. GET /log-*/_stats/search

返回:

  1. {
  2. "_shards": {
  3. "total": 32,
  4. "successful": 32,
  5. "failed": 0
  6. },
  7. "_all": {
  8. "primaries": {
  9. "search": {
  10. // 正在打开的查询上下文个数
  11. "open_contexts": 0,
  12. // 查询出来的总数据条数
  13. "query_total": 5957,
  14. // 查询阶段所耗费的时间
  15. "query_time_in_millis": 26508,
  16. // 当前正在查询个数
  17. "query_current": 0,
  18. // Fetch操作的次数
  19. "fetch_total": 689,
  20. // Fetch阶段总耗时时间
  21. "fetch_time_in_millis": 659,
  22. // 正在fetch的次数
  23. "fetch_current": 0,
  24. // 通过scroll api查询数据总条数
  25. "scroll_total": 305,
  26. // 通过scroll api总耗时时间
  27. "scroll_time_in_millis": 28225774,
  28. // 当前滚动API调用次数
  29. "scroll_current": 0,
  30. // 通过suggest api获取的推荐总数量
  31. "suggest_total": 0,
  32. // suggest总耗费时间
  33. "suggest_time_in_millis": 0,
  34. // 正在执行suggest api的个数
  35. "suggest_current": 0
  36. }
  37. },
  38. "total": {
  39. "search": {
  40. "open_contexts": 0,
  41. "query_total": 12745,
  42. "query_time_in_millis": 48163,
  43. "query_current": 0,
  44. "fetch_total": 1573,
  45. "fetch_time_in_millis": 1796,
  46. "fetch_current": 0,
  47. "scroll_total": 744,
  48. "scroll_time_in_millis": 68167255,
  49. "scroll_current": 0,
  50. "suggest_total": 0,
  51. "suggest_time_in_millis": 0,
  52. "suggest_current": 0
  53. }
  54. }
  55. },
  56. "indices": {
  57. "book-20210109": {
  58. "uuid": "RsGez7_5G171lS_tKtQyDw",
  59. "primaries": {
  60. "search": {
  61. "open_contexts": 0,
  62. "query_total": 700,
  63. "query_time_in_millis": 2054,
  64. "query_current": 0,
  65. "fetch_total": 0,
  66. "fetch_time_in_millis": 0,
  67. "fetch_current": 0,
  68. "scroll_total": 1,
  69. "scroll_time_in_millis": 117920,
  70. "scroll_current": 0,
  71. "suggest_total": 0,
  72. "suggest_time_in_millis": 0,
  73. "suggest_current": 0
  74. }
  75. },
  76. "total": {
  77. "search": {
  78. "open_contexts": 0,
  79. "query_total": 1399,
  80. "query_time_in_millis": 4168,
  81. "query_current": 0,
  82. "fetch_total": 0,
  83. "fetch_time_in_millis": 0,
  84. "fetch_current": 0,
  85. "scroll_total": 1,
  86. "scroll_time_in_millis": 117920,
  87. "scroll_current": 0,
  88. "suggest_total": 0,
  89. "suggest_time_in_millis": 0,
  90. "suggest_current": 0
  91. }
  92. }
  93. },
  94. ...
  95. }
  96. }

6、search - segments - 段的内存使用情况

段的内存使用情况。

  1. //获取所有索引的segments信息
  2. GET /_stats/segments
  3. //获取所有索引的segments信息
  4. GET /bank/_stats/segments
  5. //获取同类索引的segments信息
  6. GET /log-*/_stats/segments

返回:

  1. {
  2. "_shards": {
  3. "total": 32,
  4. "successful": 32,
  5. "failed": 0
  6. },
  7. "_all": {
  8. "primaries": {
  9. "segments": {
  10. // 该索引目前拥有的总段数
  11. "count": 169,
  12. // 该索引缓存在内存中字节数
  13. "memory_in_bytes": 4404644,
  14. // 倒排索引(term)缓存在内中所占字节数
  15. "terms_memory_in_bytes": 3723502,
  16. // 该索引定义为stored_fields字段在内存中缓存的字节数
  17. "stored_fields_memory_in_bytes": 574016,
  18. // 该索引term_vectors(词向量)在内存中所占字节数量
  19. "term_vectors_memory_in_bytes": 0,
  20. // 该索引存储对应norms=true的字段当前在内存中缓存字节数
  21. "norms_memory_in_bytes": 10816,
  22. // 与地理位置相关的缓存数据
  23. "points_memory_in_bytes": 67946,
  24. // 设置为doc_values缓存在内存中的字节数(doc_values,列式存储)
  25. "doc_values_memory_in_bytes": 28364,
  26. // 用于优化索引写的缓存(减少写磁盘的频率
  27. "index_writer_memory_in_bytes": 768320,
  28. // 关于文档的版本映射所占内存大小
  29. "version_map_memory_in_bytes": 0,
  30. // fixed_bit_set内存,专门用来做nested查询的
  31. "fixed_bit_set_memory_in_bytes": 0,
  32. // es内部当前的自增ID
  33. "max_unsafe_auto_id_timestamp": -1,
  34. "file_sizes": {
  35. }
  36. }
  37. },
  38. "total": {
  39. "segments": {
  40. "count": 330,
  41. "memory_in_bytes": 8775500,
  42. "terms_memory_in_bytes": 7417480,
  43. "stored_fields_memory_in_bytes": 1147528,
  44. "term_vectors_memory_in_bytes": 0,
  45. "norms_memory_in_bytes": 21120,
  46. "points_memory_in_bytes": 136188,
  47. "doc_values_memory_in_bytes": 53184,
  48. "index_writer_memory_in_bytes": 768320,
  49. "version_map_memory_in_bytes": 0,
  50. "fixed_bit_set_memory_in_bytes": 0,
  51. "max_unsafe_auto_id_timestamp": -1,
  52. "file_sizes": {
  53. }
  54. }
  55. }
  56. },
  57. "indices": {
  58. "book-20210120": {
  59. "uuid": "k43l2I4T2hCVYxgmvFb2Dy",
  60. "primaries": {
  61. "segments": {
  62. "count": 8,
  63. "memory_in_bytes": 247039,
  64. "terms_memory_in_bytes": 209657,
  65. "stored_fields_memory_in_bytes": 32272,
  66. "term_vectors_memory_in_bytes": 0,
  67. "norms_memory_in_bytes": 512,
  68. "points_memory_in_bytes": 3998,
  69. "doc_values_memory_in_bytes": 600,
  70. "index_writer_memory_in_bytes": 0,
  71. "version_map_memory_in_bytes": 0,
  72. "fixed_bit_set_memory_in_bytes": 0,
  73. "max_unsafe_auto_id_timestamp": -1,
  74. "file_sizes": {
  75. }
  76. }
  77. },
  78. "total": {
  79. "segments": {
  80. "count": 17,
  81. "memory_in_bytes": 499726,
  82. "terms_memory_in_bytes": 422271,
  83. "stored_fields_memory_in_bytes": 65088,
  84. "term_vectors_memory_in_bytes": 0,
  85. "norms_memory_in_bytes": 1088,
  86. "points_memory_in_bytes": 8011,
  87. "doc_values_memory_in_bytes": 3268,
  88. "index_writer_memory_in_bytes": 0,
  89. "version_map_memory_in_bytes": 0,
  90. "fixed_bit_set_memory_in_bytes": 0,
  91. "max_unsafe_auto_id_timestamp": -1,
  92. "file_sizes": {
  93. }
  94. }
  95. }
  96. },
  97. ...
  98. }
  99. }

7、completion - 自动提示统计信息

自动提示统计信息。

  1. //获取所有索引的completion信息
  2. GET /_stats/completion
  3. //获取所有索引的completion信息
  4. GET /bank/_stats/completion
  5. //获取同类索引的completion信息
  6. GET /log-*/_stats/completion

返回:

  1. {
  2. "_shards": {
  3. "total": 32,
  4. "successful": 32,
  5. "failed": 0
  6. },
  7. "_all": {
  8. "primaries": {
  9. "completion": {
  10. // 自动提示占用字节数
  11. "size_in_bytes": 0
  12. }
  13. },
  14. "total": {
  15. "completion": {
  16. "size_in_bytes": 0
  17. }
  18. }
  19. },
  20. "indices": {
  21. "book-20210120": {
  22. "uuid": "vFb22k4Thm43l2IDyCVYxg",
  23. "primaries": {
  24. "completion": {
  25. "size_in_bytes": 0
  26. }
  27. },
  28. "total": {
  29. "completion": {
  30. "size_in_bytes": 0
  31. }
  32. }
  33. },
  34. ...
  35. }
  36. }

8、fielddata - 统计信息

fielddata统计信息,fielddata主要用加快text字段排序与聚合的性能,存储词根与文档的映射关系存储在在内存,在内存中进行排序与聚合。

  1. //获取所有索引的fielddata信息
  2. GET /_stats/fielddata
  3. //获取所有索引的fielddata信息
  4. GET /bank/_stats/fielddata
  5. //获取同类索引的fielddata信息
  6. GET /log-*/_stats/fielddata

返回:

  1. {
  2. "_shards": {
  3. "total": 32,
  4. "successful": 32,
  5. "failed": 0
  6. },
  7. "_all": {
  8. "primaries": {
  9. "fielddata": {
  10. // 当前占用内存的大小
  11. "memory_size_in_bytes": 5488,
  12. // 被逐出词根的个数
  13. "evictions": 0
  14. }
  15. },
  16. "total": {
  17. "fielddata": {
  18. "memory_size_in_bytes": 9688,
  19. "evictions": 0
  20. }
  21. }
  22. },
  23. "indices": {
  24. "book-20210130": {
  25. "uuid": "VYxI4Th2kC43l2mvFb2Dyg",
  26. "primaries": {
  27. "fielddata": {
  28. "memory_size_in_bytes": 928,
  29. "evictions": 0
  30. }
  31. },
  32. "total": {
  33. "fielddata": {
  34. "memory_size_in_bytes": 1376,
  35. "evictions": 0
  36. }
  37. }
  38. },
  39. ...
  40. }
  41. }

9、flush - 刷新到磁盘的统计信息

将es数据flush到磁盘的统计信息。

  1. //获取所有索引的flush信息
  2. GET /_stats/flush
  3. //获取所有索引的flush信息
  4. GET /bank/_stats/flush
  5. //获取同类索引的flush信息
  6. GET /log-*/_stats/flush

返回:

  1. {
  2. "_shards": {
  3. "total": 32,
  4. "successful": 32,
  5. "failed": 0
  6. },
  7. "_all": {
  8. "primaries": {
  9. "flush": {
  10. // 刷新数据到磁盘的次数
  11. "total": 16,
  12. // 当translog超过刷新阈值时周期性触发的刷新次数
  13. "periodic": 0,
  14. // 总耗时
  15. "total_time_in_millis": 1640
  16. }
  17. },
  18. "total": {
  19. "flush": {
  20. "total": 33,
  21. "periodic": 0,
  22. "total_time_in_millis": 2953
  23. }
  24. }
  25. },
  26. "indices": {
  27. "book-20210131": {
  28. "uuid": "mvFyCb22k4I4ThDVY3l2xg",
  29. "primaries": {
  30. "flush": {
  31. "total": 1,
  32. "periodic": 0,
  33. "total_time_in_millis": 443
  34. }
  35. },
  36. "total": {
  37. "flush": {
  38. "total": 2,
  39. "periodic": 0,
  40. "total_time_in_millis": 459
  41. }
  42. }
  43. },
  44. ...
  45. }
  46. }

10、merge - 合并统计信息

合并统计信息。

  1. //获取所有索引的merge信息
  2. GET /_stats/merge
  3. //获取所有索引的merge信息
  4. GET /bank/_stats/merge
  5. //获取同类索引的merge信息
  6. GET /log-*/_stats/merge

返回:

  1. {
  2. "_shards": {
  3. "total": 32,
  4. "successful": 32,
  5. "failed": 0
  6. },
  7. "_all": {
  8. "primaries": {
  9. "merges": {
  10. // 当前发生的合并次数
  11. "current": 0,
  12. // 当前正在发生合并的文档数
  13. "current_docs": 0,
  14. // 当前合并参与的文档总大小,单位字节
  15. "current_size_in_bytes": 0,
  16. // 总发生的合并次数
  17. "total": 18074,
  18. // 合并的总耗时(单位毫秒)
  19. "total_time_in_millis": 2267867,
  20. // merge(合并)时总处理的文档个数
  21. "total_docs": 125994477,
  22. // merge(合并)时总处理的文档总大小(字节)
  23. "total_size_in_bytes": 53807733094,
  24. // merge(合并)时总停止时间(吞吐率为0
  25. "total_stopped_time_in_millis": 0,
  26. // 超过指定吞吐率而暂停的时间(节流)
  27. "total_throttled_time_in_millis": 28682,
  28. // 自动进行流控的阔值,默认速率20m/s
  29. "total_auto_throttle_in_bytes": 309026610
  30. }
  31. },
  32. "total": {
  33. "merges": {
  34. "current": 0,
  35. "current_docs": 0,
  36. "current_size_in_bytes": 0,
  37. "total": 37362,
  38. "total_time_in_millis": 4776771,
  39. "total_docs": 258338766,
  40. "total_size_in_bytes": 110130214943,
  41. "total_stopped_time_in_millis": 0,
  42. "total_throttled_time_in_millis": 57781,
  43. "total_auto_throttle_in_bytes": 618053220
  44. }
  45. }
  46. },
  47. "indices": {
  48. "book-20210201": {
  49. "uuid": "hT2DymvFl2I4CVb2k43Yxg",
  50. "primaries": {
  51. "merges": {
  52. "current": 0,
  53. "current_docs": 0,
  54. "current_size_in_bytes": 0,
  55. "total": 1224,
  56. "total_time_in_millis": 147690,
  57. "total_docs": 8924693,
  58. "total_size_in_bytes": 3754681042,
  59. "total_stopped_time_in_millis": 0,
  60. "total_throttled_time_in_millis": 2058,
  61. "total_auto_throttle_in_bytes": 19065018
  62. }
  63. },
  64. "total": {
  65. "merges": {
  66. "current": 0,
  67. "current_docs": 0,
  68. "current_size_in_bytes": 0,
  69. "total": 2446,
  70. "total_time_in_millis": 320220,
  71. "total_docs": 17270022,
  72. "total_size_in_bytes": 7223483338,
  73. "total_stopped_time_in_millis": 0,
  74. "total_throttled_time_in_millis": 4098,
  75. "total_auto_throttle_in_bytes": 38130036
  76. }
  77. }
  78. },
  79. ...
  80. }
  81. }

11、refresh - 统计信息

refresh统计信息。

  1. //获取所有索引的refresh信息
  2. GET /_stats/refresh
  3. //获取所有索引的refresh信息
  4. GET /bank/_stats/refresh
  5. //获取同类索引的refresh信息
  6. GET /log-*/_stats/refresh

返回:

  1. {
  2. "_shards": {
  3. "total": 32,
  4. "successful": 32,
  5. "failed": 0
  6. },
  7. "_all": {
  8. "primaries": {
  9. "refresh": {
  10. // 执行刷新的总次数
  11. "total": 168484,
  12. // 总耗时
  13. "total_time_in_millis": 1514449,
  14. // 等待刷新侦听器的数量
  15. "listeners": 0
  16. }
  17. },
  18. "total": {
  19. "refresh": {
  20. "total": 348465,
  21. "total_time_in_millis": 3154142,
  22. "listeners": 0
  23. }
  24. }
  25. },
  26. "indices": {
  27. "book-20210202": {
  28. "uuid": "4Thhg!2_2k4msdfgd3l2IvFb2DyCVYxg",
  29. "primaries": {
  30. "refresh": {
  31. "total": 11448,
  32. "total_time_in_millis": 92157,
  33. "listeners": 0
  34. }
  35. },
  36. "total": {
  37. "refresh": {
  38. "total": 22887,
  39. "total_time_in_millis": 213867,
  40. "listeners": 0
  41. }
  42. }
  43. },
  44. ...
  45. }
  46. }

12、request_cache - 统计信息

request_cache统计信息。

  1. //获取所有索引的request_cache信息
  2. GET /_stats/request_cache
  3. //获取所有索引的request_cache信息
  4. GET /bank/_stats/request_cache
  5. //获取同类索引的request_cache信息
  6. GET /log-*/_stats/request_cache

返回:

  1. {
  2. "_shards": {
  3. "total": 32,
  4. "successful": 32,
  5. "failed": 0
  6. },
  7. "_all": {
  8. "primaries": {
  9. "request_cache": {
  10. // 请求缓存占用内存总大小
  11. "memory_size_in_bytes": 1062768,
  12. // 请求缓存被剔除出次数
  13. "evictions": 0,
  14. // 请求缓存被命中次数
  15. "hit_count": 4996,
  16. // 请求缓存未命中次数
  17. "miss_count": 2237
  18. }
  19. },
  20. "total": {
  21. "request_cache": {
  22. "memory_size_in_bytes": 2130030,
  23. "evictions": 0,
  24. "hit_count": 10128,
  25. "miss_count": 4579
  26. }
  27. }
  28. },
  29. "indices": {
  30. "book-20210204": {
  31. "uuid": "b2Dy2k44Thl2IxgmvFCVY3",
  32. "primaries": {
  33. "request_cache": {
  34. "memory_size_in_bytes": 74731,
  35. "evictions": 0,
  36. "hit_count": 379,
  37. "miss_count": 130
  38. }
  39. },
  40. "total": {
  41. "request_cache": {
  42. "memory_size_in_bytes": 149462,
  43. "evictions": 0,
  44. "hit_count": 756,
  45. "miss_count": 260
  46. }
  47. }
  48. },
  49. ...
  50. }
  51. }

13、warmer - 分片预热统计信息

分片预热统计信息。

  1. //获取所有索引的warmer信息
  2. GET /_stats/warmer
  3. //获取所有索引的warmer信息
  4. GET /bank/_stats/warmer
  5. //获取同类索引的warmer信息
  6. GET /log-*/_stats/warmer

返回:

  1. {
  2. "_shards": {
  3. "total": 32,
  4. "successful": 32,
  5. "failed": 0
  6. },
  7. "_all": {
  8. "primaries": {
  9. "warmer": {
  10. // 当前正在预热的个数
  11. "current": 0,
  12. // 总共发生的预热次数
  13. "total": 168464,
  14. // 分片预热总耗时
  15. "total_time_in_millis": 2544
  16. }
  17. },
  18. "total": {
  19. "warmer": {
  20. "current": 0,
  21. "total": 348428,
  22. "total_time_in_millis": 5139
  23. }
  24. }
  25. },
  26. "indices": {
  27. "book-20210204": {
  28. "uuid": "2l2I_2Dy38fjd94_Yxg",
  29. "primaries": {
  30. "warmer": {
  31. "current": 0,
  32. "total": 11445,
  33. "total_time_in_millis": 161
  34. }
  35. },
  36. "total": {
  37. "warmer": {
  38. "current": 0,
  39. "total": 22881,
  40. "total_time_in_millis": 364
  41. }
  42. }
  43. },
  44. ...
  45. }
  46. }

14、translog - 统计信息

translog的统计信息。

  1. //获取所有索引的translog信息
  2. GET /_stats/translog
  3. //获取所有索引的translog信息
  4. GET /bank/_stats/translog
  5. //获取同类索引的translog信息
  6. GET /log-*/_stats/translog

返回:

  1. {
  2. "_shards": {
  3. "total": 32,
  4. "successful": 32,
  5. "failed": 0
  6. },
  7. "_all": {
  8. "primaries": {
  9. "translog": {
  10. // 写translog的次数(索引文档、更新文档、删除文档的总操作数量)
  11. "operations": 240497,
  12. // translog实例管理的translog文件总大小。(一个索引引擎(InternalEngine)示例包含一个Translog实例)
  13. "size_in_bytes": 215617938,
  14. // 当前还未提交到lucene中的操作次数(索引文档、更新文档、删除文档的操作数量)
  15. "uncommitted_operations": 240497,
  16. // translog中未提交到Lucene中的字节数
  17. "uncommitted_size_in_bytes": 215617938,
  18. // 以秒为单位返回translog文件中最老条目的年龄
  19. "earliest_last_modified_age": 0
  20. }
  21. },
  22. "total": {
  23. "translog": {
  24. "operations": 480994,
  25. "size_in_bytes": 431235821,
  26. "uncommitted_operations": 480994,
  27. "uncommitted_size_in_bytes": 431235821,
  28. "earliest_last_modified_age": 0
  29. }
  30. }
  31. },
  32. "indices": {
  33. "book-20210206": {
  34. "uuid": "s728d00f_s8",
  35. "primaries": {
  36. "translog": {
  37. "operations": 0,
  38. "size_in_bytes": 55,
  39. "uncommitted_operations": 0,
  40. "uncommitted_size_in_bytes": 55,
  41. "earliest_last_modified_age": 0
  42. }
  43. },
  44. "total": {
  45. "translog": {
  46. "operations": 0,
  47. "size_in_bytes": 110,
  48. "uncommitted_operations": 0,
  49. "uncommitted_size_in_bytes": 110,
  50. "earliest_last_modified_age": 0
  51. }
  52. }
  53. },
  54. ...
  55. }
  56. }

15、recovery - 恢复的统计信息

恢复的统计信息。

  1. //获取所有索引的recovery信息
  2. GET /_stats/recovery
  3. //获取所有索引的recovery信息
  4. GET /bank/_stats/recovery
  5. //获取同类索引的recovery信息
  6. GET /log-*/_stats/recovery

返回:

  1. {
  2. "_shards": {
  3. "total": 34,
  4. "successful": 34,
  5. "failed": 0
  6. },
  7. "_all": {
  8. "primaries": {
  9. "recovery": {
  10. // 作为源分片,正在执行恢复的分片数量
  11. "current_as_source": 0,
  12. // 作为目标分片,正在执行恢复的分片数量
  13. "current_as_target": 0,
  14. // 恢复过程总等待时间
  15. "throttle_time_in_millis": 36
  16. }
  17. },
  18. "total": {
  19. "recovery": {
  20. "current_as_source": 0,
  21. "current_as_target": 0,
  22. "throttle_time_in_millis": 36
  23. }
  24. }
  25. },
  26. "indices": {
  27. "book-20210206": {
  28. "uuid": "06hsdygt9ZXT1T245L_4uiw",
  29. "primaries": {
  30. "recovery": {
  31. "current_as_source": 0,
  32. "current_as_target": 0,
  33. "throttle_time_in_millis": 0
  34. }
  35. },
  36. "total": {
  37. "recovery": {
  38. "current_as_source": 0,
  39. "current_as_target": 0,
  40. "throttle_time_in_millis": 0
  41. }
  42. }
  43. },
  44. ...
  45. }
  46. }
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/秋刀鱼在做梦/article/detail/994828
推荐阅读
相关标签
  

闽ICP备14008679号