get-desired-balance.asciidoc 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173
  1. [[get-desired-balance]]
  2. === Get desired balance API
  3. ++++
  4. <titleabbrev>Get desired balance</titleabbrev>
  5. ++++
  6. NOTE: {cloud-only}
  7. Exposes the desired balance and basic metrics.
  8. [[get-desired-balance-request]]
  9. ==== {api-request-title}
  10. [source,console]
  11. --------------------------------------------------
  12. GET /_internal/desired_balance
  13. --------------------------------------------------
  14. // TEST[skip:Can't reliably test desired balance]
  15. The API returns the following result:
  16. [source,console-result]
  17. --------------------------------------------------
  18. {
  19. "stats": {
  20. "computation_active": false,
  21. "computation_submitted": 5,
  22. "computation_executed": 5,
  23. "computation_converged": 5,
  24. "computation_iterations": 4,
  25. "computation_converged_index": 4,
  26. "computation_time_in_millis": 0,
  27. "reconciliation_time_in_millis": 0
  28. },
  29. "cluster_balance_stats" : {
  30. "tiers": {
  31. "data_hot" : {
  32. "shard_count" : {
  33. "total" : 7.0,
  34. "min" : 2.0,
  35. "max" : 3.0,
  36. "average" : 2.3333333333333335,
  37. "std_dev" : 0.4714045207910317
  38. },
  39. "forecast_write_load" : {
  40. "total" : 21.0,
  41. "min" : 6.0,
  42. "max" : 8.5,
  43. "average" : 7.0,
  44. "std_dev" : 1.0801234497346435
  45. },
  46. "forecast_disk_usage" : {
  47. "total" : 36.0,
  48. "min" : 10.0,
  49. "max" : 16.0,
  50. "average" : 12.0,
  51. "std_dev" : 2.8284271247461903
  52. },
  53. "actual_disk_usage" : {
  54. "total" : 36.0,
  55. "min" : 10.0,
  56. "max" : 16.0,
  57. "average" : 12.0,
  58. "std_dev" : 2.8284271247461903
  59. }
  60. },
  61. "data_warm" : {
  62. "shard_count" : {
  63. "total" : 3.0,
  64. "min" : 1.0,
  65. "max" : 1.0,
  66. "average" : 1.0,
  67. "std_dev" : 0.0
  68. },
  69. "forecast_write_load" : {
  70. "total" : 0.0,
  71. "min" : 0.0,
  72. "max" : 0.0,
  73. "average" : 0.0,
  74. "std_dev" : 0.0
  75. },
  76. "forecast_disk_usage" : {
  77. "total" : 42.0,
  78. "min" : 12.0,
  79. "max" : 18.0,
  80. "average" : 14.0,
  81. "std_dev" : 2.8284271247461903
  82. },
  83. "actual_disk_usage" : {
  84. "total" : 42.0,
  85. "min" : 12.0,
  86. "max" : 18.0,
  87. "average" : 14.0,
  88. "std_dev" : 2.8284271247461903
  89. }
  90. }
  91. },
  92. "nodes": {
  93. "node-1": {
  94. "shard_count": 10,
  95. "forecast_write_load": 8.5,
  96. "forecast_disk_usage_bytes": 498435,
  97. "actual_disk_usage_bytes": 498435
  98. },
  99. "node-2": {
  100. "shard_count": 15,
  101. "forecast_write_load": 3.25,
  102. "forecast_disk_usage_bytes": 384935,
  103. "actual_disk_usage_bytes": 384935
  104. },
  105. "node-3": {
  106. "shard_count": 12,
  107. "forecast_write_load": 6.0,
  108. "forecast_disk_usage_bytes": 648766,
  109. "actual_disk_usage_bytes": 648766
  110. }
  111. }
  112. },
  113. "routing_table": {
  114. "test": {
  115. "0": {
  116. "current": [
  117. {
  118. "state": "STARTED",
  119. "primary": true,
  120. "node": "UPYt8VwWTt-IADAEbqpLxA",
  121. "node_is_desired": true,
  122. "relocating_node": null,
  123. "relocating_node_is_desired": false,
  124. "shard_id": 0,
  125. "index": "test",
  126. "forecast_write_load": 8.0,
  127. "forecast_shard_size_in_bytes": 1024
  128. }
  129. ],
  130. "desired": {
  131. "node_ids": [
  132. "UPYt8VwWTt-IADAEbqpLxA"
  133. ],
  134. "total": 1,
  135. "unassigned": 0,
  136. "ignored": 0
  137. }
  138. },
  139. "1": {
  140. "current": [
  141. {
  142. "state": "STARTED",
  143. "primary": true,
  144. "node": "2x1VTuSOQdeguXPdN73yRw",
  145. "node_is_desired": true,
  146. "relocating_node": null,
  147. "relocating_node_is_desired": false,
  148. "shard_id": 1,
  149. "index": "test",
  150. "forecast_write_load": null,
  151. "forecast_shard_size_in_bytes": null
  152. }
  153. ],
  154. "desired": {
  155. "node_ids": [
  156. "2x1VTuSOQdeguXPdN73yRw"
  157. ],
  158. "total": 1,
  159. "unassigned": 0,
  160. "ignored": 0
  161. }
  162. }
  163. }
  164. }
  165. }
  166. --------------------------------------------------
  167. // TEST[skip:Can't reliably test desired balance]