nodes-usage.asciidoc 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. [[cluster-nodes-usage]]
  2. === Nodes Feature Usage
  3. [float]
  4. ==== Nodes usage
  5. The cluster nodes usage API allows to retrieve information on the usage
  6. of features for each node.
  7. [source,js]
  8. --------------------------------------------------
  9. GET _nodes/usage
  10. GET _nodes/nodeId1,nodeId2/usage
  11. --------------------------------------------------
  12. // CONSOLE
  13. // TEST[setup:node]
  14. // TEST[s/nodeId1,nodeId2/*/]
  15. The first command retrieves usage of all the nodes in the cluster. The
  16. second command selectively retrieves nodes usage of only `nodeId1` and
  17. `nodeId2`. All the nodes selective options are explained
  18. <<cluster-nodes,here>>.
  19. [float]
  20. [[rest-usage]]
  21. ===== REST actions usage information
  22. The `rest_actions` field in the response contains a map of the REST
  23. actions classname with a count of the number of times that action has
  24. been called on the node:
  25. [source,js]
  26. --------------------------------------------------
  27. {
  28. "_nodes": {
  29. "total": 1,
  30. "successful": 1,
  31. "failed": 0
  32. },
  33. "cluster_name": "my_cluster",
  34. "nodes": {
  35. "pQHNt5rXTTWNvUgOrdynKg": {
  36. "timestamp": 1492553961812, <1>
  37. "since": 1492553906606, <2>
  38. "rest_actions": {
  39. "org.elasticsearch.rest.action.admin.cluster.RestNodesUsageAction": 1,
  40. "org.elasticsearch.rest.action.admin.indices.RestCreateIndexAction": 1,
  41. "org.elasticsearch.rest.action.document.RestGetAction": 1,
  42. "org.elasticsearch.rest.action.search.RestSearchAction": 19, <3>
  43. "org.elasticsearch.rest.action.admin.cluster.RestNodesInfoAction": 36
  44. }
  45. }
  46. }
  47. }
  48. --------------------------------------------------
  49. // TESTRESPONSE[s/"my_cluster"/$body.cluster_name/]
  50. // TESTRESPONSE[s/"pQHNt5rXTTWNvUgOrdynKg"/\$node_name/]
  51. // TESTRESPONSE[s/1492553961812/$body.$_path/]
  52. // TESTRESPONSE[s/1492553906606/$body.$_path/]
  53. // TESTRESPONSE[s/"rest_actions": [^}]+}/"rest_actions": $body.$_path/]
  54. <1> Timestamp for when this nodes usage request was performed.
  55. <2> Timestamp for when the usage information recording was started. This is
  56. equivalent to the time that the node was started.
  57. <3> Search action has been called 19 times for this node.