summaryrefslogtreecommitdiff
path: root/core/src/test/java/org/elasticsearch/common
diff options
context:
space:
mode:
authorColin Goodheart-Smithe <colings86@users.noreply.github.com>2017-06-02 08:46:38 +0100
committerGitHub <noreply@github.com>2017-06-02 08:46:38 +0100
commit779fb9a1c03af185c276599a14a85eaa3b1fb17b (patch)
tree55ac6c98ef1bb41fd2b212da7c987373867f2120 /core/src/test/java/org/elasticsearch/common
parent528bd25fa704da1d234ed364503891c93c6b9d31 (diff)
Adds nodes usage API to monitor usages of actions (#24169)
* Adds nodes usage API to monitor usages of actions The nodes usage API has 2 main endpoints /_nodes/usage and /_nodes/{nodeIds}/usage return the usage statistics for all nodes and the specified node(s) respectively. At the moment only one type of usage statistics is available, the REST actions usage. This records the number of times each REST action class is called and when the nodes usage api is called will return a map of rest action class name to long representing the number of times each of the action classes has been called. Still to do: * [x] Create usage service to store usage statistics * [x] Record usage in REST layer * [x] Add Transport Actions * [x] Add REST Actions * [x] Tests * [x] Documentation * Rafactors UsageService so counts are done by the handlers * Fixing up docs tests * Adds a name to all rest actions * Addresses review comments
Diffstat (limited to 'core/src/test/java/org/elasticsearch/common')
-rw-r--r--core/src/test/java/org/elasticsearch/common/network/NetworkModuleTests.java8
1 files changed, 8 insertions, 0 deletions
diff --git a/core/src/test/java/org/elasticsearch/common/network/NetworkModuleTests.java b/core/src/test/java/org/elasticsearch/common/network/NetworkModuleTests.java
index e393fee4f2..81e685e685 100644
--- a/core/src/test/java/org/elasticsearch/common/network/NetworkModuleTests.java
+++ b/core/src/test/java/org/elasticsearch/common/network/NetworkModuleTests.java
@@ -101,6 +101,10 @@ public class NetworkModuleTests extends ModuleTestCase {
}
@Override
public RestChannelConsumer prepareRequest(RestRequest request, NodeClient client) throws IOException { return channel -> {}; }
+ @Override
+ public String getName() {
+ return "FakeRestHandler";
+ }
}
static class FakeCatRestHandler extends AbstractCatAction {
@@ -115,6 +119,10 @@ public class NetworkModuleTests extends ModuleTestCase {
protected Table getTableWithHeader(RestRequest request) {
return null;
}
+ @Override
+ public String getName() {
+ return "FakeCatRestHandler";
+ }
}
public void testRegisterTransport() {