From b378ff780bd4e518c6df51af240731b6ac914e1c Mon Sep 17 00:00:00 2001 From: Jason Tedor Date: Mon, 27 Jun 2016 12:36:18 -0400 Subject: [PATCH 1/4] Modify poll interval setting in native realm test This commit modifies the construction of the poll interval setting in the native realm tests in response to upstream change elastic/elasticsearchelastic/elasticsearch#2f638b5a23597967a98b1ced1deac91d64af5a44. Original commit: elastic/x-pack-elasticsearch@c6f60f51f46faba2eb6442f8d58cd9643c51fa59 --- .../org/elasticsearch/integration/ClearRolesCacheTests.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/elasticsearch/x-pack/security/src/test/java/org/elasticsearch/integration/ClearRolesCacheTests.java b/elasticsearch/x-pack/security/src/test/java/org/elasticsearch/integration/ClearRolesCacheTests.java index d11065952ae..a9eca134b68 100644 --- a/elasticsearch/x-pack/security/src/test/java/org/elasticsearch/integration/ClearRolesCacheTests.java +++ b/elasticsearch/x-pack/security/src/test/java/org/elasticsearch/integration/ClearRolesCacheTests.java @@ -83,7 +83,7 @@ public class ClearRolesCacheTests extends NativeRealmIntegTestCase { logger.debug("using poller interval [{}]", pollerInterval); return Settings.builder() .put(super.nodeSettings(nodeOrdinal)) - .put(NativeRolesStore.POLL_INTERVAL_SETTING.getKey(), pollerInterval) + .put(NativeRolesStore.POLL_INTERVAL_SETTING.getKey(), pollerInterval.getStringRep()) .put(NetworkModule.HTTP_ENABLED.getKey(), true) .build(); } From 6f6426b444263c8c596ead066717334701dee9f9 Mon Sep 17 00:00:00 2001 From: Nik Everett Date: Mon, 27 Jun 2016 18:43:30 -0400 Subject: [PATCH 2/4] Switch plugin action registration to pull Original commit: elastic/x-pack-elasticsearch@2154918b6e3872bd66333f6306e89bb739245b3b --- .../org/elasticsearch/xpack/graph/Graph.java | 17 +++++-- .../license/plugin/Licensing.java | 22 +++++---- .../org/elasticsearch/marvel/Monitoring.java | 16 ++++-- .../collector/AbstractCollectorTestCase.java | 7 ++- .../license/LicenseIntegrationTests.java | 8 ++- .../xpack/security/Security.java | 49 ++++++++++++------- .../integration/LicensingTests.java | 11 +++-- .../org/elasticsearch/xpack/XPackPlugin.java | 47 ++++++++++++------ .../elasticsearch/xpack/watcher/Watcher.java | 30 +++++++----- 9 files changed, 135 insertions(+), 72 deletions(-) diff --git a/elasticsearch/x-pack/graph/src/main/java/org/elasticsearch/xpack/graph/Graph.java b/elasticsearch/x-pack/graph/src/main/java/org/elasticsearch/xpack/graph/Graph.java index 60227c5b272..c4def4e65b8 100644 --- a/elasticsearch/x-pack/graph/src/main/java/org/elasticsearch/xpack/graph/Graph.java +++ b/elasticsearch/x-pack/graph/src/main/java/org/elasticsearch/xpack/graph/Graph.java @@ -5,14 +5,16 @@ */ package org.elasticsearch.xpack.graph; -import org.elasticsearch.action.ActionModule; +import org.elasticsearch.action.ActionRequest; +import org.elasticsearch.action.ActionResponse; import org.elasticsearch.common.component.LifecycleComponent; import org.elasticsearch.common.inject.Module; import org.elasticsearch.common.network.NetworkModule; import org.elasticsearch.common.settings.Setting; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.settings.SettingsModule; +import org.elasticsearch.plugins.ActionPlugin; import org.elasticsearch.plugins.Plugin; +import org.elasticsearch.plugins.ActionPlugin.ActionHandler; import org.elasticsearch.xpack.XPackPlugin; import org.elasticsearch.xpack.graph.action.GraphExploreAction; import org.elasticsearch.xpack.graph.action.TransportGraphExploreAction; @@ -22,7 +24,10 @@ import java.util.Collection; import java.util.Collections; import java.util.List; -public class Graph extends Plugin { +import static java.util.Collections.emptyList; +import static java.util.Collections.singletonList; + +public class Graph extends Plugin implements ActionPlugin { public static final String NAME = "graph"; private final boolean transportClientMode; @@ -50,10 +55,12 @@ public class Graph extends Plugin { return Collections.singletonList(GraphLicensee.class); } - public void onModule(ActionModule actionModule) { + @Override + public List, ? extends ActionResponse>> getActions() { if (enabled) { - actionModule.registerAction(GraphExploreAction.INSTANCE, TransportGraphExploreAction.class); + return singletonList(new ActionHandler<>(GraphExploreAction.INSTANCE, TransportGraphExploreAction.class)); } + return emptyList(); } public void onModule(NetworkModule module) { diff --git a/elasticsearch/x-pack/license-plugin/src/main/java/org/elasticsearch/license/plugin/Licensing.java b/elasticsearch/x-pack/license-plugin/src/main/java/org/elasticsearch/license/plugin/Licensing.java index 0f52530f74f..3a8cb188966 100644 --- a/elasticsearch/x-pack/license-plugin/src/main/java/org/elasticsearch/license/plugin/Licensing.java +++ b/elasticsearch/x-pack/license-plugin/src/main/java/org/elasticsearch/license/plugin/Licensing.java @@ -5,7 +5,8 @@ */ package org.elasticsearch.license.plugin; -import org.elasticsearch.action.ActionModule; +import org.elasticsearch.action.ActionRequest; +import org.elasticsearch.action.ActionResponse; import org.elasticsearch.cluster.metadata.MetaData; import org.elasticsearch.common.component.LifecycleComponent; import org.elasticsearch.common.inject.Inject; @@ -13,7 +14,6 @@ import org.elasticsearch.common.inject.Module; import org.elasticsearch.common.network.NetworkModule; import org.elasticsearch.common.settings.Setting; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.settings.SettingsModule; import org.elasticsearch.license.plugin.action.delete.DeleteLicenseAction; import org.elasticsearch.license.plugin.action.delete.TransportDeleteLicenseAction; import org.elasticsearch.license.plugin.action.get.GetLicenseAction; @@ -25,17 +25,19 @@ import org.elasticsearch.license.plugin.core.LicensesService; import org.elasticsearch.license.plugin.rest.RestDeleteLicenseAction; import org.elasticsearch.license.plugin.rest.RestGetLicenseAction; import org.elasticsearch.license.plugin.rest.RestPutLicenseAction; +import org.elasticsearch.plugins.ActionPlugin; +import java.util.Arrays; import java.util.Collection; import java.util.Collections; import java.util.List; -import static org.elasticsearch.xpack.XPackPlugin.isTribeClientNode; +import static java.util.Collections.emptyList; import static org.elasticsearch.xpack.XPackPlugin.isTribeNode; import static org.elasticsearch.xpack.XPackPlugin.transportClientMode; -public class Licensing { +public class Licensing implements ActionPlugin { public static final String NAME = "license"; private final boolean isTransportClient; @@ -59,12 +61,14 @@ public class Licensing { } } - public void onModule(ActionModule module) { - if (isTribeNode == false) { - module.registerAction(PutLicenseAction.INSTANCE, TransportPutLicenseAction.class); - module.registerAction(GetLicenseAction.INSTANCE, TransportGetLicenseAction.class); - module.registerAction(DeleteLicenseAction.INSTANCE, TransportDeleteLicenseAction.class); + @Override + public List, ? extends ActionResponse>> getActions() { + if (isTribeNode) { + return emptyList(); } + return Arrays.asList(new ActionHandler<>(PutLicenseAction.INSTANCE, TransportPutLicenseAction.class), + new ActionHandler<>(GetLicenseAction.INSTANCE, TransportGetLicenseAction.class), + new ActionHandler<>(DeleteLicenseAction.INSTANCE, TransportDeleteLicenseAction.class)); } public Collection> nodeServices() { diff --git a/elasticsearch/x-pack/marvel/src/main/java/org/elasticsearch/marvel/Monitoring.java b/elasticsearch/x-pack/marvel/src/main/java/org/elasticsearch/marvel/Monitoring.java index 03dedea4aaa..cf8ccd6fdbe 100644 --- a/elasticsearch/x-pack/marvel/src/main/java/org/elasticsearch/marvel/Monitoring.java +++ b/elasticsearch/x-pack/marvel/src/main/java/org/elasticsearch/marvel/Monitoring.java @@ -5,12 +5,12 @@ */ package org.elasticsearch.marvel; -import org.elasticsearch.action.ActionModule; +import org.elasticsearch.action.ActionRequest; +import org.elasticsearch.action.ActionResponse; import org.elasticsearch.common.component.LifecycleComponent; import org.elasticsearch.common.inject.Module; import org.elasticsearch.common.network.NetworkModule; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.settings.SettingsModule; import org.elasticsearch.marvel.action.MonitoringBulkAction; import org.elasticsearch.marvel.action.TransportMonitoringBulkAction; import org.elasticsearch.marvel.agent.AgentService; @@ -19,6 +19,7 @@ import org.elasticsearch.marvel.agent.exporter.ExporterModule; import org.elasticsearch.marvel.cleaner.CleanerService; import org.elasticsearch.marvel.client.MonitoringClientModule; import org.elasticsearch.marvel.rest.action.RestMonitoringBulkAction; +import org.elasticsearch.plugins.ActionPlugin; import org.elasticsearch.xpack.XPackPlugin; import java.util.ArrayList; @@ -27,13 +28,16 @@ import java.util.Collection; import java.util.Collections; import java.util.List; +import static java.util.Collections.emptyList; +import static java.util.Collections.singletonList; + /** * This class activates/deactivates the monitoring modules depending if we're running a node client, transport client or tribe client: * - node clients: all modules are binded * - transport clients: only action/transport actions are binded * - tribe clients: everything is disables by default but can be enabled per tribe cluster */ -public class Monitoring { +public class Monitoring implements ActionPlugin { public static final String NAME = "monitoring"; @@ -77,10 +81,12 @@ public class Monitoring { CleanerService.class); } - public void onModule(ActionModule module) { + @Override + public List, ? extends ActionResponse>> getActions() { if (enabled && tribeNode == false) { - module.registerAction(MonitoringBulkAction.INSTANCE, TransportMonitoringBulkAction.class); + return singletonList(new ActionHandler<>(MonitoringBulkAction.INSTANCE, TransportMonitoringBulkAction.class)); } + return emptyList(); } public void onModule(NetworkModule module) { diff --git a/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/collector/AbstractCollectorTestCase.java b/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/collector/AbstractCollectorTestCase.java index 44ed5fe2457..e265f69fe5a 100644 --- a/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/collector/AbstractCollectorTestCase.java +++ b/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/collector/AbstractCollectorTestCase.java @@ -8,6 +8,8 @@ package org.elasticsearch.marvel.agent.collector; import com.carrotsearch.randomizedtesting.RandomizedTest; import com.carrotsearch.randomizedtesting.SysGlobals; import org.elasticsearch.action.ActionModule; +import org.elasticsearch.action.ActionRequest; +import org.elasticsearch.action.ActionResponse; import org.elasticsearch.cluster.block.ClusterBlocks; import org.elasticsearch.common.component.AbstractComponent; import org.elasticsearch.common.component.LifecycleComponent; @@ -26,6 +28,7 @@ import org.elasticsearch.license.plugin.core.LicensesManagerService; import org.elasticsearch.marvel.MonitoringSettings; import org.elasticsearch.marvel.test.MarvelIntegTestCase; import org.elasticsearch.plugins.Plugin; +import org.elasticsearch.plugins.ActionPlugin.ActionHandler; import org.elasticsearch.xpack.security.InternalClient; import org.elasticsearch.test.ESIntegTestCase; import org.elasticsearch.test.ESIntegTestCase.ClusterScope; @@ -39,6 +42,7 @@ import java.util.Collections; import java.util.List; import java.util.concurrent.TimeUnit; +import static java.util.Collections.emptyList; import static org.elasticsearch.common.unit.TimeValue.timeValueMinutes; @ClusterScope(scope = ESIntegTestCase.Scope.SUITE, randomDynamicTemplates = false, transportClientRatio = 0.0) @@ -204,7 +208,8 @@ public abstract class AbstractCollectorTestCase extends MarvelIntegTestCase { } @Override - public void onModule(ActionModule module) { + public List, ? extends ActionResponse>> getActions() { + return emptyList(); } @Override diff --git a/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/license/LicenseIntegrationTests.java b/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/license/LicenseIntegrationTests.java index c574e3f4912..fe7cec1ae51 100644 --- a/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/license/LicenseIntegrationTests.java +++ b/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/license/LicenseIntegrationTests.java @@ -5,7 +5,8 @@ */ package org.elasticsearch.marvel.license; -import org.elasticsearch.action.ActionModule; +import org.elasticsearch.action.ActionRequest; +import org.elasticsearch.action.ActionResponse; import org.elasticsearch.common.component.AbstractComponent; import org.elasticsearch.common.component.LifecycleComponent; import org.elasticsearch.common.inject.AbstractModule; @@ -22,6 +23,7 @@ import org.elasticsearch.license.plugin.core.LicensesManagerService; import org.elasticsearch.marvel.MonitoringLicensee; import org.elasticsearch.marvel.test.MarvelIntegTestCase; import org.elasticsearch.plugins.Plugin; +import org.elasticsearch.plugins.ActionPlugin.ActionHandler; import org.elasticsearch.test.ESIntegTestCase.ClusterScope; import org.elasticsearch.xpack.XPackPlugin; @@ -31,6 +33,7 @@ import java.util.Collection; import java.util.Collections; import java.util.List; +import static java.util.Collections.emptyList; import static org.elasticsearch.test.ESIntegTestCase.Scope.SUITE; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.is; @@ -97,7 +100,8 @@ public class LicenseIntegrationTests extends MarvelIntegTestCase { } @Override - public void onModule(ActionModule module) { + public List, ? extends ActionResponse>> getActions() { + return emptyList(); } @Override diff --git a/elasticsearch/x-pack/security/src/main/java/org/elasticsearch/xpack/security/Security.java b/elasticsearch/x-pack/security/src/main/java/org/elasticsearch/xpack/security/Security.java index f38a2976c9c..1c9e9a1d5a6 100644 --- a/elasticsearch/x-pack/security/src/main/java/org/elasticsearch/xpack/security/Security.java +++ b/elasticsearch/x-pack/security/src/main/java/org/elasticsearch/xpack/security/Security.java @@ -5,7 +5,9 @@ */ package org.elasticsearch.xpack.security; -import org.elasticsearch.action.ActionModule; +import org.elasticsearch.action.ActionRequest; +import org.elasticsearch.action.ActionResponse; +import org.elasticsearch.action.support.ActionFilter; import org.elasticsearch.common.Booleans; import org.elasticsearch.common.Strings; import org.elasticsearch.common.component.LifecycleComponent; @@ -20,6 +22,8 @@ import org.elasticsearch.common.settings.Setting.Property; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.util.concurrent.ThreadContext; import org.elasticsearch.index.IndexModule; +import org.elasticsearch.plugins.ActionPlugin; +import org.elasticsearch.xpack.XPackPlugin; import org.elasticsearch.xpack.security.action.SecurityActionModule; import org.elasticsearch.xpack.security.action.filter.SecurityActionFilter; import org.elasticsearch.xpack.security.action.realm.ClearRealmCacheAction; @@ -82,7 +86,6 @@ import org.elasticsearch.xpack.security.transport.filter.IPFilter; import org.elasticsearch.xpack.security.transport.netty.SecurityNettyHttpServerTransport; import org.elasticsearch.xpack.security.transport.netty.SecurityNettyTransport; import org.elasticsearch.xpack.security.user.AnonymousUser; -import org.elasticsearch.xpack.XPackPlugin; import org.joda.time.DateTime; import org.joda.time.DateTimeZone; @@ -95,10 +98,13 @@ import java.util.Map; import java.util.Optional; import java.util.function.Function; +import static java.util.Collections.emptyList; +import static java.util.Collections.singletonList; + /** * */ -public class Security { +public class Security implements ActionPlugin { private static final ESLogger logger = Loggers.getLogger(XPackPlugin.class); @@ -273,26 +279,33 @@ public class Security { } } - public void onModule(ActionModule module) { + @Override + public List, ? extends ActionResponse>> getActions() { if (enabled == false) { - return; + return emptyList(); + } + return Arrays.asList(new ActionHandler<>(ClearRealmCacheAction.INSTANCE, TransportClearRealmCacheAction.class), + new ActionHandler<>(ClearRolesCacheAction.INSTANCE, TransportClearRolesCacheAction.class), + new ActionHandler<>(GetUsersAction.INSTANCE, TransportGetUsersAction.class), + new ActionHandler<>(PutUserAction.INSTANCE, TransportPutUserAction.class), + new ActionHandler<>(DeleteUserAction.INSTANCE, TransportDeleteUserAction.class), + new ActionHandler<>(GetRolesAction.INSTANCE, TransportGetRolesAction.class), + new ActionHandler<>(PutRoleAction.INSTANCE, TransportPutRoleAction.class), + new ActionHandler<>(DeleteRoleAction.INSTANCE, TransportDeleteRoleAction.class), + new ActionHandler<>(ChangePasswordAction.INSTANCE, TransportChangePasswordAction.class), + new ActionHandler<>(AuthenticateAction.INSTANCE, TransportAuthenticateAction.class)); + } + + @Override + public List> getActionFilters() { + if (enabled == false) { + return emptyList(); } // registering the security filter only for nodes if (transportClientMode == false) { - module.registerFilter(SecurityActionFilter.class); + return singletonList(SecurityActionFilter.class); } - - // registering all security actions - module.registerAction(ClearRealmCacheAction.INSTANCE, TransportClearRealmCacheAction.class); - module.registerAction(ClearRolesCacheAction.INSTANCE, TransportClearRolesCacheAction.class); - module.registerAction(GetUsersAction.INSTANCE, TransportGetUsersAction.class); - module.registerAction(PutUserAction.INSTANCE, TransportPutUserAction.class); - module.registerAction(DeleteUserAction.INSTANCE, TransportDeleteUserAction.class); - module.registerAction(GetRolesAction.INSTANCE, TransportGetRolesAction.class); - module.registerAction(PutRoleAction.INSTANCE, TransportPutRoleAction.class); - module.registerAction(DeleteRoleAction.INSTANCE, TransportDeleteRoleAction.class); - module.registerAction(ChangePasswordAction.INSTANCE, TransportChangePasswordAction.class); - module.registerAction(AuthenticateAction.INSTANCE, TransportAuthenticateAction.class); + return emptyList(); } public void onModule(NetworkModule module) { diff --git a/elasticsearch/x-pack/security/src/test/java/org/elasticsearch/integration/LicensingTests.java b/elasticsearch/x-pack/security/src/test/java/org/elasticsearch/integration/LicensingTests.java index 4bb04f52720..8888468d44f 100644 --- a/elasticsearch/x-pack/security/src/test/java/org/elasticsearch/integration/LicensingTests.java +++ b/elasticsearch/x-pack/security/src/test/java/org/elasticsearch/integration/LicensingTests.java @@ -6,7 +6,8 @@ package org.elasticsearch.integration; import org.elasticsearch.ElasticsearchSecurityException; -import org.elasticsearch.action.ActionModule; +import org.elasticsearch.action.ActionRequest; +import org.elasticsearch.action.ActionResponse; import org.elasticsearch.action.admin.cluster.health.ClusterHealthResponse; import org.elasticsearch.action.admin.cluster.node.stats.NodesStatsResponse; import org.elasticsearch.action.admin.cluster.stats.ClusterStatsIndices; @@ -32,12 +33,12 @@ import org.elasticsearch.license.plugin.core.LicenseState; import org.elasticsearch.license.plugin.core.Licensee; import org.elasticsearch.license.plugin.core.LicenseeRegistry; import org.elasticsearch.rest.RestStatus; -import org.elasticsearch.xpack.security.Security; -import org.elasticsearch.xpack.security.authc.support.UsernamePasswordToken; import org.elasticsearch.test.SecurityIntegTestCase; import org.elasticsearch.test.SecuritySettingsSource; import org.elasticsearch.transport.Transport; import org.elasticsearch.xpack.XPackPlugin; +import org.elasticsearch.xpack.security.Security; +import org.elasticsearch.xpack.security.authc.support.UsernamePasswordToken; import org.junit.After; import java.util.ArrayList; @@ -45,6 +46,7 @@ import java.util.Collection; import java.util.Collections; import java.util.List; +import static java.util.Collections.emptyList; import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertNoFailures; import static org.hamcrest.Matchers.greaterThanOrEqualTo; @@ -274,7 +276,8 @@ public class LicensingTests extends SecurityIntegTestCase { } @Override - public void onModule(ActionModule module) { + public List, ? extends ActionResponse>> getActions() { + return emptyList(); } @Override diff --git a/elasticsearch/x-pack/src/main/java/org/elasticsearch/xpack/XPackPlugin.java b/elasticsearch/x-pack/src/main/java/org/elasticsearch/xpack/XPackPlugin.java index e16a01d9c39..974261b15e5 100644 --- a/elasticsearch/x-pack/src/main/java/org/elasticsearch/xpack/XPackPlugin.java +++ b/elasticsearch/x-pack/src/main/java/org/elasticsearch/xpack/XPackPlugin.java @@ -6,7 +6,9 @@ package org.elasticsearch.xpack; import org.elasticsearch.SpecialPermission; -import org.elasticsearch.action.ActionModule; +import org.elasticsearch.action.ActionRequest; +import org.elasticsearch.action.ActionResponse; +import org.elasticsearch.action.support.ActionFilter; import org.elasticsearch.client.Client; import org.elasticsearch.client.transport.TransportClient; import org.elasticsearch.common.component.LifecycleComponent; @@ -21,11 +23,10 @@ import org.elasticsearch.index.IndexModule; import org.elasticsearch.license.plugin.Licensing; import org.elasticsearch.marvel.Monitoring; import org.elasticsearch.marvel.MonitoringSettings; +import org.elasticsearch.plugins.ActionPlugin; import org.elasticsearch.plugins.Plugin; import org.elasticsearch.plugins.ScriptPlugin; import org.elasticsearch.script.ScriptContext; -import org.elasticsearch.xpack.security.Security; -import org.elasticsearch.xpack.security.authc.AuthenticationModule; import org.elasticsearch.threadpool.ExecutorBuilder; import org.elasticsearch.xpack.action.TransportXPackInfoAction; import org.elasticsearch.xpack.action.TransportXPackUsageAction; @@ -34,6 +35,7 @@ import org.elasticsearch.xpack.action.XPackUsageAction; import org.elasticsearch.xpack.common.ScriptServiceProxy; import org.elasticsearch.xpack.common.http.HttpClientModule; import org.elasticsearch.xpack.common.secret.SecretModule; +import org.elasticsearch.xpack.common.text.TextTemplateModule; import org.elasticsearch.xpack.extensions.XPackExtension; import org.elasticsearch.xpack.extensions.XPackExtensionsService; import org.elasticsearch.xpack.graph.Graph; @@ -41,10 +43,11 @@ import org.elasticsearch.xpack.notification.Notification; import org.elasticsearch.xpack.notification.email.Account; import org.elasticsearch.xpack.notification.email.support.BodyPartSource; import org.elasticsearch.xpack.rest.action.RestXPackInfoAction; -import org.elasticsearch.xpack.common.text.TextTemplateModule; import org.elasticsearch.xpack.rest.action.RestXPackUsageAction; -import org.elasticsearch.xpack.watcher.Watcher; +import org.elasticsearch.xpack.security.Security; +import org.elasticsearch.xpack.security.authc.AuthenticationModule; import org.elasticsearch.xpack.support.clock.ClockModule; +import org.elasticsearch.xpack.watcher.Watcher; import java.nio.file.Path; import java.security.AccessController; @@ -54,7 +57,7 @@ import java.util.Collection; import java.util.Collections; import java.util.List; -public class XPackPlugin extends Plugin implements ScriptPlugin { +public class XPackPlugin extends Plugin implements ScriptPlugin, ActionPlugin { public static final String NAME = "x-pack"; @@ -220,16 +223,28 @@ public class XPackPlugin extends Plugin implements ScriptPlugin { graph.onModule(module); } - public void onModule(ActionModule module) { - if (!transportClientMode) { - module.registerAction(XPackInfoAction.INSTANCE, TransportXPackInfoAction.class); - module.registerAction(XPackUsageAction.INSTANCE, TransportXPackUsageAction.class); - } - licensing.onModule(module); - monitoring.onModule(module); - security.onModule(module); - watcher.onModule(module); - graph.onModule(module); + @Override + public List, ? extends ActionResponse>> getActions() { + List, ? extends ActionResponse>> actions = new ArrayList<>(); + actions.add(new ActionHandler<>(XPackInfoAction.INSTANCE, TransportXPackInfoAction.class)); + actions.add(new ActionHandler<>(XPackUsageAction.INSTANCE, TransportXPackUsageAction.class)); + actions.addAll(licensing.getActions()); + actions.addAll(monitoring.getActions()); + actions.addAll(security.getActions()); + actions.addAll(watcher.getActions()); + actions.addAll(graph.getActions()); + return actions; + } + + @Override + public List> getActionFilters() { + List> filters = new ArrayList<>(); + filters.addAll(licensing.getActionFilters()); + filters.addAll(monitoring.getActionFilters()); + filters.addAll(security.getActionFilters()); + filters.addAll(watcher.getActionFilters()); + filters.addAll(graph.getActionFilters()); + return filters; } public void onModule(AuthenticationModule module) { diff --git a/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/Watcher.java b/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/Watcher.java index 960a63e039c..5c0d6e0990d 100644 --- a/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/Watcher.java +++ b/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/Watcher.java @@ -5,7 +5,8 @@ */ package org.elasticsearch.xpack.watcher; -import org.elasticsearch.action.ActionModule; +import org.elasticsearch.action.ActionRequest; +import org.elasticsearch.action.ActionResponse; import org.elasticsearch.client.Client; import org.elasticsearch.cluster.metadata.MetaData; import org.elasticsearch.common.Booleans; @@ -20,6 +21,7 @@ import org.elasticsearch.common.regex.Regex; import org.elasticsearch.common.settings.Setting; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.util.concurrent.EsExecutors; +import org.elasticsearch.plugins.ActionPlugin; import org.elasticsearch.threadpool.ExecutorBuilder; import org.elasticsearch.threadpool.FixedExecutorBuilder; import org.elasticsearch.xpack.XPackPlugin; @@ -73,7 +75,9 @@ import java.util.Collections; import java.util.List; import java.util.function.Function; -public class Watcher { +import static java.util.Collections.emptyList; + +public class Watcher implements ActionPlugin { public static final String NAME = "watcher"; @@ -188,17 +192,19 @@ public class Watcher { } } - public void onModule(ActionModule module) { - if (enabled) { - module.registerAction(PutWatchAction.INSTANCE, TransportPutWatchAction.class); - module.registerAction(DeleteWatchAction.INSTANCE, TransportDeleteWatchAction.class); - module.registerAction(GetWatchAction.INSTANCE, TransportGetWatchAction.class); - module.registerAction(WatcherStatsAction.INSTANCE, TransportWatcherStatsAction.class); - module.registerAction(AckWatchAction.INSTANCE, TransportAckWatchAction.class); - module.registerAction(ActivateWatchAction.INSTANCE, TransportActivateWatchAction.class); - module.registerAction(WatcherServiceAction.INSTANCE, TransportWatcherServiceAction.class); - module.registerAction(ExecuteWatchAction.INSTANCE, TransportExecuteWatchAction.class); + @Override + public List, ? extends ActionResponse>> getActions() { + if (false == enabled) { + return emptyList(); } + return Arrays.asList(new ActionHandler<>(PutWatchAction.INSTANCE, TransportPutWatchAction.class), + new ActionHandler<>(DeleteWatchAction.INSTANCE, TransportDeleteWatchAction.class), + new ActionHandler<>(GetWatchAction.INSTANCE, TransportGetWatchAction.class), + new ActionHandler<>(WatcherStatsAction.INSTANCE, TransportWatcherStatsAction.class), + new ActionHandler<>(AckWatchAction.INSTANCE, TransportAckWatchAction.class), + new ActionHandler<>(ActivateWatchAction.INSTANCE, TransportActivateWatchAction.class), + new ActionHandler<>(WatcherServiceAction.INSTANCE, TransportWatcherServiceAction.class), + new ActionHandler<>(ExecuteWatchAction.INSTANCE, TransportExecuteWatchAction.class)); } public static boolean enabled(Settings settings) { From 1762d1d96c5528071aea5a0499ea7677135864a8 Mon Sep 17 00:00:00 2001 From: Yannick Welsch Date: Tue, 28 Jun 2016 16:46:31 +0200 Subject: [PATCH 3/4] Fix wrong logger usages Relates to elastic/elasticsearchelastic/elasticsearch#19126 Original commit: elastic/x-pack-elasticsearch@e644f2bd9c243da3826f2bfb915a91cab5716c63 --- .../xpack/security/audit/index/IndexAuditTrail.java | 2 +- .../xpack/security/authc/InternalAuthenticationService.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/elasticsearch/x-pack/security/src/main/java/org/elasticsearch/xpack/security/audit/index/IndexAuditTrail.java b/elasticsearch/x-pack/security/src/main/java/org/elasticsearch/xpack/security/audit/index/IndexAuditTrail.java index 5d257a6837c..bc1f00f0d70 100644 --- a/elasticsearch/x-pack/security/src/main/java/org/elasticsearch/xpack/security/audit/index/IndexAuditTrail.java +++ b/elasticsearch/x-pack/security/src/main/java/org/elasticsearch/xpack/security/audit/index/IndexAuditTrail.java @@ -740,7 +740,7 @@ public class IndexAuditTrail extends AbstractComponent implements AuditTrail, Cl for (String host : hosts) { List hostPort = Arrays.asList(host.trim().split(":")); if (hostPort.size() != 1 && hostPort.size() != 2) { - logger.warn("invalid host:port specified: [{}] for setting [" + REMOTE_CLIENT_SETTINGS.getKey() + ".hosts]", host); + logger.warn("invalid host:port specified: [{}] for setting [{}.hosts]", REMOTE_CLIENT_SETTINGS.getKey(), host); } hostPortPairs.add(new Tuple<>(hostPort.get(0), hostPort.size() == 2 ? Integer.valueOf(hostPort.get(1)) : 9300)); } diff --git a/elasticsearch/x-pack/security/src/main/java/org/elasticsearch/xpack/security/authc/InternalAuthenticationService.java b/elasticsearch/x-pack/security/src/main/java/org/elasticsearch/xpack/security/authc/InternalAuthenticationService.java index 5e99745bf0f..7a18ac6154d 100644 --- a/elasticsearch/x-pack/security/src/main/java/org/elasticsearch/xpack/security/authc/InternalAuthenticationService.java +++ b/elasticsearch/x-pack/security/src/main/java/org/elasticsearch/xpack/security/authc/InternalAuthenticationService.java @@ -173,7 +173,7 @@ public class InternalAuthenticationService extends AbstractComponent implements if (logger.isDebugEnabled()) { logger.debug("failed to extract token from request: [{}]", e, request); } else { - logger.warn("failed to extract token from request: [{}]", request, e.getMessage()); + logger.warn("failed to extract token from request: [{}]: {}", request, e.getMessage()); } throw request.exceptionProcessingRequest(e, null); } @@ -211,7 +211,7 @@ public class InternalAuthenticationService extends AbstractComponent implements } } } catch (Exception e) { - logger.debug("authentication failed for principal [{}], [{}]", e, request); + logger.debug("authentication failed for principal [{}]", e, request); throw request.exceptionProcessingRequest(e, token); } finally { token.clearCredentials(); From a06f4a02fd2a3666f44419f8c48b36ba1043f53a Mon Sep 17 00:00:00 2001 From: Tanguy Leroux Date: Tue, 28 Jun 2016 10:57:24 +0200 Subject: [PATCH 4/4] Rename Marvel packages and directories to Monitoring related to elastic/elasticsearch#2383 Original commit: elastic/x-pack-elasticsearch@7f4001a031cbd9c48715e45f1ed9197b6537c67e --- .../qa/smoke-test-plugins-ssl/build.gradle | 2 +- elasticsearch/x-pack/build.gradle | 2 +- .../xpack/graph/test/GraphTests.java | 3 +- .../AbstractLicensesIntegrationTestCase.java | 2 +- .../plugin/LicensesTransportTests.java | 2 +- .../xpack/TribeTransportTestCase.java | 2 +- .../xpack/monitoring}/MonitoredSystem.java | 2 +- .../xpack/monitoring}/Monitoring.java | 19 +++--- .../monitoring}/MonitoringFeatureSet.java | 6 +- .../xpack/monitoring}/MonitoringLicensee.java | 4 +- .../xpack/monitoring}/MonitoringModule.java | 6 +- .../xpack/monitoring}/MonitoringSettings.java | 5 +- .../action/MonitoringBulkAction.java | 2 +- .../monitoring}/action/MonitoringBulkDoc.java | 4 +- .../action/MonitoringBulkRequest.java | 4 +- .../action/MonitoringBulkRequestBuilder.java | 2 +- .../action/MonitoringBulkResponse.java | 2 +- .../monitoring}/action/MonitoringIndex.java | 2 +- .../action/TransportMonitoringBulkAction.java | 8 +-- .../xpack/monitoring}/agent/AgentService.java | 16 ++--- .../agent/collector/AbstractCollector.java | 12 ++-- .../agent/collector/Collector.java | 4 +- .../agent/collector/CollectorModule.java | 16 ++--- .../cluster/ClusterInfoMonitoringDoc.java | 4 +- .../cluster/ClusterStateCollector.java | 16 ++--- .../cluster/ClusterStateMonitoringDoc.java | 4 +- .../ClusterStateNodeMonitoringDoc.java | 4 +- .../cluster/ClusterStatsCollector.java | 13 ++-- .../cluster/ClusterStatsMonitoringDoc.java | 4 +- .../cluster/DiscoveryNodeMonitoringDoc.java | 4 +- .../indices/IndexRecoveryCollector.java | 12 ++-- .../indices/IndexRecoveryMonitoringDoc.java | 4 +- .../indices/IndexStatsCollector.java | 12 ++-- .../indices/IndexStatsMonitoringDoc.java | 4 +- .../indices/IndicesStatsCollector.java | 12 ++-- .../indices/IndicesStatsMonitoringDoc.java | 4 +- .../collector/node/NodeStatsCollector.java | 12 ++-- .../node/NodeStatsMonitoringDoc.java | 4 +- .../collector/shards/ShardMonitoringDoc.java | 4 +- .../collector/shards/ShardsCollector.java | 12 ++-- .../agent/exporter/ExportBulk.java | 2 +- .../agent/exporter/ExportException.java | 2 +- .../monitoring}/agent/exporter/Exporter.java | 4 +- .../agent/exporter/ExporterModule.java | 8 +-- .../monitoring}/agent/exporter/Exporters.java | 6 +- .../agent/exporter/MonitoringDoc.java | 2 +- .../exporter/MonitoringTemplateUtils.java} | 6 +- .../agent/exporter/http/HttpExporter.java | 16 ++--- .../exporter/http/HttpExporterUtils.java | 2 +- .../agent/exporter/local/LocalBulk.java | 12 ++-- .../agent/exporter/local/LocalExporter.java | 14 ++--- .../resolver/MonitoringIndexNameResolver.java | 20 +++--- .../agent/resolver/ResolversRegistry.java | 58 +++++++++-------- .../bulk/MonitoringBulkDataResolver.java | 6 +- .../MonitoringBulkTimestampedResolver.java | 8 +-- .../resolver/cluster/ClusterInfoResolver.java | 6 +- .../cluster/ClusterStateNodeResolver.java | 8 +-- .../cluster/ClusterStateResolver.java | 8 +-- .../cluster/ClusterStatsResolver.java | 8 +-- .../cluster/DiscoveryNodeResolver.java | 6 +- .../indices/IndexRecoveryResolver.java | 8 +-- .../resolver/indices/IndexStatsResolver.java | 8 +-- .../indices/IndicesStatsResolver.java | 8 +-- .../resolver/node/NodeStatsResolver.java | 8 +-- .../agent/resolver/shards/ShardsResolver.java | 8 +-- .../monitoring}/cleaner/CleanerService.java | 6 +- .../monitoring}/client/MonitoringClient.java | 10 +-- .../client/MonitoringClientModule.java | 2 +- .../rest/MonitoringRestHandler.java | 2 +- .../rest/action/RestMonitoringBulkAction.java | 8 +-- .../monitoring}/support/VersionUtils.java | 2 +- .../src/main/resources/monitoring-data.json | 0 .../src/main/resources/monitoring-es.json | 0 .../src/main/resources/monitoring-kibana.json | 0 .../stats/IndicesStatsResponseTestUtils.java | 0 .../xpack/monitoring}/MonitoringF.java | 2 +- .../MonitoringFeatureSetTests.java | 10 +-- .../MonitoringPluginClientTests.java} | 7 +-- .../monitoring/MonitoringPluginTests.java} | 20 +++--- .../monitoring/MonitoringSettingsTests.java} | 5 +- .../monitoring}/MonitoringTribeTests.java | 8 +-- .../action/MonitoringBulkDocTests.java | 4 +- .../action/MonitoringBulkRequestTests.java | 2 +- .../action/MonitoringBulkResponseTests.java | 4 +- .../action/MonitoringBulkTests.java | 12 ++-- .../action/MonitoringIndexTests.java | 2 +- .../TransportMonitoringBulkActionTests.java | 13 ++-- .../collector/AbstractCollectorTestCase.java | 9 +-- .../cluster/ClusterStateCollectorTests.java | 58 ++++++++--------- .../cluster/ClusterStatsCollectorTests.java | 53 ++++++++-------- .../indices/IndexRecoveryCollectorTests.java | 39 ++++++------ .../indices/IndexStatsCollectorTests.java | 39 ++++++------ .../indices/IndicesStatsCollectorTests.java | 42 ++++++------- .../node/NodeStatsCollectorTests.java | 40 ++++++------ .../shards/ShardsCollectorTests.java | 34 +++++----- .../AbstractExporterTemplateTestCase.java | 22 +++---- .../agent/exporter/ExportersTests.java | 10 +-- .../agent/exporter/MonitoringDocTests.java | 2 +- .../MonitoringTemplateUtilsTests.java} | 10 +-- .../http/HttpExporterTemplateTests.java | 6 +- .../exporter/http/HttpExporterTests.java | 44 ++++++------- .../exporter/http/HttpExporterUtilsTests.java | 2 +- .../local/LocalExporterTemplateTests.java | 6 +- .../exporter/local/LocalExporterTests.java | 63 +++++++++---------- .../agent/resolver/DataResolverTests.java | 10 +-- .../MonitoringIndexNameResolverTestCase.java | 48 +++++++------- .../resolver/TimestampedResolverTests.java | 18 +++--- .../bulk/MonitoringBulkDataResolverTests.java | 16 ++--- ...onitoringBulkTimestampedResolverTests.java | 14 ++--- .../cluster/ClusterInfoResolverTests.java | 16 ++--- .../resolver/cluster/ClusterInfoTests.java | 26 ++++---- .../ClusterStateNodeResolverTests.java | 14 ++--- .../cluster/ClusterStateResolverTests.java | 14 ++--- .../resolver/cluster/ClusterStateTests.java | 42 ++++++------- .../cluster/ClusterStatsResolverTests.java | 22 +++---- .../resolver/cluster/ClusterStatsTests.java | 18 +++--- .../indices/IndexRecoveryResolverTests.java | 14 ++--- .../resolver/indices/IndexRecoveryTests.java | 22 +++---- .../indices/IndexStatsResolverTests.java | 14 ++--- .../resolver/indices/IndexStatsTests.java | 20 +++--- .../indices/IndicesStatsResolverTests.java | 14 ++--- .../resolver/indices/IndicesStatsTests.java | 20 +++--- .../node/DiscoveryNodeResolverTests.java | 16 ++--- .../resolver/node/MultiNodesStatsTests.java | 16 ++--- .../resolver/node/NodeStatsResolverTests.java | 14 ++--- .../agent/resolver/node/NodeStatsTests.java | 22 +++---- .../resolver/shards/ShardsResolverTests.java | 16 ++--- .../agent/resolver/shards/ShardsTests.java | 26 ++++---- .../settings/MonitoringSettingsTests.java} | 22 +++---- .../AbstractIndicesCleanerTestCase.java | 24 +++---- .../cleaner/CleanerServiceTests.java | 6 +- .../local/LocalIndicesCleanerTests.java | 6 +- .../license/LicenseIntegrationTests.java | 8 +-- .../license/MonitoringLicenseeTests.java} | 6 +- .../MonitoringInternalClientTests.java} | 8 +-- .../MonitoringSettingsFilterTests.java} | 8 +-- .../support/VersionUtilsTests.java | 2 +- .../test/MonitoringIntegTestCase.java} | 60 +++++++++--------- .../src/test/resources/log4j.properties | 2 +- .../src/test/resources/monitoring-test.json | 0 .../api/xpack.monitoring.bulk.json | 2 +- .../test/monitoring/bulk/10_basic.yaml | 0 .../x-pack/security/config/x-pack/roles.yml | 6 +- .../security/authz/permission/KibanaRole.java | 2 +- .../test/SecuritySettingsSource.java | 2 +- .../authz/permission/KibanaRoleTests.java | 2 +- .../authz/permission/KibanaUserRoleTests.java | 2 +- .../org/elasticsearch/transport/actions | 1 + .../security/authz/store/default_roles.yml | 6 +- .../org/elasticsearch/xpack/XPackClient.java | 2 +- .../org/elasticsearch/xpack/XPackPlugin.java | 4 +- .../watcher/WatcherPluginDisableTests.java | 2 +- .../AbstractWatcherIntegrationTestCase.java | 2 +- .../WatcherSettingsFilterTests.java | 6 +- 154 files changed, 873 insertions(+), 886 deletions(-) rename elasticsearch/x-pack/{marvel/src/main/java/org/elasticsearch/marvel => monitoring/src/main/java/org/elasticsearch/xpack/monitoring}/MonitoredSystem.java (95%) rename elasticsearch/x-pack/{marvel/src/main/java/org/elasticsearch/marvel => monitoring/src/main/java/org/elasticsearch/xpack/monitoring}/Monitoring.java (83%) rename elasticsearch/x-pack/{marvel/src/main/java/org/elasticsearch/marvel => monitoring/src/main/java/org/elasticsearch/xpack/monitoring}/MonitoringFeatureSet.java (95%) rename elasticsearch/x-pack/{marvel/src/main/java/org/elasticsearch/marvel => monitoring/src/main/java/org/elasticsearch/xpack/monitoring}/MonitoringLicensee.java (97%) rename elasticsearch/x-pack/{marvel/src/main/java/org/elasticsearch/marvel => monitoring/src/main/java/org/elasticsearch/xpack/monitoring}/MonitoringModule.java (87%) rename elasticsearch/x-pack/{marvel/src/main/java/org/elasticsearch/marvel => monitoring/src/main/java/org/elasticsearch/xpack/monitoring}/MonitoringSettings.java (98%) rename elasticsearch/x-pack/{marvel/src/main/java/org/elasticsearch/marvel => monitoring/src/main/java/org/elasticsearch/xpack/monitoring}/action/MonitoringBulkAction.java (95%) rename elasticsearch/x-pack/{marvel/src/main/java/org/elasticsearch/marvel => monitoring/src/main/java/org/elasticsearch/xpack/monitoring}/action/MonitoringBulkDoc.java (94%) rename elasticsearch/x-pack/{marvel/src/main/java/org/elasticsearch/marvel => monitoring/src/main/java/org/elasticsearch/xpack/monitoring}/action/MonitoringBulkRequest.java (96%) rename elasticsearch/x-pack/{marvel/src/main/java/org/elasticsearch/marvel => monitoring/src/main/java/org/elasticsearch/xpack/monitoring}/action/MonitoringBulkRequestBuilder.java (95%) rename elasticsearch/x-pack/{marvel/src/main/java/org/elasticsearch/marvel => monitoring/src/main/java/org/elasticsearch/xpack/monitoring}/action/MonitoringBulkResponse.java (98%) rename elasticsearch/x-pack/{marvel/src/main/java/org/elasticsearch/marvel => monitoring/src/main/java/org/elasticsearch/xpack/monitoring}/action/MonitoringIndex.java (97%) rename elasticsearch/x-pack/{marvel/src/main/java/org/elasticsearch/marvel => monitoring/src/main/java/org/elasticsearch/xpack/monitoring}/action/TransportMonitoringBulkAction.java (96%) rename elasticsearch/x-pack/{marvel/src/main/java/org/elasticsearch/marvel => monitoring/src/main/java/org/elasticsearch/xpack/monitoring}/agent/AgentService.java (93%) rename elasticsearch/x-pack/{marvel/src/main/java/org/elasticsearch/marvel => monitoring/src/main/java/org/elasticsearch/xpack/monitoring}/agent/collector/AbstractCollector.java (91%) rename elasticsearch/x-pack/{marvel/src/main/java/org/elasticsearch/marvel => monitoring/src/main/java/org/elasticsearch/xpack/monitoring}/agent/collector/Collector.java (77%) rename elasticsearch/x-pack/{marvel/src/main/java/org/elasticsearch/marvel => monitoring/src/main/java/org/elasticsearch/xpack/monitoring}/agent/collector/CollectorModule.java (68%) rename elasticsearch/x-pack/{marvel/src/main/java/org/elasticsearch/marvel => monitoring/src/main/java/org/elasticsearch/xpack/monitoring}/agent/collector/cluster/ClusterInfoMonitoringDoc.java (90%) rename elasticsearch/x-pack/{marvel/src/main/java/org/elasticsearch/marvel => monitoring/src/main/java/org/elasticsearch/xpack/monitoring}/agent/collector/cluster/ClusterStateCollector.java (87%) rename elasticsearch/x-pack/{marvel/src/main/java/org/elasticsearch/marvel => monitoring/src/main/java/org/elasticsearch/xpack/monitoring}/agent/collector/cluster/ClusterStateMonitoringDoc.java (87%) rename elasticsearch/x-pack/{marvel/src/main/java/org/elasticsearch/marvel => monitoring/src/main/java/org/elasticsearch/xpack/monitoring}/agent/collector/cluster/ClusterStateNodeMonitoringDoc.java (85%) rename elasticsearch/x-pack/{marvel/src/main/java/org/elasticsearch/marvel => monitoring/src/main/java/org/elasticsearch/xpack/monitoring}/agent/collector/cluster/ClusterStatsCollector.java (92%) rename elasticsearch/x-pack/{marvel/src/main/java/org/elasticsearch/marvel => monitoring/src/main/java/org/elasticsearch/xpack/monitoring}/agent/collector/cluster/ClusterStatsMonitoringDoc.java (84%) rename elasticsearch/x-pack/{marvel/src/main/java/org/elasticsearch/marvel => monitoring/src/main/java/org/elasticsearch/xpack/monitoring}/agent/collector/cluster/DiscoveryNodeMonitoringDoc.java (82%) rename elasticsearch/x-pack/{marvel/src/main/java/org/elasticsearch/marvel => monitoring/src/main/java/org/elasticsearch/xpack/monitoring}/agent/collector/indices/IndexRecoveryCollector.java (90%) rename elasticsearch/x-pack/{marvel/src/main/java/org/elasticsearch/marvel => monitoring/src/main/java/org/elasticsearch/xpack/monitoring}/agent/collector/indices/IndexRecoveryMonitoringDoc.java (85%) rename elasticsearch/x-pack/{marvel/src/main/java/org/elasticsearch/marvel => monitoring/src/main/java/org/elasticsearch/xpack/monitoring}/agent/collector/indices/IndexStatsCollector.java (91%) rename elasticsearch/x-pack/{marvel/src/main/java/org/elasticsearch/marvel => monitoring/src/main/java/org/elasticsearch/xpack/monitoring}/agent/collector/indices/IndexStatsMonitoringDoc.java (83%) rename elasticsearch/x-pack/{marvel/src/main/java/org/elasticsearch/marvel => monitoring/src/main/java/org/elasticsearch/xpack/monitoring}/agent/collector/indices/IndicesStatsCollector.java (90%) rename elasticsearch/x-pack/{marvel/src/main/java/org/elasticsearch/marvel => monitoring/src/main/java/org/elasticsearch/xpack/monitoring}/agent/collector/indices/IndicesStatsMonitoringDoc.java (84%) rename elasticsearch/x-pack/{marvel/src/main/java/org/elasticsearch/marvel => monitoring/src/main/java/org/elasticsearch/xpack/monitoring}/agent/collector/node/NodeStatsCollector.java (93%) rename elasticsearch/x-pack/{marvel/src/main/java/org/elasticsearch/marvel => monitoring/src/main/java/org/elasticsearch/xpack/monitoring}/agent/collector/node/NodeStatsMonitoringDoc.java (93%) rename elasticsearch/x-pack/{marvel/src/main/java/org/elasticsearch/marvel => monitoring/src/main/java/org/elasticsearch/xpack/monitoring}/agent/collector/shards/ShardMonitoringDoc.java (87%) rename elasticsearch/x-pack/{marvel/src/main/java/org/elasticsearch/marvel => monitoring/src/main/java/org/elasticsearch/xpack/monitoring}/agent/collector/shards/ShardsCollector.java (91%) rename elasticsearch/x-pack/{marvel/src/main/java/org/elasticsearch/marvel => monitoring/src/main/java/org/elasticsearch/xpack/monitoring}/agent/exporter/ExportBulk.java (98%) rename elasticsearch/x-pack/{marvel/src/main/java/org/elasticsearch/marvel => monitoring/src/main/java/org/elasticsearch/xpack/monitoring}/agent/exporter/ExportException.java (97%) rename elasticsearch/x-pack/{marvel/src/main/java/org/elasticsearch/marvel => monitoring/src/main/java/org/elasticsearch/xpack/monitoring}/agent/exporter/Exporter.java (96%) rename elasticsearch/x-pack/{marvel/src/main/java/org/elasticsearch/marvel => monitoring/src/main/java/org/elasticsearch/xpack/monitoring}/agent/exporter/ExporterModule.java (87%) rename elasticsearch/x-pack/{marvel/src/main/java/org/elasticsearch/marvel => monitoring/src/main/java/org/elasticsearch/xpack/monitoring}/agent/exporter/Exporters.java (97%) rename elasticsearch/x-pack/{marvel/src/main/java/org/elasticsearch/marvel => monitoring/src/main/java/org/elasticsearch/xpack/monitoring}/agent/exporter/MonitoringDoc.java (99%) rename elasticsearch/x-pack/{marvel/src/main/java/org/elasticsearch/marvel/agent/exporter/MarvelTemplateUtils.java => monitoring/src/main/java/org/elasticsearch/xpack/monitoring/agent/exporter/MonitoringTemplateUtils.java} (86%) rename elasticsearch/x-pack/{marvel/src/main/java/org/elasticsearch/marvel => monitoring/src/main/java/org/elasticsearch/xpack/monitoring}/agent/exporter/http/HttpExporter.java (98%) rename elasticsearch/x-pack/{marvel/src/main/java/org/elasticsearch/marvel => monitoring/src/main/java/org/elasticsearch/xpack/monitoring}/agent/exporter/http/HttpExporterUtils.java (95%) rename elasticsearch/x-pack/{marvel/src/main/java/org/elasticsearch/marvel => monitoring/src/main/java/org/elasticsearch/xpack/monitoring}/agent/exporter/local/LocalBulk.java (90%) rename elasticsearch/x-pack/{marvel/src/main/java/org/elasticsearch/marvel => monitoring/src/main/java/org/elasticsearch/xpack/monitoring}/agent/exporter/local/LocalExporter.java (96%) rename elasticsearch/x-pack/{marvel/src/main/java/org/elasticsearch/marvel => monitoring/src/main/java/org/elasticsearch/xpack/monitoring}/agent/resolver/MonitoringIndexNameResolver.java (91%) rename elasticsearch/x-pack/{marvel/src/main/java/org/elasticsearch/marvel => monitoring/src/main/java/org/elasticsearch/xpack/monitoring}/agent/resolver/ResolversRegistry.java (67%) rename elasticsearch/x-pack/{marvel/src/main/java/org/elasticsearch/marvel => monitoring/src/main/java/org/elasticsearch/xpack/monitoring}/agent/resolver/bulk/MonitoringBulkDataResolver.java (83%) rename elasticsearch/x-pack/{marvel/src/main/java/org/elasticsearch/marvel => monitoring/src/main/java/org/elasticsearch/xpack/monitoring}/agent/resolver/bulk/MonitoringBulkTimestampedResolver.java (80%) rename elasticsearch/x-pack/{marvel/src/main/java/org/elasticsearch/marvel => monitoring/src/main/java/org/elasticsearch/xpack/monitoring}/agent/resolver/cluster/ClusterInfoResolver.java (92%) rename elasticsearch/x-pack/{marvel/src/main/java/org/elasticsearch/marvel => monitoring/src/main/java/org/elasticsearch/xpack/monitoring}/agent/resolver/cluster/ClusterStateNodeResolver.java (81%) rename elasticsearch/x-pack/{marvel/src/main/java/org/elasticsearch/marvel => monitoring/src/main/java/org/elasticsearch/xpack/monitoring}/agent/resolver/cluster/ClusterStateResolver.java (86%) rename elasticsearch/x-pack/{marvel/src/main/java/org/elasticsearch/marvel => monitoring/src/main/java/org/elasticsearch/xpack/monitoring}/agent/resolver/cluster/ClusterStatsResolver.java (88%) rename elasticsearch/x-pack/{marvel/src/main/java/org/elasticsearch/marvel => monitoring/src/main/java/org/elasticsearch/xpack/monitoring}/agent/resolver/cluster/DiscoveryNodeResolver.java (88%) rename elasticsearch/x-pack/{marvel/src/main/java/org/elasticsearch/marvel => monitoring/src/main/java/org/elasticsearch/xpack/monitoring}/agent/resolver/indices/IndexRecoveryResolver.java (88%) rename elasticsearch/x-pack/{marvel/src/main/java/org/elasticsearch/marvel => monitoring/src/main/java/org/elasticsearch/xpack/monitoring}/agent/resolver/indices/IndexStatsResolver.java (94%) rename elasticsearch/x-pack/{marvel/src/main/java/org/elasticsearch/marvel => monitoring/src/main/java/org/elasticsearch/xpack/monitoring}/agent/resolver/indices/IndicesStatsResolver.java (89%) rename elasticsearch/x-pack/{marvel/src/main/java/org/elasticsearch/marvel => monitoring/src/main/java/org/elasticsearch/xpack/monitoring}/agent/resolver/node/NodeStatsResolver.java (95%) rename elasticsearch/x-pack/{marvel/src/main/java/org/elasticsearch/marvel => monitoring/src/main/java/org/elasticsearch/xpack/monitoring}/agent/resolver/shards/ShardsResolver.java (90%) rename elasticsearch/x-pack/{marvel/src/main/java/org/elasticsearch/marvel => monitoring/src/main/java/org/elasticsearch/xpack/monitoring}/cleaner/CleanerService.java (98%) rename elasticsearch/x-pack/{marvel/src/main/java/org/elasticsearch/marvel => monitoring/src/main/java/org/elasticsearch/xpack/monitoring}/client/MonitoringClient.java (83%) rename elasticsearch/x-pack/{marvel/src/main/java/org/elasticsearch/marvel => monitoring/src/main/java/org/elasticsearch/xpack/monitoring}/client/MonitoringClientModule.java (90%) rename elasticsearch/x-pack/{marvel/src/main/java/org/elasticsearch/marvel => monitoring/src/main/java/org/elasticsearch/xpack/monitoring}/rest/MonitoringRestHandler.java (93%) rename elasticsearch/x-pack/{marvel/src/main/java/org/elasticsearch/marvel => monitoring/src/main/java/org/elasticsearch/xpack/monitoring}/rest/action/RestMonitoringBulkAction.java (92%) rename elasticsearch/x-pack/{marvel/src/main/java/org/elasticsearch/marvel => monitoring/src/main/java/org/elasticsearch/xpack/monitoring}/support/VersionUtils.java (96%) rename elasticsearch/x-pack/{marvel => monitoring}/src/main/resources/monitoring-data.json (100%) rename elasticsearch/x-pack/{marvel => monitoring}/src/main/resources/monitoring-es.json (100%) rename elasticsearch/x-pack/{marvel => monitoring}/src/main/resources/monitoring-kibana.json (100%) rename elasticsearch/x-pack/{marvel => monitoring}/src/test/java/org/elasticsearch/action/admin/indices/stats/IndicesStatsResponseTestUtils.java (100%) rename elasticsearch/x-pack/{marvel/src/test/java/org/elasticsearch/marvel => monitoring/src/test/java/org/elasticsearch/xpack/monitoring}/MonitoringF.java (97%) rename elasticsearch/x-pack/{marvel/src/test/java/org/elasticsearch/marvel => monitoring/src/test/java/org/elasticsearch/xpack/monitoring}/MonitoringFeatureSetTests.java (94%) rename elasticsearch/x-pack/{marvel/src/test/java/org/elasticsearch/marvel/MarvelPluginClientTests.java => monitoring/src/test/java/org/elasticsearch/xpack/monitoring/MonitoringPluginClientTests.java} (88%) rename elasticsearch/x-pack/{marvel/src/test/java/org/elasticsearch/marvel/MarvelPluginTests.java => monitoring/src/test/java/org/elasticsearch/xpack/monitoring/MonitoringPluginTests.java} (86%) rename elasticsearch/x-pack/{marvel/src/test/java/org/elasticsearch/marvel/MarvelSettingsTests.java => monitoring/src/test/java/org/elasticsearch/xpack/monitoring/MonitoringSettingsTests.java} (94%) rename elasticsearch/x-pack/{marvel/src/test/java/org/elasticsearch/marvel => monitoring/src/test/java/org/elasticsearch/xpack/monitoring}/MonitoringTribeTests.java (86%) rename elasticsearch/x-pack/{marvel/src/test/java/org/elasticsearch/marvel => monitoring/src/test/java/org/elasticsearch/xpack/monitoring}/action/MonitoringBulkDocTests.java (96%) rename elasticsearch/x-pack/{marvel/src/test/java/org/elasticsearch/marvel => monitoring/src/test/java/org/elasticsearch/xpack/monitoring}/action/MonitoringBulkRequestTests.java (99%) rename elasticsearch/x-pack/{marvel/src/test/java/org/elasticsearch/marvel => monitoring/src/test/java/org/elasticsearch/xpack/monitoring}/action/MonitoringBulkResponseTests.java (96%) rename elasticsearch/x-pack/{marvel/src/test/java/org/elasticsearch/marvel => monitoring/src/test/java/org/elasticsearch/xpack/monitoring}/action/MonitoringBulkTests.java (93%) rename elasticsearch/x-pack/{marvel/src/test/java/org/elasticsearch/marvel => monitoring/src/test/java/org/elasticsearch/xpack/monitoring}/action/MonitoringIndexTests.java (97%) rename elasticsearch/x-pack/{marvel/src/test/java/org/elasticsearch/marvel => monitoring/src/test/java/org/elasticsearch/xpack/monitoring}/action/TransportMonitoringBulkActionTests.java (96%) rename elasticsearch/x-pack/{marvel/src/test/java/org/elasticsearch/marvel => monitoring/src/test/java/org/elasticsearch/xpack/monitoring}/agent/collector/AbstractCollectorTestCase.java (96%) rename elasticsearch/x-pack/{marvel/src/test/java/org/elasticsearch/marvel => monitoring/src/test/java/org/elasticsearch/xpack/monitoring}/agent/collector/cluster/ClusterStateCollectorTests.java (78%) rename elasticsearch/x-pack/{marvel/src/test/java/org/elasticsearch/marvel => monitoring/src/test/java/org/elasticsearch/xpack/monitoring}/agent/collector/cluster/ClusterStatsCollectorTests.java (73%) rename elasticsearch/x-pack/{marvel/src/test/java/org/elasticsearch/marvel => monitoring/src/test/java/org/elasticsearch/xpack/monitoring}/agent/collector/indices/IndexRecoveryCollectorTests.java (84%) rename elasticsearch/x-pack/{marvel/src/test/java/org/elasticsearch/marvel => monitoring/src/test/java/org/elasticsearch/xpack/monitoring}/agent/collector/indices/IndexStatsCollectorTests.java (86%) rename elasticsearch/x-pack/{marvel/src/test/java/org/elasticsearch/marvel => monitoring/src/test/java/org/elasticsearch/xpack/monitoring}/agent/collector/indices/IndicesStatsCollectorTests.java (84%) rename elasticsearch/x-pack/{marvel/src/test/java/org/elasticsearch/marvel => monitoring/src/test/java/org/elasticsearch/xpack/monitoring}/agent/collector/node/NodeStatsCollectorTests.java (73%) rename elasticsearch/x-pack/{marvel/src/test/java/org/elasticsearch/marvel => monitoring/src/test/java/org/elasticsearch/xpack/monitoring}/agent/collector/shards/ShardsCollectorTests.java (85%) rename elasticsearch/x-pack/{marvel/src/test/java/org/elasticsearch/marvel => monitoring/src/test/java/org/elasticsearch/xpack/monitoring}/agent/exporter/AbstractExporterTemplateTestCase.java (91%) rename elasticsearch/x-pack/{marvel/src/test/java/org/elasticsearch/marvel => monitoring/src/test/java/org/elasticsearch/xpack/monitoring}/agent/exporter/ExportersTests.java (98%) rename elasticsearch/x-pack/{marvel/src/test/java/org/elasticsearch/marvel => monitoring/src/test/java/org/elasticsearch/xpack/monitoring}/agent/exporter/MonitoringDocTests.java (99%) rename elasticsearch/x-pack/{marvel/src/test/java/org/elasticsearch/marvel/agent/exporter/MarvelTemplateUtilsTests.java => monitoring/src/test/java/org/elasticsearch/xpack/monitoring/agent/exporter/MonitoringTemplateUtilsTests.java} (70%) rename elasticsearch/x-pack/{marvel/src/test/java/org/elasticsearch/marvel => monitoring/src/test/java/org/elasticsearch/xpack/monitoring}/agent/exporter/http/HttpExporterTemplateTests.java (96%) rename elasticsearch/x-pack/{marvel/src/test/java/org/elasticsearch/marvel => monitoring/src/test/java/org/elasticsearch/xpack/monitoring}/agent/exporter/http/HttpExporterTests.java (93%) rename elasticsearch/x-pack/{marvel/src/test/java/org/elasticsearch/marvel => monitoring/src/test/java/org/elasticsearch/xpack/monitoring}/agent/exporter/http/HttpExporterUtilsTests.java (98%) rename elasticsearch/x-pack/{marvel/src/test/java/org/elasticsearch/marvel => monitoring/src/test/java/org/elasticsearch/xpack/monitoring}/agent/exporter/local/LocalExporterTemplateTests.java (87%) rename elasticsearch/x-pack/{marvel/src/test/java/org/elasticsearch/marvel => monitoring/src/test/java/org/elasticsearch/xpack/monitoring}/agent/exporter/local/LocalExporterTests.java (81%) rename elasticsearch/x-pack/{marvel/src/test/java/org/elasticsearch/marvel => monitoring/src/test/java/org/elasticsearch/xpack/monitoring}/agent/resolver/DataResolverTests.java (84%) rename elasticsearch/x-pack/{marvel/src/test/java/org/elasticsearch/marvel => monitoring/src/test/java/org/elasticsearch/xpack/monitoring}/agent/resolver/MonitoringIndexNameResolverTestCase.java (77%) rename elasticsearch/x-pack/{marvel/src/test/java/org/elasticsearch/marvel => monitoring/src/test/java/org/elasticsearch/xpack/monitoring}/agent/resolver/TimestampedResolverTests.java (83%) rename elasticsearch/x-pack/{marvel/src/test/java/org/elasticsearch/marvel => monitoring/src/test/java/org/elasticsearch/xpack/monitoring}/agent/resolver/bulk/MonitoringBulkDataResolverTests.java (82%) rename elasticsearch/x-pack/{marvel/src/test/java/org/elasticsearch/marvel => monitoring/src/test/java/org/elasticsearch/xpack/monitoring}/agent/resolver/bulk/MonitoringBulkTimestampedResolverTests.java (84%) rename elasticsearch/x-pack/{marvel/src/test/java/org/elasticsearch/marvel => monitoring/src/test/java/org/elasticsearch/xpack/monitoring}/agent/resolver/cluster/ClusterInfoResolverTests.java (85%) rename elasticsearch/x-pack/{marvel/src/test/java/org/elasticsearch/marvel => monitoring/src/test/java/org/elasticsearch/xpack/monitoring}/agent/resolver/cluster/ClusterInfoTests.java (87%) rename elasticsearch/x-pack/{marvel/src/test/java/org/elasticsearch/marvel => monitoring/src/test/java/org/elasticsearch/xpack/monitoring}/agent/resolver/cluster/ClusterStateNodeResolverTests.java (80%) rename elasticsearch/x-pack/{marvel/src/test/java/org/elasticsearch/marvel => monitoring/src/test/java/org/elasticsearch/xpack/monitoring}/agent/resolver/cluster/ClusterStateResolverTests.java (84%) rename elasticsearch/x-pack/{marvel/src/test/java/org/elasticsearch/marvel => monitoring/src/test/java/org/elasticsearch/xpack/monitoring}/agent/resolver/cluster/ClusterStateTests.java (84%) rename elasticsearch/x-pack/{marvel/src/test/java/org/elasticsearch/marvel => monitoring/src/test/java/org/elasticsearch/xpack/monitoring}/agent/resolver/cluster/ClusterStatsResolverTests.java (89%) rename elasticsearch/x-pack/{marvel/src/test/java/org/elasticsearch/marvel => monitoring/src/test/java/org/elasticsearch/xpack/monitoring}/agent/resolver/cluster/ClusterStatsTests.java (83%) rename elasticsearch/x-pack/{marvel/src/test/java/org/elasticsearch/marvel => monitoring/src/test/java/org/elasticsearch/xpack/monitoring}/agent/resolver/indices/IndexRecoveryResolverTests.java (83%) rename elasticsearch/x-pack/{marvel/src/test/java/org/elasticsearch/marvel => monitoring/src/test/java/org/elasticsearch/xpack/monitoring}/agent/resolver/indices/IndexRecoveryTests.java (87%) rename elasticsearch/x-pack/{marvel/src/test/java/org/elasticsearch/marvel => monitoring/src/test/java/org/elasticsearch/xpack/monitoring}/agent/resolver/indices/IndexStatsResolverTests.java (89%) rename elasticsearch/x-pack/{marvel/src/test/java/org/elasticsearch/marvel => monitoring/src/test/java/org/elasticsearch/xpack/monitoring}/agent/resolver/indices/IndexStatsTests.java (85%) rename elasticsearch/x-pack/{marvel/src/test/java/org/elasticsearch/marvel => monitoring/src/test/java/org/elasticsearch/xpack/monitoring}/agent/resolver/indices/IndicesStatsResolverTests.java (90%) rename elasticsearch/x-pack/{marvel/src/test/java/org/elasticsearch/marvel => monitoring/src/test/java/org/elasticsearch/xpack/monitoring}/agent/resolver/indices/IndicesStatsTests.java (84%) rename elasticsearch/x-pack/{marvel/src/test/java/org/elasticsearch/marvel => monitoring/src/test/java/org/elasticsearch/xpack/monitoring}/agent/resolver/node/DiscoveryNodeResolverTests.java (78%) rename elasticsearch/x-pack/{marvel/src/test/java/org/elasticsearch/marvel => monitoring/src/test/java/org/elasticsearch/xpack/monitoring}/agent/resolver/node/MultiNodesStatsTests.java (91%) rename elasticsearch/x-pack/{marvel/src/test/java/org/elasticsearch/marvel => monitoring/src/test/java/org/elasticsearch/xpack/monitoring}/agent/resolver/node/NodeStatsResolverTests.java (92%) rename elasticsearch/x-pack/{marvel/src/test/java/org/elasticsearch/marvel => monitoring/src/test/java/org/elasticsearch/xpack/monitoring}/agent/resolver/node/NodeStatsTests.java (84%) rename elasticsearch/x-pack/{marvel/src/test/java/org/elasticsearch/marvel => monitoring/src/test/java/org/elasticsearch/xpack/monitoring}/agent/resolver/shards/ShardsResolverTests.java (90%) rename elasticsearch/x-pack/{marvel/src/test/java/org/elasticsearch/marvel => monitoring/src/test/java/org/elasticsearch/xpack/monitoring}/agent/resolver/shards/ShardsTests.java (85%) rename elasticsearch/x-pack/{marvel/src/test/java/org/elasticsearch/marvel/agent/settings/MarvelSettingsTests.java => monitoring/src/test/java/org/elasticsearch/xpack/monitoring/agent/settings/MonitoringSettingsTests.java} (93%) rename elasticsearch/x-pack/{marvel/src/test/java/org/elasticsearch/marvel => monitoring/src/test/java/org/elasticsearch/xpack/monitoring}/cleaner/AbstractIndicesCleanerTestCase.java (90%) rename elasticsearch/x-pack/{marvel/src/test/java/org/elasticsearch/marvel => monitoring/src/test/java/org/elasticsearch/xpack/monitoring}/cleaner/CleanerServiceTests.java (97%) rename elasticsearch/x-pack/{marvel/src/test/java/org/elasticsearch/marvel => monitoring/src/test/java/org/elasticsearch/xpack/monitoring}/cleaner/local/LocalIndicesCleanerTests.java (90%) rename elasticsearch/x-pack/{marvel/src/test/java/org/elasticsearch/marvel => monitoring/src/test/java/org/elasticsearch/xpack/monitoring}/license/LicenseIntegrationTests.java (95%) rename elasticsearch/x-pack/{marvel/src/test/java/org/elasticsearch/marvel/license/MarvelLicenseeTests.java => monitoring/src/test/java/org/elasticsearch/xpack/monitoring/license/MonitoringLicenseeTests.java} (96%) rename elasticsearch/x-pack/{marvel/src/test/java/org/elasticsearch/marvel/security/MarvelInternalClientTests.java => monitoring/src/test/java/org/elasticsearch/xpack/monitoring/security/MonitoringInternalClientTests.java} (93%) rename elasticsearch/x-pack/{marvel/src/test/java/org/elasticsearch/marvel/security/MarvelSettingsFilterTests.java => monitoring/src/test/java/org/elasticsearch/xpack/monitoring/security/MonitoringSettingsFilterTests.java} (93%) rename elasticsearch/x-pack/{marvel/src/test/java/org/elasticsearch/marvel => monitoring/src/test/java/org/elasticsearch/xpack/monitoring}/support/VersionUtilsTests.java (97%) rename elasticsearch/x-pack/{marvel/src/test/java/org/elasticsearch/marvel/test/MarvelIntegTestCase.java => monitoring/src/test/java/org/elasticsearch/xpack/monitoring/test/MonitoringIntegTestCase.java} (93%) rename elasticsearch/x-pack/{marvel => monitoring}/src/test/resources/log4j.properties (85%) rename elasticsearch/x-pack/{marvel => monitoring}/src/test/resources/monitoring-test.json (100%) rename elasticsearch/x-pack/{marvel => monitoring}/src/test/resources/rest-api-spec/api/xpack.monitoring.bulk.json (89%) rename elasticsearch/x-pack/{marvel => monitoring}/src/test/resources/rest-api-spec/test/monitoring/bulk/10_basic.yaml (100%) diff --git a/elasticsearch/qa/smoke-test-plugins-ssl/build.gradle b/elasticsearch/qa/smoke-test-plugins-ssl/build.gradle index 05fc100d3f9..e2c6ace1b8b 100644 --- a/elasticsearch/qa/smoke-test-plugins-ssl/build.gradle +++ b/elasticsearch/qa/smoke-test-plugins-ssl/build.gradle @@ -174,7 +174,7 @@ integTest { setupCommand 'setupTestUser', 'bin/x-pack/users', 'useradd', 'test_user', '-p', 'changeme', '-r', 'superuser' - setupCommand 'setupMarvelUser', + setupCommand 'setupMonitoringUser', 'bin/x-pack/users', 'useradd', 'monitoring_agent', '-p', 'changeme', '-r', 'remote_monitoring_agent' // Required to detect that the monitoring agent service has started diff --git a/elasticsearch/x-pack/build.gradle b/elasticsearch/x-pack/build.gradle index 391172ce60b..05e30057874 100644 --- a/elasticsearch/x-pack/build.gradle +++ b/elasticsearch/x-pack/build.gradle @@ -57,7 +57,7 @@ dependencies { // we keep the source directories in the original structure of split plugins, // in order to facilitate backports to 2.x. TODO: remove after 5.0 release -for (String module : ['', 'license-plugin/', 'security/', 'watcher/', 'marvel/', 'graph/']) { +for (String module : ['', 'license-plugin/', 'security/', 'watcher/', 'monitoring/', 'graph/']) { sourceSets { main { java.srcDir("${module}src/main/java") diff --git a/elasticsearch/x-pack/graph/src/test/java/org/elasticsearch/xpack/graph/test/GraphTests.java b/elasticsearch/x-pack/graph/src/test/java/org/elasticsearch/xpack/graph/test/GraphTests.java index 26c7e77394d..a4ad8cdb434 100644 --- a/elasticsearch/x-pack/graph/src/test/java/org/elasticsearch/xpack/graph/test/GraphTests.java +++ b/elasticsearch/x-pack/graph/src/test/java/org/elasticsearch/xpack/graph/test/GraphTests.java @@ -13,14 +13,13 @@ import org.elasticsearch.common.settings.Settings.Builder; import org.elasticsearch.common.unit.TimeValue; import org.elasticsearch.index.query.QueryBuilders; import org.elasticsearch.index.query.ScriptQueryBuilder; -import org.elasticsearch.marvel.Monitoring; +import org.elasticsearch.xpack.monitoring.Monitoring; import org.elasticsearch.plugins.Plugin; import org.elasticsearch.plugins.ScriptPlugin; import org.elasticsearch.script.AbstractSearchScript; import org.elasticsearch.script.ExecutableScript; import org.elasticsearch.script.NativeScriptFactory; import org.elasticsearch.script.Script; -import org.elasticsearch.script.ScriptModule; import org.elasticsearch.script.ScriptService.ScriptType; import org.elasticsearch.xpack.security.Security; import org.elasticsearch.test.ESSingleNodeTestCase; diff --git a/elasticsearch/x-pack/license-plugin/src/test/java/org/elasticsearch/license/plugin/AbstractLicensesIntegrationTestCase.java b/elasticsearch/x-pack/license-plugin/src/test/java/org/elasticsearch/license/plugin/AbstractLicensesIntegrationTestCase.java index e3758326bd5..76b6f8055dd 100644 --- a/elasticsearch/x-pack/license-plugin/src/test/java/org/elasticsearch/license/plugin/AbstractLicensesIntegrationTestCase.java +++ b/elasticsearch/x-pack/license-plugin/src/test/java/org/elasticsearch/license/plugin/AbstractLicensesIntegrationTestCase.java @@ -23,7 +23,7 @@ import org.elasticsearch.license.plugin.core.LicenseState; import org.elasticsearch.license.plugin.core.LicensesManagerService; import org.elasticsearch.license.plugin.core.LicensesMetaData; import org.elasticsearch.license.plugin.core.LicensesStatus; -import org.elasticsearch.marvel.Monitoring; +import org.elasticsearch.xpack.monitoring.Monitoring; import org.elasticsearch.plugins.Plugin; import org.elasticsearch.xpack.security.Security; import org.elasticsearch.test.ESIntegTestCase; diff --git a/elasticsearch/x-pack/license-plugin/src/test/java/org/elasticsearch/license/plugin/LicensesTransportTests.java b/elasticsearch/x-pack/license-plugin/src/test/java/org/elasticsearch/license/plugin/LicensesTransportTests.java index 77d76020f88..997e14062a7 100644 --- a/elasticsearch/x-pack/license-plugin/src/test/java/org/elasticsearch/license/plugin/LicensesTransportTests.java +++ b/elasticsearch/x-pack/license-plugin/src/test/java/org/elasticsearch/license/plugin/LicensesTransportTests.java @@ -19,7 +19,7 @@ import org.elasticsearch.license.plugin.action.put.PutLicenseAction; import org.elasticsearch.license.plugin.action.put.PutLicenseRequestBuilder; import org.elasticsearch.license.plugin.action.put.PutLicenseResponse; import org.elasticsearch.license.plugin.core.LicensesStatus; -import org.elasticsearch.marvel.Monitoring; +import org.elasticsearch.xpack.monitoring.Monitoring; import org.elasticsearch.node.Node; import org.elasticsearch.plugins.Plugin; import org.elasticsearch.xpack.security.Security; diff --git a/elasticsearch/x-pack/license-plugin/src/test/java/org/elasticsearch/xpack/TribeTransportTestCase.java b/elasticsearch/x-pack/license-plugin/src/test/java/org/elasticsearch/xpack/TribeTransportTestCase.java index 9cb295c296c..962ca7f5e37 100644 --- a/elasticsearch/x-pack/license-plugin/src/test/java/org/elasticsearch/xpack/TribeTransportTestCase.java +++ b/elasticsearch/x-pack/license-plugin/src/test/java/org/elasticsearch/xpack/TribeTransportTestCase.java @@ -20,7 +20,7 @@ import org.elasticsearch.common.network.NetworkModule; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.transport.TransportAddress; import org.elasticsearch.discovery.zen.ping.unicast.UnicastZenPing; -import org.elasticsearch.marvel.Monitoring; +import org.elasticsearch.xpack.monitoring.Monitoring; import org.elasticsearch.node.Node; import org.elasticsearch.plugins.Plugin; import org.elasticsearch.xpack.security.Security; diff --git a/elasticsearch/x-pack/marvel/src/main/java/org/elasticsearch/marvel/MonitoredSystem.java b/elasticsearch/x-pack/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/MonitoredSystem.java similarity index 95% rename from elasticsearch/x-pack/marvel/src/main/java/org/elasticsearch/marvel/MonitoredSystem.java rename to elasticsearch/x-pack/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/MonitoredSystem.java index 45ddf37802f..227c63d84b7 100644 --- a/elasticsearch/x-pack/marvel/src/main/java/org/elasticsearch/marvel/MonitoredSystem.java +++ b/elasticsearch/x-pack/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/MonitoredSystem.java @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.marvel; +package org.elasticsearch.xpack.monitoring; import java.util.Locale; diff --git a/elasticsearch/x-pack/marvel/src/main/java/org/elasticsearch/marvel/Monitoring.java b/elasticsearch/x-pack/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/Monitoring.java similarity index 83% rename from elasticsearch/x-pack/marvel/src/main/java/org/elasticsearch/marvel/Monitoring.java rename to elasticsearch/x-pack/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/Monitoring.java index cf8ccd6fdbe..3ca63653af9 100644 --- a/elasticsearch/x-pack/marvel/src/main/java/org/elasticsearch/marvel/Monitoring.java +++ b/elasticsearch/x-pack/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/Monitoring.java @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.marvel; +package org.elasticsearch.xpack.monitoring; import org.elasticsearch.action.ActionRequest; import org.elasticsearch.action.ActionResponse; @@ -11,14 +11,15 @@ import org.elasticsearch.common.component.LifecycleComponent; import org.elasticsearch.common.inject.Module; import org.elasticsearch.common.network.NetworkModule; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.marvel.action.MonitoringBulkAction; -import org.elasticsearch.marvel.action.TransportMonitoringBulkAction; -import org.elasticsearch.marvel.agent.AgentService; -import org.elasticsearch.marvel.agent.collector.CollectorModule; -import org.elasticsearch.marvel.agent.exporter.ExporterModule; -import org.elasticsearch.marvel.cleaner.CleanerService; -import org.elasticsearch.marvel.client.MonitoringClientModule; -import org.elasticsearch.marvel.rest.action.RestMonitoringBulkAction; +import org.elasticsearch.xpack.XPackPlugin; +import org.elasticsearch.xpack.monitoring.action.MonitoringBulkAction; +import org.elasticsearch.xpack.monitoring.action.TransportMonitoringBulkAction; +import org.elasticsearch.xpack.monitoring.agent.AgentService; +import org.elasticsearch.xpack.monitoring.agent.collector.CollectorModule; +import org.elasticsearch.xpack.monitoring.agent.exporter.ExporterModule; +import org.elasticsearch.xpack.monitoring.cleaner.CleanerService; +import org.elasticsearch.xpack.monitoring.client.MonitoringClientModule; +import org.elasticsearch.xpack.monitoring.rest.action.RestMonitoringBulkAction; import org.elasticsearch.plugins.ActionPlugin; import org.elasticsearch.xpack.XPackPlugin; diff --git a/elasticsearch/x-pack/marvel/src/main/java/org/elasticsearch/marvel/MonitoringFeatureSet.java b/elasticsearch/x-pack/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/MonitoringFeatureSet.java similarity index 95% rename from elasticsearch/x-pack/marvel/src/main/java/org/elasticsearch/marvel/MonitoringFeatureSet.java rename to elasticsearch/x-pack/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/MonitoringFeatureSet.java index c28118df0dd..717c40dbb02 100644 --- a/elasticsearch/x-pack/marvel/src/main/java/org/elasticsearch/marvel/MonitoringFeatureSet.java +++ b/elasticsearch/x-pack/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/MonitoringFeatureSet.java @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.marvel; +package org.elasticsearch.xpack.monitoring; import org.elasticsearch.common.Nullable; import org.elasticsearch.common.inject.Inject; @@ -12,9 +12,9 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.marvel.agent.exporter.Exporter; -import org.elasticsearch.marvel.agent.exporter.Exporters; import org.elasticsearch.xpack.XPackFeatureSet; +import org.elasticsearch.xpack.monitoring.agent.exporter.Exporter; +import org.elasticsearch.xpack.monitoring.agent.exporter.Exporters; import java.io.IOException; import java.util.HashMap; diff --git a/elasticsearch/x-pack/marvel/src/main/java/org/elasticsearch/marvel/MonitoringLicensee.java b/elasticsearch/x-pack/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/MonitoringLicensee.java similarity index 97% rename from elasticsearch/x-pack/marvel/src/main/java/org/elasticsearch/marvel/MonitoringLicensee.java rename to elasticsearch/x-pack/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/MonitoringLicensee.java index f63ff611b16..058bff4c18c 100644 --- a/elasticsearch/x-pack/marvel/src/main/java/org/elasticsearch/marvel/MonitoringLicensee.java +++ b/elasticsearch/x-pack/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/MonitoringLicensee.java @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.marvel; +package org.elasticsearch.xpack.monitoring; import org.elasticsearch.common.Strings; import org.elasticsearch.common.inject.Inject; @@ -17,7 +17,7 @@ import org.elasticsearch.license.plugin.core.Licensee; import org.elasticsearch.license.plugin.core.LicenseeRegistry; /** - * {@code MarvelLicensee} determines whether certain features of Monitoring are enabled or disabled. + * {@code MonitoringLicensee} determines whether certain features of Monitoring are enabled or disabled. *

* Once the license expires, the agent will stop: *

    diff --git a/elasticsearch/x-pack/marvel/src/main/java/org/elasticsearch/marvel/MonitoringModule.java b/elasticsearch/x-pack/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/MonitoringModule.java similarity index 87% rename from elasticsearch/x-pack/marvel/src/main/java/org/elasticsearch/marvel/MonitoringModule.java rename to elasticsearch/x-pack/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/MonitoringModule.java index 6bf0f453c99..7234cfa8fe1 100644 --- a/elasticsearch/x-pack/marvel/src/main/java/org/elasticsearch/marvel/MonitoringModule.java +++ b/elasticsearch/x-pack/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/MonitoringModule.java @@ -3,13 +3,13 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.marvel; +package org.elasticsearch.xpack.monitoring; import org.elasticsearch.common.inject.AbstractModule; import org.elasticsearch.common.inject.util.Providers; -import org.elasticsearch.marvel.agent.AgentService; -import org.elasticsearch.marvel.cleaner.CleanerService; import org.elasticsearch.xpack.XPackPlugin; +import org.elasticsearch.xpack.monitoring.agent.AgentService; +import org.elasticsearch.xpack.monitoring.cleaner.CleanerService; public class MonitoringModule extends AbstractModule { diff --git a/elasticsearch/x-pack/marvel/src/main/java/org/elasticsearch/marvel/MonitoringSettings.java b/elasticsearch/x-pack/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/MonitoringSettings.java similarity index 98% rename from elasticsearch/x-pack/marvel/src/main/java/org/elasticsearch/marvel/MonitoringSettings.java rename to elasticsearch/x-pack/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/MonitoringSettings.java index 714f4c9c9ae..806070b2072 100644 --- a/elasticsearch/x-pack/marvel/src/main/java/org/elasticsearch/marvel/MonitoringSettings.java +++ b/elasticsearch/x-pack/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/MonitoringSettings.java @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.marvel; +package org.elasticsearch.xpack.monitoring; import org.elasticsearch.common.Booleans; import org.elasticsearch.common.component.AbstractComponent; @@ -11,7 +11,6 @@ import org.elasticsearch.common.inject.Inject; import org.elasticsearch.common.settings.ClusterSettings; import org.elasticsearch.common.settings.Setting; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.settings.SettingsModule; import org.elasticsearch.common.unit.TimeValue; import org.elasticsearch.xpack.XPackPlugin; @@ -43,7 +42,7 @@ public class MonitoringSettings extends AbstractComponent { public static final Setting ENABLED = new Setting<>(XPackPlugin.featureEnabledSetting(Monitoring.NAME), - // By default, marvel is disabled on tribe nodes + // By default, monitoring is disabled on tribe nodes (s) -> String.valueOf(!XPackPlugin.isTribeNode(s) && !XPackPlugin.isTribeClientNode(s)), Booleans::parseBooleanExact, diff --git a/elasticsearch/x-pack/marvel/src/main/java/org/elasticsearch/marvel/action/MonitoringBulkAction.java b/elasticsearch/x-pack/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/action/MonitoringBulkAction.java similarity index 95% rename from elasticsearch/x-pack/marvel/src/main/java/org/elasticsearch/marvel/action/MonitoringBulkAction.java rename to elasticsearch/x-pack/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/action/MonitoringBulkAction.java index c0a8f005122..13d2c4498be 100644 --- a/elasticsearch/x-pack/marvel/src/main/java/org/elasticsearch/marvel/action/MonitoringBulkAction.java +++ b/elasticsearch/x-pack/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/action/MonitoringBulkAction.java @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.marvel.action; +package org.elasticsearch.xpack.monitoring.action; import org.elasticsearch.action.Action; import org.elasticsearch.client.ElasticsearchClient; diff --git a/elasticsearch/x-pack/marvel/src/main/java/org/elasticsearch/marvel/action/MonitoringBulkDoc.java b/elasticsearch/x-pack/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/action/MonitoringBulkDoc.java similarity index 94% rename from elasticsearch/x-pack/marvel/src/main/java/org/elasticsearch/marvel/action/MonitoringBulkDoc.java rename to elasticsearch/x-pack/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/action/MonitoringBulkDoc.java index 3a27ac8663d..73cdc2ad795 100644 --- a/elasticsearch/x-pack/marvel/src/main/java/org/elasticsearch/marvel/action/MonitoringBulkDoc.java +++ b/elasticsearch/x-pack/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/action/MonitoringBulkDoc.java @@ -3,12 +3,12 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.marvel.action; +package org.elasticsearch.xpack.monitoring.action; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.marvel.agent.exporter.MonitoringDoc; +import org.elasticsearch.xpack.monitoring.agent.exporter.MonitoringDoc; import java.io.IOException; diff --git a/elasticsearch/x-pack/marvel/src/main/java/org/elasticsearch/marvel/action/MonitoringBulkRequest.java b/elasticsearch/x-pack/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/action/MonitoringBulkRequest.java similarity index 96% rename from elasticsearch/x-pack/marvel/src/main/java/org/elasticsearch/marvel/action/MonitoringBulkRequest.java rename to elasticsearch/x-pack/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/action/MonitoringBulkRequest.java index d113efaf1e0..cb09ad5b301 100644 --- a/elasticsearch/x-pack/marvel/src/main/java/org/elasticsearch/marvel/action/MonitoringBulkRequest.java +++ b/elasticsearch/x-pack/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/action/MonitoringBulkRequest.java @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.marvel.action; +package org.elasticsearch.xpack.monitoring.action; import org.elasticsearch.action.ActionRequest; import org.elasticsearch.action.ActionRequestValidationException; @@ -29,7 +29,7 @@ import static org.elasticsearch.action.ValidateActions.addValidationError; * Every monitoring document added to the request is associated to a monitoring system id and version. If this {id, version} pair is * supported by the monitoring plugin, the monitoring documents will be indexed in a single batch using a normal bulk request. *

    - * The monitoring {id, version} pair is used by {org.elasticsearch.marvel.agent.resolver.MonitoringIndexNameResolver} to resolve the index, + * The monitoring {id, version} pair is used by MonitoringIndexNameResolver to resolve the index, * type and id of the final document to be indexed. A {@link MonitoringBulkDoc} can also hold its own index/type/id values but there's no * guarantee that these information will be effectively used. */ diff --git a/elasticsearch/x-pack/marvel/src/main/java/org/elasticsearch/marvel/action/MonitoringBulkRequestBuilder.java b/elasticsearch/x-pack/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/action/MonitoringBulkRequestBuilder.java similarity index 95% rename from elasticsearch/x-pack/marvel/src/main/java/org/elasticsearch/marvel/action/MonitoringBulkRequestBuilder.java rename to elasticsearch/x-pack/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/action/MonitoringBulkRequestBuilder.java index edbe3837030..bdcd31f90c3 100644 --- a/elasticsearch/x-pack/marvel/src/main/java/org/elasticsearch/marvel/action/MonitoringBulkRequestBuilder.java +++ b/elasticsearch/x-pack/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/action/MonitoringBulkRequestBuilder.java @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.marvel.action; +package org.elasticsearch.xpack.monitoring.action; import org.elasticsearch.action.ActionRequestBuilder; import org.elasticsearch.client.ElasticsearchClient; diff --git a/elasticsearch/x-pack/marvel/src/main/java/org/elasticsearch/marvel/action/MonitoringBulkResponse.java b/elasticsearch/x-pack/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/action/MonitoringBulkResponse.java similarity index 98% rename from elasticsearch/x-pack/marvel/src/main/java/org/elasticsearch/marvel/action/MonitoringBulkResponse.java rename to elasticsearch/x-pack/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/action/MonitoringBulkResponse.java index 341e41408fc..cd3ca7e9275 100644 --- a/elasticsearch/x-pack/marvel/src/main/java/org/elasticsearch/marvel/action/MonitoringBulkResponse.java +++ b/elasticsearch/x-pack/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/action/MonitoringBulkResponse.java @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.marvel.action; +package org.elasticsearch.xpack.monitoring.action; import org.elasticsearch.ElasticsearchException; import org.elasticsearch.ExceptionsHelper; diff --git a/elasticsearch/x-pack/marvel/src/main/java/org/elasticsearch/marvel/action/MonitoringIndex.java b/elasticsearch/x-pack/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/action/MonitoringIndex.java similarity index 97% rename from elasticsearch/x-pack/marvel/src/main/java/org/elasticsearch/marvel/action/MonitoringIndex.java rename to elasticsearch/x-pack/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/action/MonitoringIndex.java index ce156bc2139..690678994ed 100644 --- a/elasticsearch/x-pack/marvel/src/main/java/org/elasticsearch/marvel/action/MonitoringIndex.java +++ b/elasticsearch/x-pack/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/action/MonitoringIndex.java @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.marvel.action; +package org.elasticsearch.xpack.monitoring.action; import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.stream.StreamInput; diff --git a/elasticsearch/x-pack/marvel/src/main/java/org/elasticsearch/marvel/action/TransportMonitoringBulkAction.java b/elasticsearch/x-pack/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/action/TransportMonitoringBulkAction.java similarity index 96% rename from elasticsearch/x-pack/marvel/src/main/java/org/elasticsearch/marvel/action/TransportMonitoringBulkAction.java rename to elasticsearch/x-pack/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/action/TransportMonitoringBulkAction.java index 56e95d2c574..6c0a83b8a3e 100644 --- a/elasticsearch/x-pack/marvel/src/main/java/org/elasticsearch/marvel/action/TransportMonitoringBulkAction.java +++ b/elasticsearch/x-pack/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/action/TransportMonitoringBulkAction.java @@ -3,22 +3,22 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.marvel.action; +package org.elasticsearch.xpack.monitoring.action; import org.elasticsearch.action.ActionListener; import org.elasticsearch.action.support.ActionFilters; import org.elasticsearch.action.support.HandledTransportAction; -import org.elasticsearch.cluster.service.ClusterService; import org.elasticsearch.cluster.block.ClusterBlockLevel; import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver; import org.elasticsearch.cluster.node.DiscoveryNode; +import org.elasticsearch.cluster.service.ClusterService; import org.elasticsearch.common.inject.Inject; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.util.concurrent.AbstractRunnable; -import org.elasticsearch.marvel.agent.exporter.Exporters; -import org.elasticsearch.marvel.agent.exporter.MonitoringDoc; import org.elasticsearch.threadpool.ThreadPool; import org.elasticsearch.transport.TransportService; +import org.elasticsearch.xpack.monitoring.agent.exporter.Exporters; +import org.elasticsearch.xpack.monitoring.agent.exporter.MonitoringDoc; import java.util.Collection; import java.util.concurrent.TimeUnit; diff --git a/elasticsearch/x-pack/marvel/src/main/java/org/elasticsearch/marvel/agent/AgentService.java b/elasticsearch/x-pack/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/agent/AgentService.java similarity index 93% rename from elasticsearch/x-pack/marvel/src/main/java/org/elasticsearch/marvel/agent/AgentService.java rename to elasticsearch/x-pack/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/agent/AgentService.java index aeea9b229e7..0690964276e 100644 --- a/elasticsearch/x-pack/marvel/src/main/java/org/elasticsearch/marvel/agent/AgentService.java +++ b/elasticsearch/x-pack/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/agent/AgentService.java @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.marvel.agent; +package org.elasticsearch.xpack.monitoring.agent; import org.elasticsearch.common.Strings; import org.elasticsearch.common.component.AbstractLifecycleComponent; @@ -16,13 +16,13 @@ import org.elasticsearch.common.unit.TimeValue; import org.elasticsearch.common.util.CollectionUtils; import org.elasticsearch.common.util.concurrent.EsExecutors; import org.elasticsearch.common.util.concurrent.ReleasableLock; -import org.elasticsearch.marvel.MonitoringSettings; -import org.elasticsearch.marvel.agent.collector.Collector; -import org.elasticsearch.marvel.agent.collector.cluster.ClusterStatsCollector; -import org.elasticsearch.marvel.agent.exporter.ExportException; -import org.elasticsearch.marvel.agent.exporter.Exporter; -import org.elasticsearch.marvel.agent.exporter.Exporters; -import org.elasticsearch.marvel.agent.exporter.MonitoringDoc; +import org.elasticsearch.xpack.monitoring.MonitoringSettings; +import org.elasticsearch.xpack.monitoring.agent.collector.Collector; +import org.elasticsearch.xpack.monitoring.agent.collector.cluster.ClusterStatsCollector; +import org.elasticsearch.xpack.monitoring.agent.exporter.ExportException; +import org.elasticsearch.xpack.monitoring.agent.exporter.Exporter; +import org.elasticsearch.xpack.monitoring.agent.exporter.Exporters; +import org.elasticsearch.xpack.monitoring.agent.exporter.MonitoringDoc; import java.util.ArrayList; import java.util.Collection; diff --git a/elasticsearch/x-pack/marvel/src/main/java/org/elasticsearch/marvel/agent/collector/AbstractCollector.java b/elasticsearch/x-pack/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/agent/collector/AbstractCollector.java similarity index 91% rename from elasticsearch/x-pack/marvel/src/main/java/org/elasticsearch/marvel/agent/collector/AbstractCollector.java rename to elasticsearch/x-pack/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/agent/collector/AbstractCollector.java index bbed7bf34c5..5ccd1a3233e 100644 --- a/elasticsearch/x-pack/marvel/src/main/java/org/elasticsearch/marvel/agent/collector/AbstractCollector.java +++ b/elasticsearch/x-pack/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/agent/collector/AbstractCollector.java @@ -3,19 +3,19 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.marvel.agent.collector; +package org.elasticsearch.xpack.monitoring.agent.collector; import org.elasticsearch.ElasticsearchTimeoutException; import org.elasticsearch.Version; -import org.elasticsearch.cluster.service.ClusterService; import org.elasticsearch.cluster.node.DiscoveryNode; +import org.elasticsearch.cluster.service.ClusterService; import org.elasticsearch.common.component.AbstractLifecycleComponent; import org.elasticsearch.common.inject.Inject; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.marvel.MonitoringSettings; -import org.elasticsearch.marvel.MonitoredSystem; -import org.elasticsearch.marvel.agent.exporter.MonitoringDoc; -import org.elasticsearch.marvel.MonitoringLicensee; +import org.elasticsearch.xpack.monitoring.MonitoredSystem; +import org.elasticsearch.xpack.monitoring.MonitoringLicensee; +import org.elasticsearch.xpack.monitoring.MonitoringSettings; +import org.elasticsearch.xpack.monitoring.agent.exporter.MonitoringDoc; import java.util.Collection; diff --git a/elasticsearch/x-pack/marvel/src/main/java/org/elasticsearch/marvel/agent/collector/Collector.java b/elasticsearch/x-pack/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/agent/collector/Collector.java similarity index 77% rename from elasticsearch/x-pack/marvel/src/main/java/org/elasticsearch/marvel/agent/collector/Collector.java rename to elasticsearch/x-pack/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/agent/collector/Collector.java index 21621ade7c8..481a79aac8c 100644 --- a/elasticsearch/x-pack/marvel/src/main/java/org/elasticsearch/marvel/agent/collector/Collector.java +++ b/elasticsearch/x-pack/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/agent/collector/Collector.java @@ -3,10 +3,10 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.marvel.agent.collector; +package org.elasticsearch.xpack.monitoring.agent.collector; import org.elasticsearch.common.component.LifecycleComponent; -import org.elasticsearch.marvel.agent.exporter.MonitoringDoc; +import org.elasticsearch.xpack.monitoring.agent.exporter.MonitoringDoc; import java.util.Collection; diff --git a/elasticsearch/x-pack/marvel/src/main/java/org/elasticsearch/marvel/agent/collector/CollectorModule.java b/elasticsearch/x-pack/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/agent/collector/CollectorModule.java similarity index 68% rename from elasticsearch/x-pack/marvel/src/main/java/org/elasticsearch/marvel/agent/collector/CollectorModule.java rename to elasticsearch/x-pack/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/agent/collector/CollectorModule.java index 133e76a0ed7..baa7a13bdad 100644 --- a/elasticsearch/x-pack/marvel/src/main/java/org/elasticsearch/marvel/agent/collector/CollectorModule.java +++ b/elasticsearch/x-pack/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/agent/collector/CollectorModule.java @@ -3,17 +3,17 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.marvel.agent.collector; +package org.elasticsearch.xpack.monitoring.agent.collector; import org.elasticsearch.common.inject.AbstractModule; import org.elasticsearch.common.inject.multibindings.Multibinder; -import org.elasticsearch.marvel.agent.collector.cluster.ClusterStateCollector; -import org.elasticsearch.marvel.agent.collector.cluster.ClusterStatsCollector; -import org.elasticsearch.marvel.agent.collector.indices.IndexRecoveryCollector; -import org.elasticsearch.marvel.agent.collector.indices.IndexStatsCollector; -import org.elasticsearch.marvel.agent.collector.indices.IndicesStatsCollector; -import org.elasticsearch.marvel.agent.collector.node.NodeStatsCollector; -import org.elasticsearch.marvel.agent.collector.shards.ShardsCollector; +import org.elasticsearch.xpack.monitoring.agent.collector.cluster.ClusterStateCollector; +import org.elasticsearch.xpack.monitoring.agent.collector.cluster.ClusterStatsCollector; +import org.elasticsearch.xpack.monitoring.agent.collector.indices.IndexRecoveryCollector; +import org.elasticsearch.xpack.monitoring.agent.collector.indices.IndexStatsCollector; +import org.elasticsearch.xpack.monitoring.agent.collector.indices.IndicesStatsCollector; +import org.elasticsearch.xpack.monitoring.agent.collector.node.NodeStatsCollector; +import org.elasticsearch.xpack.monitoring.agent.collector.shards.ShardsCollector; import java.util.HashSet; import java.util.Set; diff --git a/elasticsearch/x-pack/marvel/src/main/java/org/elasticsearch/marvel/agent/collector/cluster/ClusterInfoMonitoringDoc.java b/elasticsearch/x-pack/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/agent/collector/cluster/ClusterInfoMonitoringDoc.java similarity index 90% rename from elasticsearch/x-pack/marvel/src/main/java/org/elasticsearch/marvel/agent/collector/cluster/ClusterInfoMonitoringDoc.java rename to elasticsearch/x-pack/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/agent/collector/cluster/ClusterInfoMonitoringDoc.java index 9fd1dbe79db..cd1c9d8aabc 100644 --- a/elasticsearch/x-pack/marvel/src/main/java/org/elasticsearch/marvel/agent/collector/cluster/ClusterInfoMonitoringDoc.java +++ b/elasticsearch/x-pack/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/agent/collector/cluster/ClusterInfoMonitoringDoc.java @@ -3,11 +3,11 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.marvel.agent.collector.cluster; +package org.elasticsearch.xpack.monitoring.agent.collector.cluster; import org.elasticsearch.action.admin.cluster.stats.ClusterStatsResponse; import org.elasticsearch.license.core.License; -import org.elasticsearch.marvel.agent.exporter.MonitoringDoc; +import org.elasticsearch.xpack.monitoring.agent.exporter.MonitoringDoc; public class ClusterInfoMonitoringDoc extends MonitoringDoc { diff --git a/elasticsearch/x-pack/marvel/src/main/java/org/elasticsearch/marvel/agent/collector/cluster/ClusterStateCollector.java b/elasticsearch/x-pack/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/agent/collector/cluster/ClusterStateCollector.java similarity index 87% rename from elasticsearch/x-pack/marvel/src/main/java/org/elasticsearch/marvel/agent/collector/cluster/ClusterStateCollector.java rename to elasticsearch/x-pack/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/agent/collector/cluster/ClusterStateCollector.java index 3c05ac1f3e3..f6106cbcf27 100644 --- a/elasticsearch/x-pack/marvel/src/main/java/org/elasticsearch/marvel/agent/collector/cluster/ClusterStateCollector.java +++ b/elasticsearch/x-pack/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/agent/collector/cluster/ClusterStateCollector.java @@ -3,20 +3,20 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.marvel.agent.collector.cluster; +package org.elasticsearch.xpack.monitoring.agent.collector.cluster; import org.elasticsearch.action.admin.cluster.health.ClusterHealthResponse; import org.elasticsearch.client.Client; -import org.elasticsearch.cluster.service.ClusterService; import org.elasticsearch.cluster.ClusterState; import org.elasticsearch.cluster.node.DiscoveryNode; import org.elasticsearch.cluster.node.DiscoveryNodes; +import org.elasticsearch.cluster.service.ClusterService; import org.elasticsearch.common.inject.Inject; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.marvel.MonitoringSettings; -import org.elasticsearch.marvel.agent.collector.AbstractCollector; -import org.elasticsearch.marvel.agent.exporter.MonitoringDoc; -import org.elasticsearch.marvel.MonitoringLicensee; +import org.elasticsearch.xpack.monitoring.MonitoringLicensee; +import org.elasticsearch.xpack.monitoring.MonitoringSettings; +import org.elasticsearch.xpack.monitoring.agent.collector.AbstractCollector; +import org.elasticsearch.xpack.monitoring.agent.exporter.MonitoringDoc; import org.elasticsearch.xpack.security.InternalClient; import java.util.ArrayList; @@ -72,7 +72,7 @@ public class ClusterStateCollector extends AbstractCollector { private final String index; public Data() { - this(MarvelTemplateUtils.TEMPLATE_VERSION); + this(MonitoringTemplateUtils.TEMPLATE_VERSION); } // Used in tests @@ -153,12 +153,12 @@ public abstract class MonitoringIndexNameResolver { @Override public String templateName() { - return String.format(Locale.ROOT, "%s-%s-%d", PREFIX, DATA, MarvelTemplateUtils.TEMPLATE_VERSION); + return String.format(Locale.ROOT, "%s-%s-%d", PREFIX, DATA, MonitoringTemplateUtils.TEMPLATE_VERSION); } @Override public String template() { - return MarvelTemplateUtils.loadTemplate(DATA); + return MonitoringTemplateUtils.loadTemplate(DATA); } } @@ -176,7 +176,7 @@ public abstract class MonitoringIndexNameResolver { private final String index; public Timestamped(MonitoredSystem system, Settings settings) { - this(system, settings, MarvelTemplateUtils.TEMPLATE_VERSION); + this(system, settings, MonitoringTemplateUtils.TEMPLATE_VERSION); } // Used in tests @@ -209,12 +209,12 @@ public abstract class MonitoringIndexNameResolver { @Override public String templateName() { - return String.format(Locale.ROOT, "%s-%s-%d", PREFIX, getId(), MarvelTemplateUtils.TEMPLATE_VERSION); + return String.format(Locale.ROOT, "%s-%s-%d", PREFIX, getId(), MonitoringTemplateUtils.TEMPLATE_VERSION); } @Override public String template() { - return MarvelTemplateUtils.loadTemplate(getId()); + return MonitoringTemplateUtils.loadTemplate(getId()); } String getId() { diff --git a/elasticsearch/x-pack/marvel/src/main/java/org/elasticsearch/marvel/agent/resolver/ResolversRegistry.java b/elasticsearch/x-pack/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/agent/resolver/ResolversRegistry.java similarity index 67% rename from elasticsearch/x-pack/marvel/src/main/java/org/elasticsearch/marvel/agent/resolver/ResolversRegistry.java rename to elasticsearch/x-pack/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/agent/resolver/ResolversRegistry.java index 5aadf12ecfc..64beb63eab1 100644 --- a/elasticsearch/x-pack/marvel/src/main/java/org/elasticsearch/marvel/agent/resolver/ResolversRegistry.java +++ b/elasticsearch/x-pack/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/agent/resolver/ResolversRegistry.java @@ -3,36 +3,36 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.marvel.agent.resolver; +package org.elasticsearch.xpack.monitoring.agent.resolver; import org.elasticsearch.Version; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.marvel.MonitoredSystem; -import org.elasticsearch.marvel.action.MonitoringBulkDoc; -import org.elasticsearch.marvel.action.MonitoringIndex; -import org.elasticsearch.marvel.agent.collector.cluster.ClusterInfoMonitoringDoc; -import org.elasticsearch.marvel.agent.collector.cluster.ClusterStateMonitoringDoc; -import org.elasticsearch.marvel.agent.collector.cluster.ClusterStateNodeMonitoringDoc; -import org.elasticsearch.marvel.agent.collector.cluster.ClusterStatsMonitoringDoc; -import org.elasticsearch.marvel.agent.collector.cluster.DiscoveryNodeMonitoringDoc; -import org.elasticsearch.marvel.agent.collector.indices.IndexRecoveryMonitoringDoc; -import org.elasticsearch.marvel.agent.collector.indices.IndexStatsMonitoringDoc; -import org.elasticsearch.marvel.agent.collector.indices.IndicesStatsMonitoringDoc; -import org.elasticsearch.marvel.agent.collector.node.NodeStatsMonitoringDoc; -import org.elasticsearch.marvel.agent.collector.shards.ShardMonitoringDoc; -import org.elasticsearch.marvel.agent.exporter.MonitoringDoc; -import org.elasticsearch.marvel.agent.resolver.bulk.MonitoringBulkDataResolver; -import org.elasticsearch.marvel.agent.resolver.bulk.MonitoringBulkTimestampedResolver; -import org.elasticsearch.marvel.agent.resolver.cluster.ClusterInfoResolver; -import org.elasticsearch.marvel.agent.resolver.cluster.ClusterStateNodeResolver; -import org.elasticsearch.marvel.agent.resolver.cluster.ClusterStateResolver; -import org.elasticsearch.marvel.agent.resolver.cluster.ClusterStatsResolver; -import org.elasticsearch.marvel.agent.resolver.cluster.DiscoveryNodeResolver; -import org.elasticsearch.marvel.agent.resolver.indices.IndexRecoveryResolver; -import org.elasticsearch.marvel.agent.resolver.indices.IndexStatsResolver; -import org.elasticsearch.marvel.agent.resolver.indices.IndicesStatsResolver; -import org.elasticsearch.marvel.agent.resolver.node.NodeStatsResolver; -import org.elasticsearch.marvel.agent.resolver.shards.ShardsResolver; +import org.elasticsearch.xpack.monitoring.MonitoredSystem; +import org.elasticsearch.xpack.monitoring.action.MonitoringBulkDoc; +import org.elasticsearch.xpack.monitoring.action.MonitoringIndex; +import org.elasticsearch.xpack.monitoring.agent.collector.cluster.ClusterInfoMonitoringDoc; +import org.elasticsearch.xpack.monitoring.agent.collector.cluster.ClusterStateMonitoringDoc; +import org.elasticsearch.xpack.monitoring.agent.collector.cluster.ClusterStateNodeMonitoringDoc; +import org.elasticsearch.xpack.monitoring.agent.collector.cluster.ClusterStatsMonitoringDoc; +import org.elasticsearch.xpack.monitoring.agent.collector.cluster.DiscoveryNodeMonitoringDoc; +import org.elasticsearch.xpack.monitoring.agent.collector.indices.IndexRecoveryMonitoringDoc; +import org.elasticsearch.xpack.monitoring.agent.collector.indices.IndexStatsMonitoringDoc; +import org.elasticsearch.xpack.monitoring.agent.collector.indices.IndicesStatsMonitoringDoc; +import org.elasticsearch.xpack.monitoring.agent.collector.node.NodeStatsMonitoringDoc; +import org.elasticsearch.xpack.monitoring.agent.collector.shards.ShardMonitoringDoc; +import org.elasticsearch.xpack.monitoring.agent.exporter.MonitoringDoc; +import org.elasticsearch.xpack.monitoring.agent.resolver.bulk.MonitoringBulkDataResolver; +import org.elasticsearch.xpack.monitoring.agent.resolver.bulk.MonitoringBulkTimestampedResolver; +import org.elasticsearch.xpack.monitoring.agent.resolver.cluster.ClusterInfoResolver; +import org.elasticsearch.xpack.monitoring.agent.resolver.cluster.ClusterStateNodeResolver; +import org.elasticsearch.xpack.monitoring.agent.resolver.cluster.ClusterStateResolver; +import org.elasticsearch.xpack.monitoring.agent.resolver.cluster.ClusterStatsResolver; +import org.elasticsearch.xpack.monitoring.agent.resolver.cluster.DiscoveryNodeResolver; +import org.elasticsearch.xpack.monitoring.agent.resolver.indices.IndexRecoveryResolver; +import org.elasticsearch.xpack.monitoring.agent.resolver.indices.IndexStatsResolver; +import org.elasticsearch.xpack.monitoring.agent.resolver.indices.IndicesStatsResolver; +import org.elasticsearch.xpack.monitoring.agent.resolver.node.NodeStatsResolver; +import org.elasticsearch.xpack.monitoring.agent.resolver.shards.ShardsResolver; import java.util.ArrayList; import java.util.Iterator; @@ -40,15 +40,13 @@ import java.util.List; import java.util.Objects; import java.util.function.Predicate; -import static org.elasticsearch.marvel.MonitoredSystem.ES; - public class ResolversRegistry implements Iterable { private final List registrations = new ArrayList<>(); public ResolversRegistry(Settings settings) { // register built-in defaults resolvers - registerBuiltIn(ES, settings); + registerBuiltIn(MonitoredSystem.ES, settings); // register resolvers for monitored systems registerMonitoredSystem(MonitoredSystem.KIBANA, settings); diff --git a/elasticsearch/x-pack/marvel/src/main/java/org/elasticsearch/marvel/agent/resolver/bulk/MonitoringBulkDataResolver.java b/elasticsearch/x-pack/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/agent/resolver/bulk/MonitoringBulkDataResolver.java similarity index 83% rename from elasticsearch/x-pack/marvel/src/main/java/org/elasticsearch/marvel/agent/resolver/bulk/MonitoringBulkDataResolver.java rename to elasticsearch/x-pack/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/agent/resolver/bulk/MonitoringBulkDataResolver.java index d93cdfa1a4f..df0ca40334f 100644 --- a/elasticsearch/x-pack/marvel/src/main/java/org/elasticsearch/marvel/agent/resolver/bulk/MonitoringBulkDataResolver.java +++ b/elasticsearch/x-pack/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/agent/resolver/bulk/MonitoringBulkDataResolver.java @@ -3,13 +3,13 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.marvel.agent.resolver.bulk; +package org.elasticsearch.xpack.monitoring.agent.resolver.bulk; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.xcontent.ToXContent; import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.marvel.action.MonitoringBulkDoc; -import org.elasticsearch.marvel.agent.resolver.MonitoringIndexNameResolver; +import org.elasticsearch.xpack.monitoring.action.MonitoringBulkDoc; +import org.elasticsearch.xpack.monitoring.agent.resolver.MonitoringIndexNameResolver; import java.io.IOException; diff --git a/elasticsearch/x-pack/marvel/src/main/java/org/elasticsearch/marvel/agent/resolver/bulk/MonitoringBulkTimestampedResolver.java b/elasticsearch/x-pack/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/agent/resolver/bulk/MonitoringBulkTimestampedResolver.java similarity index 80% rename from elasticsearch/x-pack/marvel/src/main/java/org/elasticsearch/marvel/agent/resolver/bulk/MonitoringBulkTimestampedResolver.java rename to elasticsearch/x-pack/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/agent/resolver/bulk/MonitoringBulkTimestampedResolver.java index 7af264fc2fb..25e0f3e77f5 100644 --- a/elasticsearch/x-pack/marvel/src/main/java/org/elasticsearch/marvel/agent/resolver/bulk/MonitoringBulkTimestampedResolver.java +++ b/elasticsearch/x-pack/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/agent/resolver/bulk/MonitoringBulkTimestampedResolver.java @@ -3,15 +3,15 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.marvel.agent.resolver.bulk; +package org.elasticsearch.xpack.monitoring.agent.resolver.bulk; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.xcontent.ToXContent; import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.marvel.MonitoredSystem; -import org.elasticsearch.marvel.action.MonitoringBulkDoc; -import org.elasticsearch.marvel.agent.resolver.MonitoringIndexNameResolver; +import org.elasticsearch.xpack.monitoring.MonitoredSystem; +import org.elasticsearch.xpack.monitoring.action.MonitoringBulkDoc; +import org.elasticsearch.xpack.monitoring.agent.resolver.MonitoringIndexNameResolver; import java.io.IOException; diff --git a/elasticsearch/x-pack/marvel/src/main/java/org/elasticsearch/marvel/agent/resolver/cluster/ClusterInfoResolver.java b/elasticsearch/x-pack/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/agent/resolver/cluster/ClusterInfoResolver.java similarity index 92% rename from elasticsearch/x-pack/marvel/src/main/java/org/elasticsearch/marvel/agent/resolver/cluster/ClusterInfoResolver.java rename to elasticsearch/x-pack/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/agent/resolver/cluster/ClusterInfoResolver.java index cab0a37cb88..d6c5e8cad3e 100644 --- a/elasticsearch/x-pack/marvel/src/main/java/org/elasticsearch/marvel/agent/resolver/cluster/ClusterInfoResolver.java +++ b/elasticsearch/x-pack/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/agent/resolver/cluster/ClusterInfoResolver.java @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.marvel.agent.resolver.cluster; +package org.elasticsearch.xpack.monitoring.agent.resolver.cluster; import org.elasticsearch.action.admin.cluster.stats.ClusterStatsResponse; import org.elasticsearch.common.collect.MapBuilder; @@ -11,8 +11,8 @@ import org.elasticsearch.common.hash.MessageDigests; import org.elasticsearch.common.xcontent.ToXContent; import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.license.core.License; -import org.elasticsearch.marvel.agent.collector.cluster.ClusterInfoMonitoringDoc; -import org.elasticsearch.marvel.agent.resolver.MonitoringIndexNameResolver; +import org.elasticsearch.xpack.monitoring.agent.collector.cluster.ClusterInfoMonitoringDoc; +import org.elasticsearch.xpack.monitoring.agent.resolver.MonitoringIndexNameResolver; import java.io.IOException; import java.nio.charset.StandardCharsets; diff --git a/elasticsearch/x-pack/marvel/src/main/java/org/elasticsearch/marvel/agent/resolver/cluster/ClusterStateNodeResolver.java b/elasticsearch/x-pack/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/agent/resolver/cluster/ClusterStateNodeResolver.java similarity index 81% rename from elasticsearch/x-pack/marvel/src/main/java/org/elasticsearch/marvel/agent/resolver/cluster/ClusterStateNodeResolver.java rename to elasticsearch/x-pack/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/agent/resolver/cluster/ClusterStateNodeResolver.java index 654fa10cc04..d04a7971526 100644 --- a/elasticsearch/x-pack/marvel/src/main/java/org/elasticsearch/marvel/agent/resolver/cluster/ClusterStateNodeResolver.java +++ b/elasticsearch/x-pack/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/agent/resolver/cluster/ClusterStateNodeResolver.java @@ -3,14 +3,14 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.marvel.agent.resolver.cluster; +package org.elasticsearch.xpack.monitoring.agent.resolver.cluster; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.xcontent.ToXContent; import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.marvel.MonitoredSystem; -import org.elasticsearch.marvel.agent.collector.cluster.ClusterStateNodeMonitoringDoc; -import org.elasticsearch.marvel.agent.resolver.MonitoringIndexNameResolver; +import org.elasticsearch.xpack.monitoring.MonitoredSystem; +import org.elasticsearch.xpack.monitoring.agent.collector.cluster.ClusterStateNodeMonitoringDoc; +import org.elasticsearch.xpack.monitoring.agent.resolver.MonitoringIndexNameResolver; import java.io.IOException; diff --git a/elasticsearch/x-pack/marvel/src/main/java/org/elasticsearch/marvel/agent/resolver/cluster/ClusterStateResolver.java b/elasticsearch/x-pack/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/agent/resolver/cluster/ClusterStateResolver.java similarity index 86% rename from elasticsearch/x-pack/marvel/src/main/java/org/elasticsearch/marvel/agent/resolver/cluster/ClusterStateResolver.java rename to elasticsearch/x-pack/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/agent/resolver/cluster/ClusterStateResolver.java index 72d9b6bffa3..8e9dbb56ece 100644 --- a/elasticsearch/x-pack/marvel/src/main/java/org/elasticsearch/marvel/agent/resolver/cluster/ClusterStateResolver.java +++ b/elasticsearch/x-pack/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/agent/resolver/cluster/ClusterStateResolver.java @@ -3,15 +3,15 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.marvel.agent.resolver.cluster; +package org.elasticsearch.xpack.monitoring.agent.resolver.cluster; import org.elasticsearch.cluster.ClusterState; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.xcontent.ToXContent; import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.marvel.MonitoredSystem; -import org.elasticsearch.marvel.agent.collector.cluster.ClusterStateMonitoringDoc; -import org.elasticsearch.marvel.agent.resolver.MonitoringIndexNameResolver; +import org.elasticsearch.xpack.monitoring.MonitoredSystem; +import org.elasticsearch.xpack.monitoring.agent.collector.cluster.ClusterStateMonitoringDoc; +import org.elasticsearch.xpack.monitoring.agent.resolver.MonitoringIndexNameResolver; import java.io.IOException; import java.util.Locale; diff --git a/elasticsearch/x-pack/marvel/src/main/java/org/elasticsearch/marvel/agent/resolver/cluster/ClusterStatsResolver.java b/elasticsearch/x-pack/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/agent/resolver/cluster/ClusterStatsResolver.java similarity index 88% rename from elasticsearch/x-pack/marvel/src/main/java/org/elasticsearch/marvel/agent/resolver/cluster/ClusterStatsResolver.java rename to elasticsearch/x-pack/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/agent/resolver/cluster/ClusterStatsResolver.java index 5828d863eef..328f1fed7dd 100644 --- a/elasticsearch/x-pack/marvel/src/main/java/org/elasticsearch/marvel/agent/resolver/cluster/ClusterStatsResolver.java +++ b/elasticsearch/x-pack/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/agent/resolver/cluster/ClusterStatsResolver.java @@ -3,15 +3,15 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.marvel.agent.resolver.cluster; +package org.elasticsearch.xpack.monitoring.agent.resolver.cluster; import org.elasticsearch.action.admin.cluster.stats.ClusterStatsResponse; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.xcontent.ToXContent; import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.marvel.MonitoredSystem; -import org.elasticsearch.marvel.agent.collector.cluster.ClusterStatsMonitoringDoc; -import org.elasticsearch.marvel.agent.resolver.MonitoringIndexNameResolver; +import org.elasticsearch.xpack.monitoring.MonitoredSystem; +import org.elasticsearch.xpack.monitoring.agent.collector.cluster.ClusterStatsMonitoringDoc; +import org.elasticsearch.xpack.monitoring.agent.resolver.MonitoringIndexNameResolver; import java.io.IOException; diff --git a/elasticsearch/x-pack/marvel/src/main/java/org/elasticsearch/marvel/agent/resolver/cluster/DiscoveryNodeResolver.java b/elasticsearch/x-pack/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/agent/resolver/cluster/DiscoveryNodeResolver.java similarity index 88% rename from elasticsearch/x-pack/marvel/src/main/java/org/elasticsearch/marvel/agent/resolver/cluster/DiscoveryNodeResolver.java rename to elasticsearch/x-pack/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/agent/resolver/cluster/DiscoveryNodeResolver.java index 81b458344f8..84c070d5e2b 100644 --- a/elasticsearch/x-pack/marvel/src/main/java/org/elasticsearch/marvel/agent/resolver/cluster/DiscoveryNodeResolver.java +++ b/elasticsearch/x-pack/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/agent/resolver/cluster/DiscoveryNodeResolver.java @@ -3,13 +3,13 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.marvel.agent.resolver.cluster; +package org.elasticsearch.xpack.monitoring.agent.resolver.cluster; import org.elasticsearch.cluster.node.DiscoveryNode; import org.elasticsearch.common.xcontent.ToXContent; import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.marvel.agent.collector.cluster.DiscoveryNodeMonitoringDoc; -import org.elasticsearch.marvel.agent.resolver.MonitoringIndexNameResolver; +import org.elasticsearch.xpack.monitoring.agent.collector.cluster.DiscoveryNodeMonitoringDoc; +import org.elasticsearch.xpack.monitoring.agent.resolver.MonitoringIndexNameResolver; import java.io.IOException; import java.util.Map; diff --git a/elasticsearch/x-pack/marvel/src/main/java/org/elasticsearch/marvel/agent/resolver/indices/IndexRecoveryResolver.java b/elasticsearch/x-pack/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/agent/resolver/indices/IndexRecoveryResolver.java similarity index 88% rename from elasticsearch/x-pack/marvel/src/main/java/org/elasticsearch/marvel/agent/resolver/indices/IndexRecoveryResolver.java rename to elasticsearch/x-pack/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/agent/resolver/indices/IndexRecoveryResolver.java index 48a818555a3..9cc4a08697b 100644 --- a/elasticsearch/x-pack/marvel/src/main/java/org/elasticsearch/marvel/agent/resolver/indices/IndexRecoveryResolver.java +++ b/elasticsearch/x-pack/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/agent/resolver/indices/IndexRecoveryResolver.java @@ -3,16 +3,16 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.marvel.agent.resolver.indices; +package org.elasticsearch.xpack.monitoring.agent.resolver.indices; import org.elasticsearch.action.admin.indices.recovery.RecoveryResponse; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.xcontent.ToXContent; import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.indices.recovery.RecoveryState; -import org.elasticsearch.marvel.MonitoredSystem; -import org.elasticsearch.marvel.agent.collector.indices.IndexRecoveryMonitoringDoc; -import org.elasticsearch.marvel.agent.resolver.MonitoringIndexNameResolver; +import org.elasticsearch.xpack.monitoring.MonitoredSystem; +import org.elasticsearch.xpack.monitoring.agent.collector.indices.IndexRecoveryMonitoringDoc; +import org.elasticsearch.xpack.monitoring.agent.resolver.MonitoringIndexNameResolver; import java.io.IOException; import java.util.List; diff --git a/elasticsearch/x-pack/marvel/src/main/java/org/elasticsearch/marvel/agent/resolver/indices/IndexStatsResolver.java b/elasticsearch/x-pack/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/agent/resolver/indices/IndexStatsResolver.java similarity index 94% rename from elasticsearch/x-pack/marvel/src/main/java/org/elasticsearch/marvel/agent/resolver/indices/IndexStatsResolver.java rename to elasticsearch/x-pack/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/agent/resolver/indices/IndexStatsResolver.java index 21b66c51924..9878ce1f0ee 100644 --- a/elasticsearch/x-pack/marvel/src/main/java/org/elasticsearch/marvel/agent/resolver/indices/IndexStatsResolver.java +++ b/elasticsearch/x-pack/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/agent/resolver/indices/IndexStatsResolver.java @@ -3,15 +3,15 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.marvel.agent.resolver.indices; +package org.elasticsearch.xpack.monitoring.agent.resolver.indices; import org.elasticsearch.action.admin.indices.stats.IndexStats; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.xcontent.ToXContent; import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.marvel.MonitoredSystem; -import org.elasticsearch.marvel.agent.collector.indices.IndexStatsMonitoringDoc; -import org.elasticsearch.marvel.agent.resolver.MonitoringIndexNameResolver; +import org.elasticsearch.xpack.monitoring.MonitoredSystem; +import org.elasticsearch.xpack.monitoring.agent.collector.indices.IndexStatsMonitoringDoc; +import org.elasticsearch.xpack.monitoring.agent.resolver.MonitoringIndexNameResolver; import java.io.IOException; diff --git a/elasticsearch/x-pack/marvel/src/main/java/org/elasticsearch/marvel/agent/resolver/indices/IndicesStatsResolver.java b/elasticsearch/x-pack/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/agent/resolver/indices/IndicesStatsResolver.java similarity index 89% rename from elasticsearch/x-pack/marvel/src/main/java/org/elasticsearch/marvel/agent/resolver/indices/IndicesStatsResolver.java rename to elasticsearch/x-pack/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/agent/resolver/indices/IndicesStatsResolver.java index 8a0b1024ea1..cb5249aa000 100644 --- a/elasticsearch/x-pack/marvel/src/main/java/org/elasticsearch/marvel/agent/resolver/indices/IndicesStatsResolver.java +++ b/elasticsearch/x-pack/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/agent/resolver/indices/IndicesStatsResolver.java @@ -3,15 +3,15 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.marvel.agent.resolver.indices; +package org.elasticsearch.xpack.monitoring.agent.resolver.indices; import org.elasticsearch.action.admin.indices.stats.IndicesStatsResponse; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.xcontent.ToXContent; import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.marvel.MonitoredSystem; -import org.elasticsearch.marvel.agent.collector.indices.IndicesStatsMonitoringDoc; -import org.elasticsearch.marvel.agent.resolver.MonitoringIndexNameResolver; +import org.elasticsearch.xpack.monitoring.MonitoredSystem; +import org.elasticsearch.xpack.monitoring.agent.collector.indices.IndicesStatsMonitoringDoc; +import org.elasticsearch.xpack.monitoring.agent.resolver.MonitoringIndexNameResolver; import java.io.IOException; diff --git a/elasticsearch/x-pack/marvel/src/main/java/org/elasticsearch/marvel/agent/resolver/node/NodeStatsResolver.java b/elasticsearch/x-pack/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/agent/resolver/node/NodeStatsResolver.java similarity index 95% rename from elasticsearch/x-pack/marvel/src/main/java/org/elasticsearch/marvel/agent/resolver/node/NodeStatsResolver.java rename to elasticsearch/x-pack/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/agent/resolver/node/NodeStatsResolver.java index 861d8764e43..7003c5f8b1a 100644 --- a/elasticsearch/x-pack/marvel/src/main/java/org/elasticsearch/marvel/agent/resolver/node/NodeStatsResolver.java +++ b/elasticsearch/x-pack/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/agent/resolver/node/NodeStatsResolver.java @@ -3,15 +3,15 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.marvel.agent.resolver.node; +package org.elasticsearch.xpack.monitoring.agent.resolver.node; import org.elasticsearch.action.admin.cluster.node.stats.NodeStats; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.xcontent.ToXContent; import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.marvel.MonitoredSystem; -import org.elasticsearch.marvel.agent.collector.node.NodeStatsMonitoringDoc; -import org.elasticsearch.marvel.agent.resolver.MonitoringIndexNameResolver; +import org.elasticsearch.xpack.monitoring.MonitoredSystem; +import org.elasticsearch.xpack.monitoring.agent.collector.node.NodeStatsMonitoringDoc; +import org.elasticsearch.xpack.monitoring.agent.resolver.MonitoringIndexNameResolver; import java.io.IOException; diff --git a/elasticsearch/x-pack/marvel/src/main/java/org/elasticsearch/marvel/agent/resolver/shards/ShardsResolver.java b/elasticsearch/x-pack/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/agent/resolver/shards/ShardsResolver.java similarity index 90% rename from elasticsearch/x-pack/marvel/src/main/java/org/elasticsearch/marvel/agent/resolver/shards/ShardsResolver.java rename to elasticsearch/x-pack/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/agent/resolver/shards/ShardsResolver.java index 93d1c80688b..9adec06e16a 100644 --- a/elasticsearch/x-pack/marvel/src/main/java/org/elasticsearch/marvel/agent/resolver/shards/ShardsResolver.java +++ b/elasticsearch/x-pack/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/agent/resolver/shards/ShardsResolver.java @@ -3,15 +3,15 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.marvel.agent.resolver.shards; +package org.elasticsearch.xpack.monitoring.agent.resolver.shards; import org.elasticsearch.cluster.routing.ShardRouting; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.xcontent.ToXContent; import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.marvel.MonitoredSystem; -import org.elasticsearch.marvel.agent.collector.shards.ShardMonitoringDoc; -import org.elasticsearch.marvel.agent.resolver.MonitoringIndexNameResolver; +import org.elasticsearch.xpack.monitoring.MonitoredSystem; +import org.elasticsearch.xpack.monitoring.agent.collector.shards.ShardMonitoringDoc; +import org.elasticsearch.xpack.monitoring.agent.resolver.MonitoringIndexNameResolver; import java.io.IOException; diff --git a/elasticsearch/x-pack/marvel/src/main/java/org/elasticsearch/marvel/cleaner/CleanerService.java b/elasticsearch/x-pack/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/cleaner/CleanerService.java similarity index 98% rename from elasticsearch/x-pack/marvel/src/main/java/org/elasticsearch/marvel/cleaner/CleanerService.java rename to elasticsearch/x-pack/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/cleaner/CleanerService.java index a0a0c8f813b..e61426e411d 100644 --- a/elasticsearch/x-pack/marvel/src/main/java/org/elasticsearch/marvel/cleaner/CleanerService.java +++ b/elasticsearch/x-pack/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/cleaner/CleanerService.java @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.marvel.cleaner; +package org.elasticsearch.xpack.monitoring.cleaner; import org.elasticsearch.common.component.AbstractLifecycleComponent; import org.elasticsearch.common.inject.Inject; @@ -13,9 +13,9 @@ import org.elasticsearch.common.unit.TimeValue; import org.elasticsearch.common.util.concurrent.AbstractLifecycleRunnable; import org.elasticsearch.common.util.concurrent.EsRejectedExecutionException; import org.elasticsearch.common.util.concurrent.FutureUtils; -import org.elasticsearch.marvel.MonitoringSettings; -import org.elasticsearch.marvel.MonitoringLicensee; import org.elasticsearch.threadpool.ThreadPool; +import org.elasticsearch.xpack.monitoring.MonitoringLicensee; +import org.elasticsearch.xpack.monitoring.MonitoringSettings; import org.joda.time.DateTime; import org.joda.time.chrono.ISOChronology; diff --git a/elasticsearch/x-pack/marvel/src/main/java/org/elasticsearch/marvel/client/MonitoringClient.java b/elasticsearch/x-pack/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/client/MonitoringClient.java similarity index 83% rename from elasticsearch/x-pack/marvel/src/main/java/org/elasticsearch/marvel/client/MonitoringClient.java rename to elasticsearch/x-pack/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/client/MonitoringClient.java index 36072fc73ad..0ef0399c20d 100644 --- a/elasticsearch/x-pack/marvel/src/main/java/org/elasticsearch/marvel/client/MonitoringClient.java +++ b/elasticsearch/x-pack/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/client/MonitoringClient.java @@ -3,16 +3,16 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.marvel.client; +package org.elasticsearch.xpack.monitoring.client; import org.elasticsearch.action.ActionFuture; import org.elasticsearch.action.ActionListener; import org.elasticsearch.client.Client; import org.elasticsearch.common.inject.Inject; -import org.elasticsearch.marvel.action.MonitoringBulkAction; -import org.elasticsearch.marvel.action.MonitoringBulkRequest; -import org.elasticsearch.marvel.action.MonitoringBulkRequestBuilder; -import org.elasticsearch.marvel.action.MonitoringBulkResponse; +import org.elasticsearch.xpack.monitoring.action.MonitoringBulkAction; +import org.elasticsearch.xpack.monitoring.action.MonitoringBulkRequest; +import org.elasticsearch.xpack.monitoring.action.MonitoringBulkRequestBuilder; +import org.elasticsearch.xpack.monitoring.action.MonitoringBulkResponse; import java.util.Map; diff --git a/elasticsearch/x-pack/marvel/src/main/java/org/elasticsearch/marvel/client/MonitoringClientModule.java b/elasticsearch/x-pack/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/client/MonitoringClientModule.java similarity index 90% rename from elasticsearch/x-pack/marvel/src/main/java/org/elasticsearch/marvel/client/MonitoringClientModule.java rename to elasticsearch/x-pack/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/client/MonitoringClientModule.java index 0a3f6075c9a..f87c68c383c 100644 --- a/elasticsearch/x-pack/marvel/src/main/java/org/elasticsearch/marvel/client/MonitoringClientModule.java +++ b/elasticsearch/x-pack/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/client/MonitoringClientModule.java @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.marvel.client; +package org.elasticsearch.xpack.monitoring.client; import org.elasticsearch.common.inject.AbstractModule; diff --git a/elasticsearch/x-pack/marvel/src/main/java/org/elasticsearch/marvel/rest/MonitoringRestHandler.java b/elasticsearch/x-pack/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/rest/MonitoringRestHandler.java similarity index 93% rename from elasticsearch/x-pack/marvel/src/main/java/org/elasticsearch/marvel/rest/MonitoringRestHandler.java rename to elasticsearch/x-pack/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/rest/MonitoringRestHandler.java index 11901f1b3b7..250de3eedc9 100644 --- a/elasticsearch/x-pack/marvel/src/main/java/org/elasticsearch/marvel/rest/MonitoringRestHandler.java +++ b/elasticsearch/x-pack/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/rest/MonitoringRestHandler.java @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.marvel.rest; +package org.elasticsearch.xpack.monitoring.rest; import org.elasticsearch.client.Client; import org.elasticsearch.common.settings.Settings; diff --git a/elasticsearch/x-pack/marvel/src/main/java/org/elasticsearch/marvel/rest/action/RestMonitoringBulkAction.java b/elasticsearch/x-pack/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/rest/action/RestMonitoringBulkAction.java similarity index 92% rename from elasticsearch/x-pack/marvel/src/main/java/org/elasticsearch/marvel/rest/action/RestMonitoringBulkAction.java rename to elasticsearch/x-pack/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/rest/action/RestMonitoringBulkAction.java index b7bfe9e462e..d130782a317 100644 --- a/elasticsearch/x-pack/marvel/src/main/java/org/elasticsearch/marvel/rest/action/RestMonitoringBulkAction.java +++ b/elasticsearch/x-pack/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/rest/action/RestMonitoringBulkAction.java @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.marvel.rest.action; +package org.elasticsearch.xpack.monitoring.rest.action; import org.elasticsearch.ElasticsearchParseException; import org.elasticsearch.client.Client; @@ -11,9 +11,6 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.common.inject.Inject; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.marvel.action.MonitoringBulkRequestBuilder; -import org.elasticsearch.marvel.action.MonitoringBulkResponse; -import org.elasticsearch.marvel.rest.MonitoringRestHandler; import org.elasticsearch.rest.BytesRestResponse; import org.elasticsearch.rest.RestChannel; import org.elasticsearch.rest.RestController; @@ -22,6 +19,9 @@ import org.elasticsearch.rest.RestResponse; import org.elasticsearch.rest.action.support.RestActions; import org.elasticsearch.rest.action.support.RestBuilderListener; import org.elasticsearch.xpack.XPackClient; +import org.elasticsearch.xpack.monitoring.action.MonitoringBulkRequestBuilder; +import org.elasticsearch.xpack.monitoring.action.MonitoringBulkResponse; +import org.elasticsearch.xpack.monitoring.rest.MonitoringRestHandler; import static org.elasticsearch.rest.RestRequest.Method.POST; import static org.elasticsearch.rest.RestRequest.Method.PUT; diff --git a/elasticsearch/x-pack/marvel/src/main/java/org/elasticsearch/marvel/support/VersionUtils.java b/elasticsearch/x-pack/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/support/VersionUtils.java similarity index 96% rename from elasticsearch/x-pack/marvel/src/main/java/org/elasticsearch/marvel/support/VersionUtils.java rename to elasticsearch/x-pack/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/support/VersionUtils.java index 51a2c55bd4e..3ef6582576f 100644 --- a/elasticsearch/x-pack/marvel/src/main/java/org/elasticsearch/marvel/support/VersionUtils.java +++ b/elasticsearch/x-pack/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/support/VersionUtils.java @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.marvel.support; +package org.elasticsearch.xpack.monitoring.support; import org.elasticsearch.Version; import org.elasticsearch.common.Strings; diff --git a/elasticsearch/x-pack/marvel/src/main/resources/monitoring-data.json b/elasticsearch/x-pack/monitoring/src/main/resources/monitoring-data.json similarity index 100% rename from elasticsearch/x-pack/marvel/src/main/resources/monitoring-data.json rename to elasticsearch/x-pack/monitoring/src/main/resources/monitoring-data.json diff --git a/elasticsearch/x-pack/marvel/src/main/resources/monitoring-es.json b/elasticsearch/x-pack/monitoring/src/main/resources/monitoring-es.json similarity index 100% rename from elasticsearch/x-pack/marvel/src/main/resources/monitoring-es.json rename to elasticsearch/x-pack/monitoring/src/main/resources/monitoring-es.json diff --git a/elasticsearch/x-pack/marvel/src/main/resources/monitoring-kibana.json b/elasticsearch/x-pack/monitoring/src/main/resources/monitoring-kibana.json similarity index 100% rename from elasticsearch/x-pack/marvel/src/main/resources/monitoring-kibana.json rename to elasticsearch/x-pack/monitoring/src/main/resources/monitoring-kibana.json diff --git a/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/action/admin/indices/stats/IndicesStatsResponseTestUtils.java b/elasticsearch/x-pack/monitoring/src/test/java/org/elasticsearch/action/admin/indices/stats/IndicesStatsResponseTestUtils.java similarity index 100% rename from elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/action/admin/indices/stats/IndicesStatsResponseTestUtils.java rename to elasticsearch/x-pack/monitoring/src/test/java/org/elasticsearch/action/admin/indices/stats/IndicesStatsResponseTestUtils.java diff --git a/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/MonitoringF.java b/elasticsearch/x-pack/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/MonitoringF.java similarity index 97% rename from elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/MonitoringF.java rename to elasticsearch/x-pack/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/MonitoringF.java index ef2efe487a8..9c2a3aec6a4 100644 --- a/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/MonitoringF.java +++ b/elasticsearch/x-pack/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/MonitoringF.java @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.marvel; +package org.elasticsearch.xpack.monitoring; import org.apache.lucene.util.IOUtils; import org.elasticsearch.ElasticsearchException; diff --git a/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/MonitoringFeatureSetTests.java b/elasticsearch/x-pack/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/MonitoringFeatureSetTests.java similarity index 94% rename from elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/MonitoringFeatureSetTests.java rename to elasticsearch/x-pack/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/MonitoringFeatureSetTests.java index 108527eb584..457ddd951a5 100644 --- a/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/MonitoringFeatureSetTests.java +++ b/elasticsearch/x-pack/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/MonitoringFeatureSetTests.java @@ -3,16 +3,16 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.marvel; +package org.elasticsearch.xpack.monitoring; import org.elasticsearch.common.io.stream.NamedWriteableRegistry; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.marvel.agent.exporter.Exporter; -import org.elasticsearch.marvel.agent.exporter.Exporters; -import org.elasticsearch.marvel.agent.exporter.http.HttpExporter; -import org.elasticsearch.marvel.agent.exporter.local.LocalExporter; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.xpack.XPackFeatureSet; +import org.elasticsearch.xpack.monitoring.agent.exporter.Exporter; +import org.elasticsearch.xpack.monitoring.agent.exporter.Exporters; +import org.elasticsearch.xpack.monitoring.agent.exporter.http.HttpExporter; +import org.elasticsearch.xpack.monitoring.agent.exporter.local.LocalExporter; import org.elasticsearch.xpack.watcher.support.xcontent.XContentSource; import org.junit.Before; diff --git a/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/MarvelPluginClientTests.java b/elasticsearch/x-pack/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/MonitoringPluginClientTests.java similarity index 88% rename from elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/MarvelPluginClientTests.java rename to elasticsearch/x-pack/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/MonitoringPluginClientTests.java index cc1dc71e881..a6c9baaa802 100644 --- a/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/MarvelPluginClientTests.java +++ b/elasticsearch/x-pack/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/MonitoringPluginClientTests.java @@ -3,19 +3,16 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.marvel; +package org.elasticsearch.xpack.monitoring; import org.elasticsearch.client.Client; import org.elasticsearch.client.transport.TransportClient; -import org.elasticsearch.common.inject.Module; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.test.ESTestCase; -import java.util.Collection; - import static org.hamcrest.Matchers.is; -public class MarvelPluginClientTests extends ESTestCase { +public class MonitoringPluginClientTests extends ESTestCase { public void testModulesWithClientSettings() { Settings settings = Settings.builder() diff --git a/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/MarvelPluginTests.java b/elasticsearch/x-pack/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/MonitoringPluginTests.java similarity index 86% rename from elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/MarvelPluginTests.java rename to elasticsearch/x-pack/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/MonitoringPluginTests.java index 1353e703af5..8c89480a783 100644 --- a/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/MarvelPluginTests.java +++ b/elasticsearch/x-pack/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/MonitoringPluginTests.java @@ -3,32 +3,32 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.marvel; +package org.elasticsearch.xpack.monitoring; import org.elasticsearch.action.admin.cluster.node.info.NodeInfo; import org.elasticsearch.action.admin.cluster.node.info.NodesInfoResponse; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.marvel.agent.AgentService; -import org.elasticsearch.marvel.test.MarvelIntegTestCase; import org.elasticsearch.plugins.PluginInfo; import org.elasticsearch.test.ESIntegTestCase.ClusterScope; import org.elasticsearch.xpack.XPackPlugin; +import org.elasticsearch.xpack.monitoring.agent.AgentService; +import org.elasticsearch.xpack.monitoring.test.MonitoringIntegTestCase; import static org.elasticsearch.test.ESIntegTestCase.Scope.TEST; import static org.hamcrest.Matchers.equalTo; @ClusterScope(scope = TEST, transportClientRatio = 0, numClientNodes = 0, numDataNodes = 0) -public class MarvelPluginTests extends MarvelIntegTestCase { +public class MonitoringPluginTests extends MonitoringIntegTestCase { @Override protected void startCollection() { - // do nothing as marvel is sometime unbound + // do nothing as monitoring is sometime unbound } @Override protected void stopCollection() { - // do nothing as marvel is sometime unbound + // do nothing as monitoring is sometime unbound } @Override @@ -39,7 +39,7 @@ public class MarvelPluginTests extends MarvelIntegTestCase { .build(); } - public void testMarvelEnabled() { + public void testMonitoringEnabled() { internalCluster().startNode(Settings.builder() .put(XPackPlugin.featureEnabledSetting(Monitoring.NAME), true) .build()); @@ -47,7 +47,7 @@ public class MarvelPluginTests extends MarvelIntegTestCase { assertServiceIsBound(AgentService.class); } - public void testMarvelDisabled() { + public void testMonitoringDisabled() { internalCluster().startNode(Settings.builder() .put(XPackPlugin.featureEnabledSetting(Monitoring.NAME), false) .build()); @@ -55,7 +55,7 @@ public class MarvelPluginTests extends MarvelIntegTestCase { assertServiceIsNotBound(AgentService.class); } - public void testMarvelEnabledOnTribeNode() { + public void testMonitoringEnabledOnTribeNode() { internalCluster().startNode(Settings.builder() .put(XPackPlugin.featureEnabledSetting(Monitoring.NAME), true) .put("tribe.name", "t1") @@ -64,7 +64,7 @@ public class MarvelPluginTests extends MarvelIntegTestCase { assertServiceIsBound(AgentService.class); } - public void testMarvelDisabledOnTribeNode() { + public void testMonitoringDisabledOnTribeNode() { internalCluster().startNode(Settings.builder().put("tribe.name", "t1").build()); assertPluginIsLoaded(); assertServiceIsNotBound(AgentService.class); diff --git a/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/MarvelSettingsTests.java b/elasticsearch/x-pack/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/MonitoringSettingsTests.java similarity index 94% rename from elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/MarvelSettingsTests.java rename to elasticsearch/x-pack/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/MonitoringSettingsTests.java index d6240ea4c71..8bbe7ad0211 100644 --- a/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/MarvelSettingsTests.java +++ b/elasticsearch/x-pack/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/MonitoringSettingsTests.java @@ -3,19 +3,18 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.marvel; +package org.elasticsearch.xpack.monitoring; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.unit.TimeValue; import org.elasticsearch.test.ESTestCase; - import org.junit.Rule; import org.junit.rules.ExpectedException; /** * Tests {@link MonitoringSettings} */ -public class MarvelSettingsTests extends ESTestCase { +public class MonitoringSettingsTests extends ESTestCase { @Rule public ExpectedException expectedException = ExpectedException.none(); diff --git a/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/MonitoringTribeTests.java b/elasticsearch/x-pack/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/MonitoringTribeTests.java similarity index 86% rename from elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/MonitoringTribeTests.java rename to elasticsearch/x-pack/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/MonitoringTribeTests.java index df11eaae87e..1776a73e813 100644 --- a/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/MonitoringTribeTests.java +++ b/elasticsearch/x-pack/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/MonitoringTribeTests.java @@ -3,14 +3,14 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.marvel; +package org.elasticsearch.xpack.monitoring; import org.elasticsearch.client.Client; import org.elasticsearch.common.bytes.BytesArray; -import org.elasticsearch.marvel.action.MonitoringBulkAction; -import org.elasticsearch.marvel.action.MonitoringBulkDoc; -import org.elasticsearch.marvel.action.MonitoringBulkRequest; import org.elasticsearch.xpack.TribeTransportTestCase; +import org.elasticsearch.xpack.monitoring.action.MonitoringBulkAction; +import org.elasticsearch.xpack.monitoring.action.MonitoringBulkDoc; +import org.elasticsearch.xpack.monitoring.action.MonitoringBulkRequest; import java.util.Collections; import java.util.List; diff --git a/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/action/MonitoringBulkDocTests.java b/elasticsearch/x-pack/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/action/MonitoringBulkDocTests.java similarity index 96% rename from elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/action/MonitoringBulkDocTests.java rename to elasticsearch/x-pack/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/action/MonitoringBulkDocTests.java index 876d6fd0891..b9a1cda58b1 100644 --- a/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/action/MonitoringBulkDocTests.java +++ b/elasticsearch/x-pack/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/action/MonitoringBulkDocTests.java @@ -3,14 +3,14 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.marvel.action; +package org.elasticsearch.xpack.monitoring.action; import org.elasticsearch.Version; import org.elasticsearch.common.bytes.BytesArray; import org.elasticsearch.common.io.stream.BytesStreamOutput; import org.elasticsearch.common.io.stream.StreamInput; -import org.elasticsearch.marvel.agent.exporter.MonitoringDoc; import org.elasticsearch.test.ESTestCase; +import org.elasticsearch.xpack.monitoring.agent.exporter.MonitoringDoc; import java.io.IOException; import java.util.HashMap; diff --git a/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/action/MonitoringBulkRequestTests.java b/elasticsearch/x-pack/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/action/MonitoringBulkRequestTests.java similarity index 99% rename from elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/action/MonitoringBulkRequestTests.java rename to elasticsearch/x-pack/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/action/MonitoringBulkRequestTests.java index a027f38110a..e4520126cd1 100644 --- a/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/action/MonitoringBulkRequestTests.java +++ b/elasticsearch/x-pack/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/action/MonitoringBulkRequestTests.java @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.marvel.action; +package org.elasticsearch.xpack.monitoring.action; import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.common.bytes.BytesArray; diff --git a/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/action/MonitoringBulkResponseTests.java b/elasticsearch/x-pack/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/action/MonitoringBulkResponseTests.java similarity index 96% rename from elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/action/MonitoringBulkResponseTests.java rename to elasticsearch/x-pack/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/action/MonitoringBulkResponseTests.java index 8c414555277..8ebebe7cf54 100644 --- a/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/action/MonitoringBulkResponseTests.java +++ b/elasticsearch/x-pack/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/action/MonitoringBulkResponseTests.java @@ -3,14 +3,14 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.marvel.action; +package org.elasticsearch.xpack.monitoring.action; import org.elasticsearch.Version; import org.elasticsearch.common.io.stream.BytesStreamOutput; import org.elasticsearch.common.io.stream.StreamInput; -import org.elasticsearch.marvel.agent.exporter.ExportException; import org.elasticsearch.rest.RestStatus; import org.elasticsearch.test.ESTestCase; +import org.elasticsearch.xpack.monitoring.agent.exporter.ExportException; import java.io.IOException; diff --git a/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/action/MonitoringBulkTests.java b/elasticsearch/x-pack/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/action/MonitoringBulkTests.java similarity index 93% rename from elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/action/MonitoringBulkTests.java rename to elasticsearch/x-pack/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/action/MonitoringBulkTests.java index 374077beff9..3b2046f4eea 100644 --- a/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/action/MonitoringBulkTests.java +++ b/elasticsearch/x-pack/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/action/MonitoringBulkTests.java @@ -3,17 +3,17 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.marvel.action; +package org.elasticsearch.xpack.monitoring.action; import org.elasticsearch.Version; import org.elasticsearch.action.search.SearchResponse; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.util.concurrent.AbstractRunnable; -import org.elasticsearch.marvel.MonitoredSystem; -import org.elasticsearch.marvel.agent.resolver.bulk.MonitoringBulkTimestampedResolver; -import org.elasticsearch.marvel.test.MarvelIntegTestCase; import org.elasticsearch.search.SearchHit; import org.elasticsearch.test.junit.annotations.TestLogging; +import org.elasticsearch.xpack.monitoring.MonitoredSystem; +import org.elasticsearch.xpack.monitoring.agent.resolver.bulk.MonitoringBulkTimestampedResolver; +import org.elasticsearch.xpack.monitoring.test.MonitoringIntegTestCase; import java.util.List; import java.util.Map; @@ -30,7 +30,7 @@ import static org.hamcrest.Matchers.notNullValue; import static org.hamcrest.Matchers.nullValue; @TestLogging("_root:DEBUG") -public class MonitoringBulkTests extends MarvelIntegTestCase { +public class MonitoringBulkTests extends MonitoringIntegTestCase { @Override protected Settings transportClientSettings() { @@ -120,7 +120,7 @@ public class MonitoringBulkTests extends MarvelIntegTestCase { } assertThat(exceptions, empty()); - awaitMarvelDocsCount(greaterThanOrEqualTo(total.get()), "concurrent"); + awaitMonitoringDocsCount(greaterThanOrEqualTo(total.get()), "concurrent"); } public void testUnsupportedSystem() throws Exception { diff --git a/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/action/MonitoringIndexTests.java b/elasticsearch/x-pack/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/action/MonitoringIndexTests.java similarity index 97% rename from elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/action/MonitoringIndexTests.java rename to elasticsearch/x-pack/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/action/MonitoringIndexTests.java index 9569074fd1f..edd88e477dc 100644 --- a/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/action/MonitoringIndexTests.java +++ b/elasticsearch/x-pack/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/action/MonitoringIndexTests.java @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.marvel.action; +package org.elasticsearch.xpack.monitoring.action; import org.elasticsearch.common.io.stream.BytesStreamOutput; import org.elasticsearch.common.io.stream.StreamInput; diff --git a/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/action/TransportMonitoringBulkActionTests.java b/elasticsearch/x-pack/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/action/TransportMonitoringBulkActionTests.java similarity index 96% rename from elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/action/TransportMonitoringBulkActionTests.java rename to elasticsearch/x-pack/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/action/TransportMonitoringBulkActionTests.java index 0d718d37d04..c3c8c32b8da 100644 --- a/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/action/TransportMonitoringBulkActionTests.java +++ b/elasticsearch/x-pack/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/action/TransportMonitoringBulkActionTests.java @@ -3,14 +3,13 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.marvel.action; +package org.elasticsearch.xpack.monitoring.action; import org.elasticsearch.ElasticsearchException; import org.elasticsearch.Version; import org.elasticsearch.action.support.ActionFilters; import org.elasticsearch.action.support.PlainActionFuture; import org.elasticsearch.cluster.ClusterChangedEvent; -import org.elasticsearch.cluster.ClusterName; import org.elasticsearch.cluster.ClusterState; import org.elasticsearch.cluster.ClusterStateUpdateTask; import org.elasticsearch.cluster.NodeConnectionsService; @@ -23,16 +22,16 @@ import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.transport.DummyTransportAddress; import org.elasticsearch.common.util.concurrent.ConcurrentCollections; import org.elasticsearch.discovery.DiscoverySettings; -import org.elasticsearch.marvel.MonitoringSettings; -import org.elasticsearch.marvel.MonitoredSystem; -import org.elasticsearch.marvel.agent.exporter.ExportException; -import org.elasticsearch.marvel.agent.exporter.Exporters; -import org.elasticsearch.marvel.agent.exporter.MonitoringDoc; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.test.transport.CapturingTransport; import org.elasticsearch.threadpool.TestThreadPool; import org.elasticsearch.threadpool.ThreadPool; import org.elasticsearch.transport.TransportService; +import org.elasticsearch.xpack.monitoring.MonitoredSystem; +import org.elasticsearch.xpack.monitoring.MonitoringSettings; +import org.elasticsearch.xpack.monitoring.agent.exporter.ExportException; +import org.elasticsearch.xpack.monitoring.agent.exporter.Exporters; +import org.elasticsearch.xpack.monitoring.agent.exporter.MonitoringDoc; import org.junit.After; import org.junit.AfterClass; import org.junit.Before; diff --git a/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/collector/AbstractCollectorTestCase.java b/elasticsearch/x-pack/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/agent/collector/AbstractCollectorTestCase.java similarity index 96% rename from elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/collector/AbstractCollectorTestCase.java rename to elasticsearch/x-pack/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/agent/collector/AbstractCollectorTestCase.java index e265f69fe5a..bd79599f381 100644 --- a/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/collector/AbstractCollectorTestCase.java +++ b/elasticsearch/x-pack/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/agent/collector/AbstractCollectorTestCase.java @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.marvel.agent.collector; +package org.elasticsearch.xpack.monitoring.agent.collector; import com.carrotsearch.randomizedtesting.RandomizedTest; import com.carrotsearch.randomizedtesting.SysGlobals; @@ -25,14 +25,15 @@ import org.elasticsearch.license.plugin.core.LicenseState; import org.elasticsearch.license.plugin.core.Licensee; import org.elasticsearch.license.plugin.core.LicenseeRegistry; import org.elasticsearch.license.plugin.core.LicensesManagerService; -import org.elasticsearch.marvel.MonitoringSettings; -import org.elasticsearch.marvel.test.MarvelIntegTestCase; import org.elasticsearch.plugins.Plugin; import org.elasticsearch.plugins.ActionPlugin.ActionHandler; import org.elasticsearch.xpack.security.InternalClient; import org.elasticsearch.test.ESIntegTestCase; import org.elasticsearch.test.ESIntegTestCase.ClusterScope; import org.elasticsearch.xpack.XPackPlugin; +import org.elasticsearch.xpack.monitoring.MonitoringSettings; +import org.elasticsearch.xpack.monitoring.test.MonitoringIntegTestCase; +import org.elasticsearch.xpack.security.InternalClient; import org.junit.Before; import java.util.ArrayList; @@ -46,7 +47,7 @@ import static java.util.Collections.emptyList; import static org.elasticsearch.common.unit.TimeValue.timeValueMinutes; @ClusterScope(scope = ESIntegTestCase.Scope.SUITE, randomDynamicTemplates = false, transportClientRatio = 0.0) -public abstract class AbstractCollectorTestCase extends MarvelIntegTestCase { +public abstract class AbstractCollectorTestCase extends MonitoringIntegTestCase { @Override protected Collection> nodePlugins() { diff --git a/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/collector/cluster/ClusterStateCollectorTests.java b/elasticsearch/x-pack/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/agent/collector/cluster/ClusterStateCollectorTests.java similarity index 78% rename from elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/collector/cluster/ClusterStateCollectorTests.java rename to elasticsearch/x-pack/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/agent/collector/cluster/ClusterStateCollectorTests.java index c1075c51af0..f7e92724ee5 100644 --- a/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/collector/cluster/ClusterStateCollectorTests.java +++ b/elasticsearch/x-pack/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/agent/collector/cluster/ClusterStateCollectorTests.java @@ -3,18 +3,18 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.marvel.agent.collector.cluster; +package org.elasticsearch.xpack.monitoring.agent.collector.cluster; import org.elasticsearch.Version; -import org.elasticsearch.cluster.service.ClusterService; import org.elasticsearch.cluster.ClusterState; import org.elasticsearch.cluster.metadata.IndexMetaData; +import org.elasticsearch.cluster.service.ClusterService; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.marvel.MonitoringSettings; -import org.elasticsearch.marvel.MonitoredSystem; -import org.elasticsearch.marvel.agent.collector.AbstractCollectorTestCase; -import org.elasticsearch.marvel.agent.exporter.MonitoringDoc; -import org.elasticsearch.marvel.MonitoringLicensee; +import org.elasticsearch.xpack.monitoring.MonitoredSystem; +import org.elasticsearch.xpack.monitoring.MonitoringLicensee; +import org.elasticsearch.xpack.monitoring.MonitoringSettings; +import org.elasticsearch.xpack.monitoring.agent.collector.AbstractCollectorTestCase; +import org.elasticsearch.xpack.monitoring.agent.exporter.MonitoringDoc; import java.util.ArrayList; import java.util.Collection; @@ -34,7 +34,7 @@ import static org.hamcrest.Matchers.notNullValue; public class ClusterStateCollectorTests extends AbstractCollectorTestCase { public void testClusterStateCollectorNoIndices() throws Exception { - assertMarvelDocs(newClusterStateCollector().doCollect(), 0); + assertMonitoringDocs(newClusterStateCollector().doCollect(), 0); } public void testClusterStateCollectorOneIndex() throws Exception { @@ -53,7 +53,7 @@ public class ClusterStateCollectorTests extends AbstractCollectorTestCase { securedRefresh(); assertHitCount(client().prepareSearch().setSize(0).get(), nbDocs); - assertMarvelDocs(newClusterStateCollector().doCollect(), nbShards); + assertMonitoringDocs(newClusterStateCollector().doCollect(), nbShards); } public void testClusterStateCollectorMultipleIndices() throws Exception { @@ -84,23 +84,23 @@ public class ClusterStateCollectorTests extends AbstractCollectorTestCase { } Collection results = newClusterStateCollector().doCollect(); - assertMarvelDocs(results, nbShards); + assertMonitoringDocs(results, nbShards); MonitoringDoc monitoringDoc = results.iterator().next(); assertNotNull(monitoringDoc); assertThat(monitoringDoc, instanceOf(ClusterStateMonitoringDoc.class)); - ClusterStateMonitoringDoc clusterStateMarvelDoc = (ClusterStateMonitoringDoc) monitoringDoc; + ClusterStateMonitoringDoc clusterStateMonitoringDoc = (ClusterStateMonitoringDoc) monitoringDoc; - assertThat(clusterStateMarvelDoc.getMonitoringId(), equalTo(MonitoredSystem.ES.getSystem())); - assertThat(clusterStateMarvelDoc.getMonitoringVersion(), equalTo(Version.CURRENT.toString())); - assertThat(clusterStateMarvelDoc.getClusterUUID(), + assertThat(clusterStateMonitoringDoc.getMonitoringId(), equalTo(MonitoredSystem.ES.getSystem())); + assertThat(clusterStateMonitoringDoc.getMonitoringVersion(), equalTo(Version.CURRENT.toString())); + assertThat(clusterStateMonitoringDoc.getClusterUUID(), equalTo(client().admin().cluster().prepareState().setMetaData(true).get().getState().metaData().clusterUUID())); - assertThat(clusterStateMarvelDoc.getTimestamp(), greaterThan(0L)); - assertThat(clusterStateMarvelDoc.getSourceNode(), notNullValue()); - assertNotNull(clusterStateMarvelDoc.getClusterState()); + assertThat(clusterStateMonitoringDoc.getTimestamp(), greaterThan(0L)); + assertThat(clusterStateMonitoringDoc.getSourceNode(), notNullValue()); + assertNotNull(clusterStateMonitoringDoc.getClusterState()); - ClusterState clusterState = clusterStateMarvelDoc.getClusterState(); + ClusterState clusterState = clusterStateMonitoringDoc.getClusterState(); for (int i = 0; i < nbIndices; i++) { assertThat(clusterState.getRoutingTable().allShards("test-" + i), hasSize(shardsPerIndex[i])); } @@ -158,7 +158,7 @@ public class ClusterStateCollectorTests extends AbstractCollectorTestCase { securedClient(nodeId)); } - private void assertMarvelDocs(Collection results, final int nbShards) { + private void assertMonitoringDocs(Collection results, final int nbShards) { assertThat("expecting 1 document for cluster state and 2 documents per node", results, hasSize(1 + internalCluster().size() * 2)); final ClusterState clusterState = securedClient().admin().cluster().prepareState().get().getState(); @@ -178,20 +178,20 @@ public class ClusterStateCollectorTests extends AbstractCollectorTestCase { instanceOf(ClusterStateNodeMonitoringDoc.class), instanceOf(DiscoveryNodeMonitoringDoc.class))); if (doc instanceof ClusterStateMonitoringDoc) { - ClusterStateMonitoringDoc clusterStateMarvelDoc = (ClusterStateMonitoringDoc) doc; - assertThat(clusterStateMarvelDoc.getClusterState().getRoutingTable().allShards(), hasSize(nbShards)); - assertThat(clusterStateMarvelDoc.getClusterState().getNodes().getSize(), equalTo(internalCluster().size())); + ClusterStateMonitoringDoc clusterStateMonitoringDoc = (ClusterStateMonitoringDoc) doc; + assertThat(clusterStateMonitoringDoc.getClusterState().getRoutingTable().allShards(), hasSize(nbShards)); + assertThat(clusterStateMonitoringDoc.getClusterState().getNodes().getSize(), equalTo(internalCluster().size())); } else if (doc instanceof ClusterStateNodeMonitoringDoc) { - ClusterStateNodeMonitoringDoc clusterStateNodeMarvelDoc = (ClusterStateNodeMonitoringDoc) doc; - assertThat(clusterStateNodeMarvelDoc.getStateUUID(), equalTo(stateUUID)); - assertThat(clusterStateNodeMarvelDoc.getNodeId(), not(isEmptyOrNullString())); - clusterStateNodes.add(clusterStateNodeMarvelDoc); + ClusterStateNodeMonitoringDoc clusterStateNodeMonitoringDoc = (ClusterStateNodeMonitoringDoc) doc; + assertThat(clusterStateNodeMonitoringDoc.getStateUUID(), equalTo(stateUUID)); + assertThat(clusterStateNodeMonitoringDoc.getNodeId(), not(isEmptyOrNullString())); + clusterStateNodes.add(clusterStateNodeMonitoringDoc); } else if (doc instanceof DiscoveryNodeMonitoringDoc) { - DiscoveryNodeMonitoringDoc discoveryNodeMarvelDoc = (DiscoveryNodeMonitoringDoc) doc; - assertNotNull(discoveryNodeMarvelDoc.getNode()); - discoveryNodes.add(discoveryNodeMarvelDoc); + DiscoveryNodeMonitoringDoc discoveryNodeMonitoringDoc = (DiscoveryNodeMonitoringDoc) doc; + assertNotNull(discoveryNodeMonitoringDoc.getNode()); + discoveryNodes.add(discoveryNodeMonitoringDoc); } else { fail("unknown monitoring document type " + doc); diff --git a/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/collector/cluster/ClusterStatsCollectorTests.java b/elasticsearch/x-pack/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/agent/collector/cluster/ClusterStatsCollectorTests.java similarity index 73% rename from elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/collector/cluster/ClusterStatsCollectorTests.java rename to elasticsearch/x-pack/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/agent/collector/cluster/ClusterStatsCollectorTests.java index 25f47c6a74d..a54443e98e2 100644 --- a/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/collector/cluster/ClusterStatsCollectorTests.java +++ b/elasticsearch/x-pack/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/agent/collector/cluster/ClusterStatsCollectorTests.java @@ -3,20 +3,19 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.marvel.agent.collector.cluster; +package org.elasticsearch.xpack.monitoring.agent.collector.cluster; import org.apache.lucene.util.LuceneTestCase.BadApple; import org.elasticsearch.Version; -import org.elasticsearch.cluster.ClusterName; import org.elasticsearch.cluster.service.ClusterService; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.license.plugin.core.LicensesManagerService; -import org.elasticsearch.marvel.MonitoringSettings; -import org.elasticsearch.marvel.MonitoredSystem; -import org.elasticsearch.marvel.agent.collector.AbstractCollector; -import org.elasticsearch.marvel.agent.collector.AbstractCollectorTestCase; -import org.elasticsearch.marvel.agent.exporter.MonitoringDoc; -import org.elasticsearch.marvel.MonitoringLicensee; +import org.elasticsearch.xpack.monitoring.MonitoredSystem; +import org.elasticsearch.xpack.monitoring.MonitoringLicensee; +import org.elasticsearch.xpack.monitoring.MonitoringSettings; +import org.elasticsearch.xpack.monitoring.agent.collector.AbstractCollector; +import org.elasticsearch.xpack.monitoring.agent.collector.AbstractCollectorTestCase; +import org.elasticsearch.xpack.monitoring.agent.exporter.MonitoringDoc; import java.util.Collection; @@ -39,23 +38,23 @@ public class ClusterStatsCollectorTests extends AbstractCollectorTestCase { assertNotNull(monitoringDoc); assertThat(monitoringDoc, instanceOf(ClusterInfoMonitoringDoc.class)); - ClusterInfoMonitoringDoc clusterInfoMarvelDoc = (ClusterInfoMonitoringDoc) monitoringDoc; - assertThat(clusterInfoMarvelDoc.getMonitoringId(), equalTo(MonitoredSystem.ES.getSystem())); - assertThat(clusterInfoMarvelDoc.getMonitoringVersion(), equalTo(Version.CURRENT.toString())); - assertThat(clusterInfoMarvelDoc.getClusterUUID(), + ClusterInfoMonitoringDoc clusterInfoMonitoringDoc = (ClusterInfoMonitoringDoc) monitoringDoc; + assertThat(clusterInfoMonitoringDoc.getMonitoringId(), equalTo(MonitoredSystem.ES.getSystem())); + assertThat(clusterInfoMonitoringDoc.getMonitoringVersion(), equalTo(Version.CURRENT.toString())); + assertThat(clusterInfoMonitoringDoc.getClusterUUID(), equalTo(client().admin().cluster().prepareState().setMetaData(true).get().getState().metaData().clusterUUID())); - assertThat(clusterInfoMarvelDoc.getTimestamp(), greaterThan(0L)); - assertThat(clusterInfoMarvelDoc.getSourceNode(), notNullValue()); + assertThat(clusterInfoMonitoringDoc.getTimestamp(), greaterThan(0L)); + assertThat(clusterInfoMonitoringDoc.getSourceNode(), notNullValue()); - assertThat(clusterInfoMarvelDoc.getClusterName(), + assertThat(clusterInfoMonitoringDoc.getClusterName(), equalTo(client().admin().cluster().prepareState().setMetaData(true).get().getClusterName().value())); - assertThat(clusterInfoMarvelDoc.getVersion(), + assertThat(clusterInfoMonitoringDoc.getVersion(), equalTo(client().admin().cluster().prepareNodesInfo().get().getNodes().get(0).getVersion().toString())); - assertThat(clusterInfoMarvelDoc.getLicense(), notNullValue()); + assertThat(clusterInfoMonitoringDoc.getLicense(), notNullValue()); - assertNotNull(clusterInfoMarvelDoc.getClusterStats()); - assertThat(clusterInfoMarvelDoc.getClusterStats().getNodesStats().getCounts().getTotal(), + assertNotNull(clusterInfoMonitoringDoc.getClusterStats()); + assertThat(clusterInfoMonitoringDoc.getClusterStats().getNodesStats().getCounts().getTotal(), equalTo(internalCluster().getNodeNames().length)); // Check cluster stats document @@ -63,16 +62,16 @@ public class ClusterStatsCollectorTests extends AbstractCollectorTestCase { assertNotNull(monitoringDoc); assertThat(monitoringDoc, instanceOf(ClusterStatsMonitoringDoc.class)); - ClusterStatsMonitoringDoc clusterStatsMarvelDoc = (ClusterStatsMonitoringDoc) monitoringDoc; - assertThat(clusterStatsMarvelDoc.getMonitoringId(), equalTo(MonitoredSystem.ES.getSystem())); - assertThat(clusterStatsMarvelDoc.getMonitoringVersion(), equalTo(Version.CURRENT.toString())); - assertThat(clusterStatsMarvelDoc.getClusterUUID(), + ClusterStatsMonitoringDoc clusterStatsMonitoringDoc = (ClusterStatsMonitoringDoc) monitoringDoc; + assertThat(clusterStatsMonitoringDoc.getMonitoringId(), equalTo(MonitoredSystem.ES.getSystem())); + assertThat(clusterStatsMonitoringDoc.getMonitoringVersion(), equalTo(Version.CURRENT.toString())); + assertThat(clusterStatsMonitoringDoc.getClusterUUID(), equalTo(client().admin().cluster().prepareState().setMetaData(true).get().getState().metaData().clusterUUID())); - assertThat(clusterStatsMarvelDoc.getTimestamp(), greaterThan(0L)); - assertThat(clusterStatsMarvelDoc.getSourceNode(), notNullValue()); + assertThat(clusterStatsMonitoringDoc.getTimestamp(), greaterThan(0L)); + assertThat(clusterStatsMonitoringDoc.getSourceNode(), notNullValue()); - assertNotNull(clusterStatsMarvelDoc.getClusterStats()); - assertThat(clusterStatsMarvelDoc.getClusterStats().getNodesStats().getCounts().getTotal(), + assertNotNull(clusterStatsMonitoringDoc.getClusterStats()); + assertThat(clusterStatsMonitoringDoc.getClusterStats().getNodesStats().getCounts().getTotal(), equalTo(internalCluster().getNodeNames().length)); } diff --git a/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/collector/indices/IndexRecoveryCollectorTests.java b/elasticsearch/x-pack/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/agent/collector/indices/IndexRecoveryCollectorTests.java similarity index 84% rename from elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/collector/indices/IndexRecoveryCollectorTests.java rename to elasticsearch/x-pack/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/agent/collector/indices/IndexRecoveryCollectorTests.java index 20c07c55cb0..86c24fa2b25 100644 --- a/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/collector/indices/IndexRecoveryCollectorTests.java +++ b/elasticsearch/x-pack/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/agent/collector/indices/IndexRecoveryCollectorTests.java @@ -3,22 +3,23 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.marvel.agent.collector.indices; +package org.elasticsearch.xpack.monitoring.agent.collector.indices; import org.elasticsearch.Version; import org.elasticsearch.action.admin.indices.recovery.RecoveryResponse; -import org.elasticsearch.cluster.service.ClusterService; import org.elasticsearch.cluster.metadata.MetaData; +import org.elasticsearch.cluster.service.ClusterService; import org.elasticsearch.common.Strings; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.index.IndexNotFoundException; import org.elasticsearch.indices.recovery.RecoveryState; -import org.elasticsearch.marvel.MonitoringSettings; -import org.elasticsearch.marvel.MonitoredSystem; -import org.elasticsearch.marvel.agent.collector.AbstractCollectorTestCase; -import org.elasticsearch.marvel.agent.exporter.MonitoringDoc; -import org.elasticsearch.marvel.MonitoringLicensee; import org.elasticsearch.test.ESIntegTestCase.ClusterScope; +import org.elasticsearch.test.hamcrest.ElasticsearchAssertions; +import org.elasticsearch.xpack.monitoring.MonitoredSystem; +import org.elasticsearch.xpack.monitoring.MonitoringLicensee; +import org.elasticsearch.xpack.monitoring.MonitoringSettings; +import org.elasticsearch.xpack.monitoring.agent.collector.AbstractCollectorTestCase; +import org.elasticsearch.xpack.monitoring.agent.exporter.MonitoringDoc; import java.util.Collection; import java.util.List; @@ -26,7 +27,6 @@ import java.util.Map; import static org.elasticsearch.cluster.metadata.IndexMetaData.SETTING_NUMBER_OF_REPLICAS; import static org.elasticsearch.cluster.metadata.IndexMetaData.SETTING_NUMBER_OF_SHARDS; -import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertHitCount; import static org.hamcrest.Matchers.anyOf; import static org.hamcrest.Matchers.empty; @@ -65,7 +65,8 @@ public class IndexRecoveryCollectorTests extends AbstractCollectorTestCase { assertThat(results, is(empty())); logger.info("--> create index [{}] on node [{}]", indexName, node1); - assertAcked(prepareCreate(indexName, 1, Settings.builder().put(SETTING_NUMBER_OF_SHARDS, 3).put(SETTING_NUMBER_OF_REPLICAS, 1))); + ElasticsearchAssertions.assertAcked(prepareCreate(indexName, 1, + Settings.builder().put(SETTING_NUMBER_OF_SHARDS, 3).put(SETTING_NUMBER_OF_REPLICAS, 1))); logger.info("--> indexing sample data"); final int numDocs = between(50, 150); @@ -100,15 +101,15 @@ public class IndexRecoveryCollectorTests extends AbstractCollectorTestCase { assertNotNull(monitoringDoc); assertThat(monitoringDoc, instanceOf(IndexRecoveryMonitoringDoc.class)); - IndexRecoveryMonitoringDoc indexRecoveryMarvelDoc = (IndexRecoveryMonitoringDoc) monitoringDoc; - assertThat(indexRecoveryMarvelDoc.getMonitoringId(), equalTo(MonitoredSystem.ES.getSystem())); - assertThat(indexRecoveryMarvelDoc.getMonitoringVersion(), equalTo(Version.CURRENT.toString())); - assertThat(indexRecoveryMarvelDoc.getClusterUUID(), + IndexRecoveryMonitoringDoc indexRecoveryMonitoringDoc = (IndexRecoveryMonitoringDoc) monitoringDoc; + assertThat(indexRecoveryMonitoringDoc.getMonitoringId(), equalTo(MonitoredSystem.ES.getSystem())); + assertThat(indexRecoveryMonitoringDoc.getMonitoringVersion(), equalTo(Version.CURRENT.toString())); + assertThat(indexRecoveryMonitoringDoc.getClusterUUID(), equalTo(client().admin().cluster().prepareState().setMetaData(true).get().getState().metaData().clusterUUID())); - assertThat(indexRecoveryMarvelDoc.getTimestamp(), greaterThan(0L)); - assertThat(indexRecoveryMarvelDoc.getSourceNode(), notNullValue()); + assertThat(indexRecoveryMonitoringDoc.getTimestamp(), greaterThan(0L)); + assertThat(indexRecoveryMonitoringDoc.getSourceNode(), notNullValue()); - RecoveryResponse recovery = indexRecoveryMarvelDoc.getRecoveryResponse(); + RecoveryResponse recovery = indexRecoveryMonitoringDoc.getRecoveryResponse(); assertNotNull(recovery); Map> shards = recovery.shardRecoveryStates(); @@ -121,8 +122,10 @@ public class IndexRecoveryCollectorTests extends AbstractCollectorTestCase { for (RecoveryState shardRecovery : shardRecoveries) { assertThat(shard.getKey(), equalTo(indexName)); - assertThat(shardRecovery.getType(), anyOf(equalTo(RecoveryState.Type.PRIMARY_RELOCATION), equalTo(RecoveryState.Type.STORE), - equalTo(RecoveryState.Type.REPLICA), equalTo(RecoveryState.Type.SNAPSHOT))); + assertThat(shardRecovery.getType(), anyOf(equalTo(RecoveryState.Type.PRIMARY_RELOCATION), + equalTo(RecoveryState.Type.STORE), + equalTo(RecoveryState.Type.REPLICA), + equalTo(RecoveryState.Type.SNAPSHOT))); } } } diff --git a/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/collector/indices/IndexStatsCollectorTests.java b/elasticsearch/x-pack/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/agent/collector/indices/IndexStatsCollectorTests.java similarity index 86% rename from elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/collector/indices/IndexStatsCollectorTests.java rename to elasticsearch/x-pack/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/agent/collector/indices/IndexStatsCollectorTests.java index b66bfee4e50..bbfa57e01d4 100644 --- a/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/collector/indices/IndexStatsCollectorTests.java +++ b/elasticsearch/x-pack/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/agent/collector/indices/IndexStatsCollectorTests.java @@ -3,26 +3,25 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.marvel.agent.collector.indices; +package org.elasticsearch.xpack.monitoring.agent.collector.indices; import org.elasticsearch.Version; import org.elasticsearch.action.admin.indices.stats.IndexStats; -import org.elasticsearch.cluster.service.ClusterService; import org.elasticsearch.cluster.metadata.MetaData; +import org.elasticsearch.cluster.service.ClusterService; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.index.IndexNotFoundException; -import org.elasticsearch.marvel.MonitoringSettings; -import org.elasticsearch.marvel.MonitoredSystem; -import org.elasticsearch.marvel.agent.collector.AbstractCollectorTestCase; -import org.elasticsearch.marvel.agent.exporter.MonitoringDoc; -import org.elasticsearch.marvel.MonitoringLicensee; import org.elasticsearch.test.ESIntegTestCase.ClusterScope; +import org.elasticsearch.xpack.monitoring.MonitoredSystem; +import org.elasticsearch.xpack.monitoring.MonitoringLicensee; +import org.elasticsearch.xpack.monitoring.MonitoringSettings; +import org.elasticsearch.xpack.monitoring.agent.collector.AbstractCollectorTestCase; +import org.elasticsearch.xpack.monitoring.agent.exporter.MonitoringDoc; import java.util.Collection; import java.util.Iterator; import java.util.List; - import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertHitCount; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.greaterThan; @@ -98,15 +97,15 @@ public class IndexStatsCollectorTests extends AbstractCollectorTestCase { assertNotNull(monitoringDoc); assertThat(monitoringDoc, instanceOf(IndexStatsMonitoringDoc.class)); - IndexStatsMonitoringDoc indexStatsMarvelDoc = (IndexStatsMonitoringDoc) monitoringDoc; - assertThat(indexStatsMarvelDoc.getMonitoringId(), equalTo(MonitoredSystem.ES.getSystem())); - assertThat(indexStatsMarvelDoc.getMonitoringVersion(), equalTo(Version.CURRENT.toString())); - assertThat(indexStatsMarvelDoc.getClusterUUID(), + IndexStatsMonitoringDoc indexStatsMonitoringDoc = (IndexStatsMonitoringDoc) monitoringDoc; + assertThat(indexStatsMonitoringDoc.getMonitoringId(), equalTo(MonitoredSystem.ES.getSystem())); + assertThat(indexStatsMonitoringDoc.getMonitoringVersion(), equalTo(Version.CURRENT.toString())); + assertThat(indexStatsMonitoringDoc.getClusterUUID(), equalTo(client().admin().cluster().prepareState().setMetaData(true).get().getState().metaData().clusterUUID())); - assertThat(indexStatsMarvelDoc.getTimestamp(), greaterThan(0L)); - assertThat(indexStatsMarvelDoc.getSourceNode(), notNullValue()); + assertThat(indexStatsMonitoringDoc.getTimestamp(), greaterThan(0L)); + assertThat(indexStatsMonitoringDoc.getSourceNode(), notNullValue()); - IndexStats indexStats = indexStatsMarvelDoc.getIndexStats(); + IndexStats indexStats = indexStatsMonitoringDoc.getIndexStats(); assertNotNull(indexStats); assertThat(indexStats.getIndex(), equalTo(indexName)); @@ -158,14 +157,14 @@ public class IndexStatsCollectorTests extends AbstractCollectorTestCase { MonitoringDoc monitoringDoc = it.next(); assertThat(monitoringDoc, instanceOf(IndexStatsMonitoringDoc.class)); - IndexStatsMonitoringDoc indexStatsMarvelDoc = (IndexStatsMonitoringDoc) monitoringDoc; - IndexStats indexStats = indexStatsMarvelDoc.getIndexStats(); + IndexStatsMonitoringDoc indexStatsMonitoringDoc = (IndexStatsMonitoringDoc) monitoringDoc; + IndexStats indexStats = indexStatsMonitoringDoc.getIndexStats(); assertNotNull(indexStats); if (indexStats.getIndex().equals(indexPrefix + i)) { - assertThat(indexStatsMarvelDoc.getClusterUUID(), equalTo(clusterUUID)); - assertThat(indexStatsMarvelDoc.getTimestamp(), greaterThan(0L)); - assertThat(indexStatsMarvelDoc.getSourceNode(), notNullValue()); + assertThat(indexStatsMonitoringDoc.getClusterUUID(), equalTo(clusterUUID)); + assertThat(indexStatsMonitoringDoc.getTimestamp(), greaterThan(0L)); + assertThat(indexStatsMonitoringDoc.getSourceNode(), notNullValue()); assertThat(indexStats.getIndex(), equalTo(indexName)); assertNotNull(indexStats.getTotal().getDocs()); diff --git a/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/collector/indices/IndicesStatsCollectorTests.java b/elasticsearch/x-pack/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/agent/collector/indices/IndicesStatsCollectorTests.java similarity index 84% rename from elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/collector/indices/IndicesStatsCollectorTests.java rename to elasticsearch/x-pack/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/agent/collector/indices/IndicesStatsCollectorTests.java index 49f177354e7..bd4706ec065 100644 --- a/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/collector/indices/IndicesStatsCollectorTests.java +++ b/elasticsearch/x-pack/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/agent/collector/indices/IndicesStatsCollectorTests.java @@ -3,29 +3,28 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.marvel.agent.collector.indices; +package org.elasticsearch.xpack.monitoring.agent.collector.indices; import org.elasticsearch.Version; import org.elasticsearch.action.admin.indices.stats.IndexStats; import org.elasticsearch.action.admin.indices.stats.IndicesStatsResponse; -import org.elasticsearch.cluster.service.ClusterService; import org.elasticsearch.cluster.metadata.MetaData; +import org.elasticsearch.cluster.service.ClusterService; import org.elasticsearch.common.Strings; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.index.IndexNotFoundException; -import org.elasticsearch.marvel.MonitoringSettings; -import org.elasticsearch.marvel.MonitoredSystem; -import org.elasticsearch.marvel.agent.collector.AbstractCollectorTestCase; -import org.elasticsearch.marvel.agent.exporter.MonitoringDoc; -import org.elasticsearch.marvel.MonitoringLicensee; import org.elasticsearch.test.ESIntegTestCase.ClusterScope; +import org.elasticsearch.xpack.monitoring.MonitoredSystem; +import org.elasticsearch.xpack.monitoring.MonitoringLicensee; +import org.elasticsearch.xpack.monitoring.MonitoringSettings; +import org.elasticsearch.xpack.monitoring.agent.collector.AbstractCollectorTestCase; +import org.elasticsearch.xpack.monitoring.agent.exporter.MonitoringDoc; +import org.hamcrest.Matchers; import java.util.Collection; import java.util.List; - import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertHitCount; -import static org.hamcrest.Matchers.arrayWithSize; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.greaterThan; import static org.hamcrest.Matchers.hasSize; @@ -81,6 +80,7 @@ public class IndicesStatsCollectorTests extends AbstractCollectorTestCase { createIndex(indexName); securedEnsureGreen(indexName); + final int nbDocs = randomIntBetween(1, 20); for (int i = 0; i < nbDocs; i++) { client().prepareIndex(indexName, "test").setSource("num", i).get(); @@ -97,18 +97,18 @@ public class IndicesStatsCollectorTests extends AbstractCollectorTestCase { MonitoringDoc monitoringDoc = results.iterator().next(); assertThat(monitoringDoc, instanceOf(IndicesStatsMonitoringDoc.class)); - IndicesStatsMonitoringDoc indicesStatsMarvelDoc = (IndicesStatsMonitoringDoc) monitoringDoc; - assertThat(indicesStatsMarvelDoc.getClusterUUID(), equalTo(client().admin().cluster(). + IndicesStatsMonitoringDoc indicesStatsMonitoringDoc = (IndicesStatsMonitoringDoc) monitoringDoc; + assertThat(indicesStatsMonitoringDoc.getClusterUUID(), equalTo(client().admin().cluster(). prepareState().setMetaData(true).get().getState().metaData().clusterUUID())); - assertThat(indicesStatsMarvelDoc.getTimestamp(), greaterThan(0L)); - assertThat(indicesStatsMarvelDoc.getSourceNode(), notNullValue()); + assertThat(indicesStatsMonitoringDoc.getTimestamp(), greaterThan(0L)); + assertThat(indicesStatsMonitoringDoc.getSourceNode(), notNullValue()); - IndicesStatsResponse indicesStats = indicesStatsMarvelDoc.getIndicesStats(); + IndicesStatsResponse indicesStats = indicesStatsMonitoringDoc.getIndicesStats(); assertNotNull(indicesStats); assertThat(indicesStats.getIndices().keySet(), hasSize(1)); IndexStats indexStats = indicesStats.getIndex(indexName); - assertThat(indexStats.getShards(), arrayWithSize(getNumShards(indexName).totalNumShards)); + assertThat(indexStats.getShards(), Matchers.arrayWithSize(getNumShards(indexName).totalNumShards)); } public void testIndicesStatsCollectorMultipleIndices() throws Exception { @@ -143,14 +143,14 @@ public class IndicesStatsCollectorTests extends AbstractCollectorTestCase { MonitoringDoc monitoringDoc = results.iterator().next(); assertThat(monitoringDoc, instanceOf(IndicesStatsMonitoringDoc.class)); - IndicesStatsMonitoringDoc indicesStatsMarvelDoc = (IndicesStatsMonitoringDoc) monitoringDoc; - assertThat(indicesStatsMarvelDoc.getMonitoringId(), equalTo(MonitoredSystem.ES.getSystem())); - assertThat(indicesStatsMarvelDoc.getMonitoringVersion(), equalTo(Version.CURRENT.toString())); - assertThat(indicesStatsMarvelDoc.getClusterUUID(), + IndicesStatsMonitoringDoc indicesStatsMonitoringDoc = (IndicesStatsMonitoringDoc) monitoringDoc; + assertThat(indicesStatsMonitoringDoc.getMonitoringId(), equalTo(MonitoredSystem.ES.getSystem())); + assertThat(indicesStatsMonitoringDoc.getMonitoringVersion(), equalTo(Version.CURRENT.toString())); + assertThat(indicesStatsMonitoringDoc.getClusterUUID(), equalTo(client().admin().cluster().prepareState().setMetaData(true).get().getState().metaData().clusterUUID())); - assertThat(indicesStatsMarvelDoc.getTimestamp(), greaterThan(0L)); + assertThat(indicesStatsMonitoringDoc.getTimestamp(), greaterThan(0L)); - IndicesStatsResponse indicesStats = indicesStatsMarvelDoc.getIndicesStats(); + IndicesStatsResponse indicesStats = indicesStatsMonitoringDoc.getIndicesStats(); assertNotNull(indicesStats); assertThat(indicesStats.getIndices().keySet(), hasSize(nbIndices)); } diff --git a/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/collector/node/NodeStatsCollectorTests.java b/elasticsearch/x-pack/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/agent/collector/node/NodeStatsCollectorTests.java similarity index 73% rename from elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/collector/node/NodeStatsCollectorTests.java rename to elasticsearch/x-pack/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/agent/collector/node/NodeStatsCollectorTests.java index 50e94c6aa5a..c2a9067f579 100644 --- a/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/collector/node/NodeStatsCollectorTests.java +++ b/elasticsearch/x-pack/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/agent/collector/node/NodeStatsCollectorTests.java @@ -3,21 +3,21 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.marvel.agent.collector.node; +package org.elasticsearch.xpack.monitoring.agent.collector.node; import org.elasticsearch.Version; import org.elasticsearch.bootstrap.BootstrapInfo; -import org.elasticsearch.cluster.service.ClusterService; import org.elasticsearch.cluster.routing.allocation.decider.DiskThresholdDecider; +import org.elasticsearch.cluster.service.ClusterService; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.env.NodeEnvironment; -import org.elasticsearch.marvel.MonitoringSettings; -import org.elasticsearch.marvel.MonitoredSystem; -import org.elasticsearch.marvel.agent.collector.AbstractCollectorTestCase; -import org.elasticsearch.marvel.agent.exporter.MonitoringDoc; -import org.elasticsearch.marvel.MonitoringLicensee; -import org.elasticsearch.xpack.security.InternalClient; import org.elasticsearch.test.ESIntegTestCase.ClusterScope; +import org.elasticsearch.xpack.monitoring.MonitoredSystem; +import org.elasticsearch.xpack.monitoring.MonitoringLicensee; +import org.elasticsearch.xpack.monitoring.MonitoringSettings; +import org.elasticsearch.xpack.monitoring.agent.collector.AbstractCollectorTestCase; +import org.elasticsearch.xpack.monitoring.agent.exporter.MonitoringDoc; +import org.elasticsearch.xpack.security.InternalClient; import java.util.Collection; @@ -44,22 +44,22 @@ public class NodeStatsCollectorTests extends AbstractCollectorTestCase { assertNotNull(monitoringDoc); assertThat(monitoringDoc, instanceOf(NodeStatsMonitoringDoc.class)); - NodeStatsMonitoringDoc nodeStatsMarvelDoc = (NodeStatsMonitoringDoc) monitoringDoc; - assertThat(nodeStatsMarvelDoc.getMonitoringId(), equalTo(MonitoredSystem.ES.getSystem())); - assertThat(nodeStatsMarvelDoc.getMonitoringVersion(), equalTo(Version.CURRENT.toString())); - assertThat(nodeStatsMarvelDoc.getClusterUUID(), + NodeStatsMonitoringDoc nodeStatsMonitoringDoc = (NodeStatsMonitoringDoc) monitoringDoc; + assertThat(nodeStatsMonitoringDoc.getMonitoringId(), equalTo(MonitoredSystem.ES.getSystem())); + assertThat(nodeStatsMonitoringDoc.getMonitoringVersion(), equalTo(Version.CURRENT.toString())); + assertThat(nodeStatsMonitoringDoc.getClusterUUID(), equalTo(client().admin().cluster().prepareState().setMetaData(true).get().getState().metaData().clusterUUID())); - assertThat(nodeStatsMarvelDoc.getTimestamp(), greaterThan(0L)); - assertThat(nodeStatsMarvelDoc.getSourceNode(), notNullValue()); + assertThat(nodeStatsMonitoringDoc.getTimestamp(), greaterThan(0L)); + assertThat(nodeStatsMonitoringDoc.getSourceNode(), notNullValue()); - assertThat(nodeStatsMarvelDoc.getNodeId(), + assertThat(nodeStatsMonitoringDoc.getNodeId(), equalTo(internalCluster().getInstance(ClusterService.class, node).localNode().getId())); - assertThat(nodeStatsMarvelDoc.isNodeMaster(), equalTo(node.equals(internalCluster().getMasterName()))); - assertThat(nodeStatsMarvelDoc.isMlockall(), equalTo(BootstrapInfo.isMemoryLocked())); - assertNotNull(nodeStatsMarvelDoc.isDiskThresholdDeciderEnabled()); - assertNotNull(nodeStatsMarvelDoc.getDiskThresholdWaterMarkHigh()); + assertThat(nodeStatsMonitoringDoc.isNodeMaster(), equalTo(node.equals(internalCluster().getMasterName()))); + assertThat(nodeStatsMonitoringDoc.isMlockall(), equalTo(BootstrapInfo.isMemoryLocked())); + assertNotNull(nodeStatsMonitoringDoc.isDiskThresholdDeciderEnabled()); + assertNotNull(nodeStatsMonitoringDoc.getDiskThresholdWaterMarkHigh()); - assertNotNull(nodeStatsMarvelDoc.getNodeStats()); + assertNotNull(nodeStatsMonitoringDoc.getNodeStats()); } } diff --git a/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/collector/shards/ShardsCollectorTests.java b/elasticsearch/x-pack/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/agent/collector/shards/ShardsCollectorTests.java similarity index 85% rename from elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/collector/shards/ShardsCollectorTests.java rename to elasticsearch/x-pack/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/agent/collector/shards/ShardsCollectorTests.java index f873790ea7c..6ea921ed419 100644 --- a/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/collector/shards/ShardsCollectorTests.java +++ b/elasticsearch/x-pack/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/agent/collector/shards/ShardsCollectorTests.java @@ -3,18 +3,18 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.marvel.agent.collector.shards; +package org.elasticsearch.xpack.monitoring.agent.collector.shards; import org.elasticsearch.Version; -import org.elasticsearch.cluster.service.ClusterService; import org.elasticsearch.cluster.ClusterState; import org.elasticsearch.cluster.routing.ShardRouting; +import org.elasticsearch.cluster.service.ClusterService; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.marvel.MonitoringSettings; -import org.elasticsearch.marvel.MonitoredSystem; -import org.elasticsearch.marvel.agent.collector.AbstractCollectorTestCase; -import org.elasticsearch.marvel.agent.exporter.MonitoringDoc; -import org.elasticsearch.marvel.MonitoringLicensee; +import org.elasticsearch.xpack.monitoring.MonitoredSystem; +import org.elasticsearch.xpack.monitoring.MonitoringLicensee; +import org.elasticsearch.xpack.monitoring.MonitoringSettings; +import org.elasticsearch.xpack.monitoring.agent.collector.AbstractCollectorTestCase; +import org.elasticsearch.xpack.monitoring.agent.exporter.MonitoringDoc; import java.util.Collection; @@ -67,17 +67,17 @@ public class ShardsCollectorTests extends AbstractCollectorTestCase { assertNotNull(monitoringDoc); assertThat(monitoringDoc, instanceOf(ShardMonitoringDoc.class)); - ShardMonitoringDoc shardMarvelDoc = (ShardMonitoringDoc) monitoringDoc; - assertThat(shardMarvelDoc.getMonitoringId(), equalTo(MonitoredSystem.ES.getSystem())); - assertThat(shardMarvelDoc.getMonitoringVersion(), equalTo(Version.CURRENT.toString())); - assertThat(shardMarvelDoc.getClusterUUID(), equalTo(clusterState.metaData().clusterUUID())); - assertThat(shardMarvelDoc.getTimestamp(), greaterThan(0L)); - assertThat(shardMarvelDoc.getSourceNode(), notNullValue()); - assertThat(shardMarvelDoc.getClusterStateUUID(), equalTo(clusterState.stateUUID())); + ShardMonitoringDoc shardMonitoringDoc = (ShardMonitoringDoc) monitoringDoc; + assertThat(shardMonitoringDoc.getMonitoringId(), equalTo(MonitoredSystem.ES.getSystem())); + assertThat(shardMonitoringDoc.getMonitoringVersion(), equalTo(Version.CURRENT.toString())); + assertThat(shardMonitoringDoc.getClusterUUID(), equalTo(clusterState.metaData().clusterUUID())); + assertThat(shardMonitoringDoc.getTimestamp(), greaterThan(0L)); + assertThat(shardMonitoringDoc.getSourceNode(), notNullValue()); + assertThat(shardMonitoringDoc.getClusterStateUUID(), equalTo(clusterState.stateUUID())); - ShardRouting shardRouting = shardMarvelDoc.getShardRouting(); + ShardRouting shardRouting = shardMonitoringDoc.getShardRouting(); assertNotNull(shardRouting); - assertThat(shardMarvelDoc.getShardRouting().assignedToNode(), is(true)); + assertThat(shardMonitoringDoc.getShardRouting().assignedToNode(), is(true)); if (shardRouting.primary()) { primaries++; @@ -145,7 +145,7 @@ public class ShardsCollectorTests extends AbstractCollectorTestCase { } } - // Checks that a correct number of ShardMarvelDoc documents has been created for each index + // Checks that a correct number of ShardMonitoringDoc documents has been created for each index int[] shards = new int[nbIndices]; for (MonitoringDoc monitoringDoc : results) { ShardRouting routing = ((ShardMonitoringDoc) monitoringDoc).getShardRouting(); diff --git a/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/exporter/AbstractExporterTemplateTestCase.java b/elasticsearch/x-pack/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/agent/exporter/AbstractExporterTemplateTestCase.java similarity index 91% rename from elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/exporter/AbstractExporterTemplateTestCase.java rename to elasticsearch/x-pack/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/agent/exporter/AbstractExporterTemplateTestCase.java index 588cd7d76be..a0ce443e710 100644 --- a/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/exporter/AbstractExporterTemplateTestCase.java +++ b/elasticsearch/x-pack/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/agent/exporter/AbstractExporterTemplateTestCase.java @@ -3,17 +3,17 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.marvel.agent.exporter; +package org.elasticsearch.xpack.monitoring.agent.exporter; import org.elasticsearch.Version; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.marvel.MonitoredSystem; -import org.elasticsearch.marvel.MonitoringSettings; -import org.elasticsearch.marvel.agent.collector.Collector; -import org.elasticsearch.marvel.agent.collector.cluster.ClusterStatsCollector; -import org.elasticsearch.marvel.test.MarvelIntegTestCase; import org.elasticsearch.test.ESIntegTestCase.ClusterScope; +import org.elasticsearch.xpack.monitoring.MonitoredSystem; +import org.elasticsearch.xpack.monitoring.MonitoringSettings; +import org.elasticsearch.xpack.monitoring.agent.collector.Collector; +import org.elasticsearch.xpack.monitoring.agent.collector.cluster.ClusterStatsCollector; +import org.elasticsearch.xpack.monitoring.test.MonitoringIntegTestCase; import java.io.IOException; import java.util.Map; @@ -23,7 +23,7 @@ import static org.elasticsearch.test.ESIntegTestCase.Scope.TEST; import static org.hamcrest.Matchers.notNullValue; @ClusterScope(scope = TEST, numDataNodes = 0, numClientNodes = 0, transportClientRatio = 0.0) -public abstract class AbstractExporterTemplateTestCase extends MarvelIntegTestCase { +public abstract class AbstractExporterTemplateTestCase extends MonitoringIntegTestCase { @Override protected Settings nodeSettings(int nodeOrdinal) { @@ -127,18 +127,18 @@ public abstract class AbstractExporterTemplateTestCase extends MarvelIntegTestCa } private String dataTemplateName() { - MockDataIndexNameResolver resolver = new MockDataIndexNameResolver(MarvelTemplateUtils.TEMPLATE_VERSION); + MockDataIndexNameResolver resolver = new MockDataIndexNameResolver(MonitoringTemplateUtils.TEMPLATE_VERSION); return resolver.templateName(); } private String indexTemplateName() { MockTimestampedIndexNameResolver resolver = - new MockTimestampedIndexNameResolver(MonitoredSystem.ES, exporterSettings(), MarvelTemplateUtils.TEMPLATE_VERSION); + new MockTimestampedIndexNameResolver(MonitoredSystem.ES, exporterSettings(), MonitoringTemplateUtils.TEMPLATE_VERSION); return resolver.templateName(); } private String currentDataIndexName() { - MockDataIndexNameResolver resolver = new MockDataIndexNameResolver(MarvelTemplateUtils.TEMPLATE_VERSION); + MockDataIndexNameResolver resolver = new MockDataIndexNameResolver(MonitoringTemplateUtils.TEMPLATE_VERSION); return resolver.index(null); } @@ -147,7 +147,7 @@ public abstract class AbstractExporterTemplateTestCase extends MarvelIntegTestCa doc.setTimestamp(System.currentTimeMillis()); MockTimestampedIndexNameResolver resolver = - new MockTimestampedIndexNameResolver(MonitoredSystem.ES, exporterSettings(), MarvelTemplateUtils.TEMPLATE_VERSION); + new MockTimestampedIndexNameResolver(MonitoredSystem.ES, exporterSettings(), MonitoringTemplateUtils.TEMPLATE_VERSION); return resolver.index(doc); } diff --git a/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/exporter/ExportersTests.java b/elasticsearch/x-pack/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/agent/exporter/ExportersTests.java similarity index 98% rename from elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/exporter/ExportersTests.java rename to elasticsearch/x-pack/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/agent/exporter/ExportersTests.java index 42dc9074729..4751dd7bd83 100644 --- a/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/exporter/ExportersTests.java +++ b/elasticsearch/x-pack/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/agent/exporter/ExportersTests.java @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.marvel.agent.exporter; +package org.elasticsearch.xpack.monitoring.agent.exporter; import org.elasticsearch.Version; import org.elasticsearch.client.Client; @@ -15,12 +15,12 @@ import org.elasticsearch.common.settings.ClusterSettings; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.SettingsException; import org.elasticsearch.common.util.concurrent.AbstractRunnable; -import org.elasticsearch.marvel.MonitoringSettings; -import org.elasticsearch.marvel.MonitoredSystem; -import org.elasticsearch.marvel.agent.exporter.local.LocalExporter; -import org.elasticsearch.marvel.cleaner.CleanerService; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.xpack.common.init.proxy.ClientProxy; +import org.elasticsearch.xpack.monitoring.MonitoredSystem; +import org.elasticsearch.xpack.monitoring.MonitoringSettings; +import org.elasticsearch.xpack.monitoring.agent.exporter.local.LocalExporter; +import org.elasticsearch.xpack.monitoring.cleaner.CleanerService; import org.junit.Before; import java.util.ArrayList; diff --git a/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/exporter/MonitoringDocTests.java b/elasticsearch/x-pack/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/agent/exporter/MonitoringDocTests.java similarity index 99% rename from elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/exporter/MonitoringDocTests.java rename to elasticsearch/x-pack/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/agent/exporter/MonitoringDocTests.java index f33892c3b58..ca79844fd0a 100644 --- a/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/exporter/MonitoringDocTests.java +++ b/elasticsearch/x-pack/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/agent/exporter/MonitoringDocTests.java @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.marvel.agent.exporter; +package org.elasticsearch.xpack.monitoring.agent.exporter; import org.elasticsearch.Version; import org.elasticsearch.cluster.node.DiscoveryNode; diff --git a/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/exporter/MarvelTemplateUtilsTests.java b/elasticsearch/x-pack/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/agent/exporter/MonitoringTemplateUtilsTests.java similarity index 70% rename from elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/exporter/MarvelTemplateUtilsTests.java rename to elasticsearch/x-pack/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/agent/exporter/MonitoringTemplateUtilsTests.java index c70566898b8..c7e02b39e2f 100644 --- a/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/exporter/MarvelTemplateUtilsTests.java +++ b/elasticsearch/x-pack/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/agent/exporter/MonitoringTemplateUtilsTests.java @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.marvel.agent.exporter; +package org.elasticsearch.xpack.monitoring.agent.exporter; import org.elasticsearch.test.ESTestCase; @@ -14,19 +14,19 @@ import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.greaterThan; import static org.hamcrest.Matchers.notNullValue; -public class MarvelTemplateUtilsTests extends ESTestCase { +public class MonitoringTemplateUtilsTests extends ESTestCase { public void testLoadTemplate() throws IOException { - String source = MarvelTemplateUtils.loadTemplate("test"); + String source = MonitoringTemplateUtils.loadTemplate("test"); assertThat(source, notNullValue()); assertThat(source.length(), greaterThan(0)); assertTemplate(source, equalTo("{\n" + - " \"template\": \".monitoring-data-" + MarvelTemplateUtils.TEMPLATE_VERSION + "\",\n" + + " \"template\": \".monitoring-data-" + MonitoringTemplateUtils.TEMPLATE_VERSION + "\",\n" + " \"mappings\": {\n" + " \"type_1\": {\n" + " \"_meta\": {\n" + - " \"template.version\": \"" + MarvelTemplateUtils.TEMPLATE_VERSION + "\"\n" + + " \"template.version\": \"" + MonitoringTemplateUtils.TEMPLATE_VERSION + "\"\n" + " }\n" + " }\n" + " }\n" + diff --git a/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/exporter/http/HttpExporterTemplateTests.java b/elasticsearch/x-pack/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/agent/exporter/http/HttpExporterTemplateTests.java similarity index 96% rename from elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/exporter/http/HttpExporterTemplateTests.java rename to elasticsearch/x-pack/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/agent/exporter/http/HttpExporterTemplateTests.java index dae09e0131f..1264f243021 100644 --- a/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/exporter/http/HttpExporterTemplateTests.java +++ b/elasticsearch/x-pack/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/agent/exporter/http/HttpExporterTemplateTests.java @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.marvel.agent.exporter.http; +package org.elasticsearch.xpack.monitoring.agent.exporter.http; import com.squareup.okhttp.mockwebserver.Dispatcher; import com.squareup.okhttp.mockwebserver.MockResponse; @@ -18,8 +18,8 @@ import org.elasticsearch.common.bytes.BytesArray; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.util.concurrent.ConcurrentCollections; -import org.elasticsearch.marvel.agent.exporter.AbstractExporterTemplateTestCase; -import org.elasticsearch.marvel.agent.exporter.Exporter; +import org.elasticsearch.xpack.monitoring.agent.exporter.AbstractExporterTemplateTestCase; +import org.elasticsearch.xpack.monitoring.agent.exporter.Exporter; import org.junit.After; import org.junit.Before; diff --git a/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/exporter/http/HttpExporterTests.java b/elasticsearch/x-pack/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/agent/exporter/http/HttpExporterTests.java similarity index 93% rename from elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/exporter/http/HttpExporterTests.java rename to elasticsearch/x-pack/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/agent/exporter/http/HttpExporterTests.java index 4953c196b33..38d9ee1d54a 100644 --- a/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/exporter/http/HttpExporterTests.java +++ b/elasticsearch/x-pack/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/agent/exporter/http/HttpExporterTests.java @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.marvel.agent.exporter.http; +package org.elasticsearch.xpack.monitoring.agent.exporter.http; import com.squareup.okhttp.mockwebserver.MockResponse; import com.squareup.okhttp.mockwebserver.MockWebServer; @@ -24,17 +24,17 @@ import org.elasticsearch.common.bytes.BytesArray; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.transport.DummyTransportAddress; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.marvel.MonitoringSettings; -import org.elasticsearch.marvel.MonitoredSystem; -import org.elasticsearch.marvel.agent.collector.cluster.ClusterStateMonitoringDoc; -import org.elasticsearch.marvel.agent.collector.indices.IndexRecoveryMonitoringDoc; -import org.elasticsearch.marvel.agent.exporter.Exporters; -import org.elasticsearch.marvel.agent.exporter.MarvelTemplateUtils; -import org.elasticsearch.marvel.agent.exporter.MonitoringDoc; -import org.elasticsearch.marvel.agent.resolver.bulk.MonitoringBulkTimestampedResolver; -import org.elasticsearch.marvel.test.MarvelIntegTestCase; import org.elasticsearch.test.ESIntegTestCase; import org.elasticsearch.test.ESIntegTestCase.Scope; +import org.elasticsearch.xpack.monitoring.MonitoredSystem; +import org.elasticsearch.xpack.monitoring.MonitoringSettings; +import org.elasticsearch.xpack.monitoring.agent.collector.cluster.ClusterStateMonitoringDoc; +import org.elasticsearch.xpack.monitoring.agent.collector.indices.IndexRecoveryMonitoringDoc; +import org.elasticsearch.xpack.monitoring.agent.exporter.Exporters; +import org.elasticsearch.xpack.monitoring.agent.exporter.MonitoringDoc; +import org.elasticsearch.xpack.monitoring.agent.exporter.MonitoringTemplateUtils; +import org.elasticsearch.xpack.monitoring.agent.resolver.bulk.MonitoringBulkTimestampedResolver; +import org.elasticsearch.xpack.monitoring.test.MonitoringIntegTestCase; import org.hamcrest.Matchers; import org.joda.time.format.DateTimeFormat; import org.junit.After; @@ -58,7 +58,7 @@ import static org.hamcrest.Matchers.is; import static org.hamcrest.Matchers.notNullValue; @ESIntegTestCase.ClusterScope(scope = Scope.TEST, numDataNodes = 0, numClientNodes = 0, transportClientRatio = 0.0) -public class HttpExporterTests extends MarvelIntegTestCase { +public class HttpExporterTests extends MonitoringIntegTestCase { private int webPort; private MockWebServer webServer; @@ -103,7 +103,7 @@ public class HttpExporterTests extends MarvelIntegTestCase { internalCluster().startNode(builder); final int nbDocs = randomIntBetween(1, 25); - export(newRandomMarvelDocs(nbDocs)); + export(newRandomMonitoringDocs(nbDocs)); assertThat(webServer.getRequestCount(), equalTo(2 + monitoringTemplates().size() * 2)); @@ -176,7 +176,7 @@ public class HttpExporterTests extends MarvelIntegTestCase { logger.info("--> exporting data"); HttpExporter exporter = getExporter(agentNode); assertThat(exporter.supportedClusterVersion, is(false)); - export(Collections.singletonList(newRandomMarvelDoc())); + export(Collections.singletonList(newRandomMonitoringDoc())); assertThat(exporter.supportedClusterVersion, is(true)); assertThat(webServer.getRequestCount(), equalTo(2 + monitoringTemplates().size() * 2)); @@ -239,7 +239,7 @@ public class HttpExporterTests extends MarvelIntegTestCase { enqueueResponse(secondWebServer, 200, "{\"errors\": false, \"msg\": \"successful bulk request\"}"); logger.info("--> exporting a second event"); - export(Collections.singletonList(newRandomMarvelDoc())); + export(Collections.singletonList(newRandomMonitoringDoc())); assertThat(secondWebServer.getRequestCount(), equalTo(2 + monitoringTemplates().size() * 2 - 1)); @@ -320,7 +320,7 @@ public class HttpExporterTests extends MarvelIntegTestCase { HttpExporter exporter = getExporter(agentNode); - MonitoringDoc doc = newRandomMarvelDoc(); + MonitoringDoc doc = newRandomMonitoringDoc(); export(Collections.singletonList(doc)); final int expectedRequests = 2 + monitoringTemplates().size() * 2; @@ -367,10 +367,10 @@ public class HttpExporterTests extends MarvelIntegTestCase { } enqueueResponse(200, "{\"errors\": false, \"msg\": \"successful bulk request\"}"); - doc = newRandomMarvelDoc(); + doc = newRandomMonitoringDoc(); export(Collections.singletonList(doc)); - String expectedMarvelIndex = ".monitoring-es-" + MarvelTemplateUtils.TEMPLATE_VERSION + "-" + String expectedMonitoringIndex = ".monitoring-es-" + MonitoringTemplateUtils.TEMPLATE_VERSION + "-" + DateTimeFormat.forPattern(newTimeFormat).withZoneUTC().print(doc.getTimestamp()); assertThat(webServer.getRequestCount(), equalTo(expectedRequests + 2 + monitoringTemplates().size())); @@ -389,12 +389,12 @@ public class HttpExporterTests extends MarvelIntegTestCase { assertThat(recordedRequest.getMethod(), equalTo("POST")); assertThat(recordedRequest.getPath(), equalTo("/_bulk")); - logger.info("--> checks that the document in the bulk request is indexed in [{}]", expectedMarvelIndex); + logger.info("--> checks that the document in the bulk request is indexed in [{}]", expectedMonitoringIndex); bytes = recordedRequest.getBody().readByteArray(); data = XContentHelper.convertToMap(new BytesArray(bytes), false).v2(); index = (Map) data.get("index"); - assertThat(index.get("_index"), equalTo(expectedMarvelIndex)); + assertThat(index.get("_index"), equalTo(expectedMonitoringIndex)); } public void testLoadRemoteClusterVersion() throws IOException { @@ -434,7 +434,7 @@ public class HttpExporterTests extends MarvelIntegTestCase { return (HttpExporter) exporters.iterator().next(); } - private MonitoringDoc newRandomMarvelDoc() { + private MonitoringDoc newRandomMonitoringDoc() { if (randomBoolean()) { IndexRecoveryMonitoringDoc doc = new IndexRecoveryMonitoringDoc(MonitoredSystem.ES.getSystem(), Version.CURRENT.toString()); doc.setClusterUUID(internalCluster().getClusterName()); @@ -453,10 +453,10 @@ public class HttpExporterTests extends MarvelIntegTestCase { } } - private List newRandomMarvelDocs(int nb) { + private List newRandomMonitoringDocs(int nb) { List docs = new ArrayList<>(nb); for (int i = 0; i < nb; i++) { - docs.add(newRandomMarvelDoc()); + docs.add(newRandomMonitoringDoc()); } return docs; } diff --git a/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/exporter/http/HttpExporterUtilsTests.java b/elasticsearch/x-pack/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/agent/exporter/http/HttpExporterUtilsTests.java similarity index 98% rename from elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/exporter/http/HttpExporterUtilsTests.java rename to elasticsearch/x-pack/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/agent/exporter/http/HttpExporterUtilsTests.java index c70bf43a41e..be9584626cf 100644 --- a/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/exporter/http/HttpExporterUtilsTests.java +++ b/elasticsearch/x-pack/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/agent/exporter/http/HttpExporterUtilsTests.java @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.marvel.agent.exporter.http; +package org.elasticsearch.xpack.monitoring.agent.exporter.http; import org.elasticsearch.test.ESTestCase; diff --git a/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/exporter/local/LocalExporterTemplateTests.java b/elasticsearch/x-pack/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/agent/exporter/local/LocalExporterTemplateTests.java similarity index 87% rename from elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/exporter/local/LocalExporterTemplateTests.java rename to elasticsearch/x-pack/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/agent/exporter/local/LocalExporterTemplateTests.java index 8ec319f2c8d..725e1bdd39d 100644 --- a/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/exporter/local/LocalExporterTemplateTests.java +++ b/elasticsearch/x-pack/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/agent/exporter/local/LocalExporterTemplateTests.java @@ -3,10 +3,10 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.marvel.agent.exporter.local; +package org.elasticsearch.xpack.monitoring.agent.exporter.local; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.marvel.agent.exporter.AbstractExporterTemplateTestCase; +import org.elasticsearch.xpack.monitoring.agent.exporter.AbstractExporterTemplateTestCase; import java.util.Collections; @@ -34,7 +34,7 @@ public class LocalExporterTemplateTests extends AbstractExporterTemplateTestCase @Override protected void assertTemplateExist(String name) throws Exception { waitNoPendingTasksOnAll(); - waitForMarvelTemplate(name); + waitForMonitoringTemplate(name); } @Override diff --git a/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/exporter/local/LocalExporterTests.java b/elasticsearch/x-pack/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/agent/exporter/local/LocalExporterTests.java similarity index 81% rename from elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/exporter/local/LocalExporterTests.java rename to elasticsearch/x-pack/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/agent/exporter/local/LocalExporterTests.java index 59080b27735..b27e0451808 100644 --- a/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/exporter/local/LocalExporterTests.java +++ b/elasticsearch/x-pack/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/agent/exporter/local/LocalExporterTests.java @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.marvel.agent.exporter.local; +package org.elasticsearch.xpack.monitoring.agent.exporter.local; import org.elasticsearch.ElasticsearchException; import org.elasticsearch.Version; @@ -14,19 +14,19 @@ import org.elasticsearch.cluster.health.ClusterHealthStatus; import org.elasticsearch.cluster.node.DiscoveryNode; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.transport.DummyTransportAddress; -import org.elasticsearch.marvel.MonitoringSettings; -import org.elasticsearch.marvel.MonitoredSystem; -import org.elasticsearch.marvel.agent.collector.cluster.ClusterStateMonitoringDoc; -import org.elasticsearch.marvel.agent.collector.indices.IndexRecoveryMonitoringDoc; -import org.elasticsearch.marvel.agent.exporter.ExportException; -import org.elasticsearch.marvel.agent.exporter.Exporter; -import org.elasticsearch.marvel.agent.exporter.Exporters; -import org.elasticsearch.marvel.agent.exporter.MarvelTemplateUtils; -import org.elasticsearch.marvel.agent.exporter.MonitoringDoc; -import org.elasticsearch.marvel.test.MarvelIntegTestCase; import org.elasticsearch.search.SearchHit; import org.elasticsearch.test.ESIntegTestCase.ClusterScope; import org.elasticsearch.test.ESIntegTestCase.Scope; +import org.elasticsearch.xpack.monitoring.MonitoredSystem; +import org.elasticsearch.xpack.monitoring.MonitoringSettings; +import org.elasticsearch.xpack.monitoring.agent.collector.cluster.ClusterStateMonitoringDoc; +import org.elasticsearch.xpack.monitoring.agent.collector.indices.IndexRecoveryMonitoringDoc; +import org.elasticsearch.xpack.monitoring.agent.exporter.ExportException; +import org.elasticsearch.xpack.monitoring.agent.exporter.Exporter; +import org.elasticsearch.xpack.monitoring.agent.exporter.Exporters; +import org.elasticsearch.xpack.monitoring.agent.exporter.MonitoringDoc; +import org.elasticsearch.xpack.monitoring.agent.exporter.MonitoringTemplateUtils; +import org.elasticsearch.xpack.monitoring.test.MonitoringIntegTestCase; import org.joda.time.format.DateTimeFormat; import org.junit.After; @@ -47,7 +47,7 @@ import static org.hamcrest.Matchers.is; import static org.hamcrest.Matchers.notNullValue; @ClusterScope(scope = Scope.TEST, numDataNodes = 0, numClientNodes = 0, transportClientRatio = 0.0) -public class LocalExporterTests extends MarvelIntegTestCase { +public class LocalExporterTests extends MonitoringIntegTestCase { @Override protected Settings nodeSettings(int nodeOrdinal) { @@ -59,8 +59,8 @@ public class LocalExporterTests extends MarvelIntegTestCase { @After public void cleanup() throws Exception { - updateMarvelInterval(-1, TimeUnit.SECONDS); - wipeMarvelIndices(); + updateMonitoringInterval(-1, TimeUnit.SECONDS); + wipeMonitoringIndices(); } public void testSimpleExport() throws Exception { @@ -71,19 +71,19 @@ public class LocalExporterTests extends MarvelIntegTestCase { securedEnsureGreen(); logger.debug("--> exporting a single monitoring doc"); - export(Collections.singletonList(newRandomMarvelDoc())); - awaitMarvelDocsCount(is(1L)); + export(Collections.singletonList(newRandomMonitoringDoc())); + awaitMonitoringDocsCount(is(1L)); - deleteMarvelIndices(); + deleteMonitoringIndices(); final List monitoringDocs = new ArrayList<>(); for (int i=0; i < randomIntBetween(2, 50); i++) { - monitoringDocs.add(newRandomMarvelDoc()); + monitoringDocs.add(newRandomMonitoringDoc()); } logger.debug("--> exporting {} monitoring docs", monitoringDocs.size()); export(monitoringDocs); - awaitMarvelDocsCount(is((long) monitoringDocs.size())); + awaitMonitoringDocsCount(is((long) monitoringDocs.size())); SearchResponse response = client().prepareSearch(MONITORING_INDICES_PREFIX + "*").get(); for (SearchHit hit : response.getHits().hits()) { @@ -101,10 +101,10 @@ public class LocalExporterTests extends MarvelIntegTestCase { securedEnsureGreen(); // start collecting - updateMarvelInterval(3L, TimeUnit.SECONDS); + updateMonitoringInterval(3L, TimeUnit.SECONDS); // lets wait until the monitoring template will be installed - waitForMarvelTemplates(); + waitForMonitoringTemplates(); } public void testIndexTimestampFormat() throws Exception { @@ -119,8 +119,8 @@ public class LocalExporterTests extends MarvelIntegTestCase { LocalExporter exporter = getLocalExporter("_local"); // now lets test that the index name resolver works with a doc - MonitoringDoc doc = newRandomMarvelDoc(); - String indexName = ".monitoring-es-" + MarvelTemplateUtils.TEMPLATE_VERSION + "-" + MonitoringDoc doc = newRandomMonitoringDoc(); + String indexName = ".monitoring-es-" + MonitoringTemplateUtils.TEMPLATE_VERSION + "-" + DateTimeFormat.forPattern(timeFormat).withZoneUTC().print(doc.getTimestamp()); assertThat(exporter.getResolvers().getResolver(doc).index(doc), equalTo(indexName)); @@ -132,7 +132,7 @@ public class LocalExporterTests extends MarvelIntegTestCase { timeFormat = randomFrom("dd", "dd.MM.YYYY", "dd.MM"); updateClusterSettings(Settings.builder().put("xpack.monitoring.agent.exporters._local.index.name.time_format", timeFormat)); exporter = getLocalExporter("_local"); // we need to get it again.. as it was rebuilt - indexName = ".monitoring-es-" + MarvelTemplateUtils.TEMPLATE_VERSION + "-" + indexName = ".monitoring-es-" + MonitoringTemplateUtils.TEMPLATE_VERSION + "-" + DateTimeFormat.forPattern(timeFormat).withZoneUTC().print(doc.getTimestamp()); assertThat(exporter.getResolvers().getResolver(doc).index(doc), equalTo(indexName)); @@ -150,8 +150,8 @@ public class LocalExporterTests extends MarvelIntegTestCase { securedEnsureGreen(); logger.debug("--> exporting a single monitoring doc"); - export(Collections.singletonList(newRandomMarvelDoc())); - awaitMarvelDocsCount(is(1L)); + export(Collections.singletonList(newRandomMonitoringDoc())); + awaitMonitoringDocsCount(is(1L)); logger.debug("--> closing monitoring indices"); assertAcked(client().admin().indices().prepareClose(MONITORING_INDICES_PREFIX + "*").get()); @@ -161,7 +161,7 @@ public class LocalExporterTests extends MarvelIntegTestCase { LocalExporter exporter = getLocalExporter("_local"); LocalBulk bulk = (LocalBulk) exporter.openBulk(); - bulk.add(Collections.singletonList(newRandomMarvelDoc())); + bulk.add(Collections.singletonList(newRandomMonitoringDoc())); bulk.close(true); } catch (ElasticsearchException e) { @@ -189,16 +189,11 @@ public class LocalExporterTests extends MarvelIntegTestCase { final Exporter exporter = internalCluster().getInstance(Exporters.class).getExporter(name); assertThat(exporter, notNullValue()); assertThat(exporter, instanceOf(LocalExporter.class)); - assertBusy(new Runnable() { - @Override - public void run() { - assertThat(exporter.openBulk(), notNullValue()); - } - }); + assertBusy(() -> assertThat(exporter.openBulk(), notNullValue())); return (LocalExporter) exporter; } - private MonitoringDoc newRandomMarvelDoc() { + private MonitoringDoc newRandomMonitoringDoc() { if (randomBoolean()) { IndexRecoveryMonitoringDoc doc = new IndexRecoveryMonitoringDoc(MonitoredSystem.ES.getSystem(), Version.CURRENT.toString()); doc.setClusterUUID(internalCluster().getClusterName()); diff --git a/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/resolver/DataResolverTests.java b/elasticsearch/x-pack/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/agent/resolver/DataResolverTests.java similarity index 84% rename from elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/resolver/DataResolverTests.java rename to elasticsearch/x-pack/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/agent/resolver/DataResolverTests.java index 471234ed3eb..a32dfd87196 100644 --- a/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/resolver/DataResolverTests.java +++ b/elasticsearch/x-pack/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/agent/resolver/DataResolverTests.java @@ -3,15 +3,15 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.marvel.agent.resolver; +package org.elasticsearch.xpack.monitoring.agent.resolver; import org.elasticsearch.Version; import org.elasticsearch.cluster.node.DiscoveryNode; import org.elasticsearch.common.transport.DummyTransportAddress; import org.elasticsearch.common.xcontent.ToXContent; import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.marvel.agent.exporter.MarvelTemplateUtils; -import org.elasticsearch.marvel.agent.exporter.MonitoringDoc; +import org.elasticsearch.xpack.monitoring.agent.exporter.MonitoringDoc; +import org.elasticsearch.xpack.monitoring.agent.exporter.MonitoringTemplateUtils; import java.io.IOException; @@ -27,7 +27,7 @@ public class DataResolverTests extends MonitoringIndexNameResolverTestCase { } @Override - protected MonitoringDoc newMarvelDoc() { + protected MonitoringDoc newMonitoringDoc() { MonitoringDoc doc = new MonitoringDoc(randomMonitoringId(), randomAsciiOfLength(2)); doc.setClusterUUID(randomAsciiOfLength(5)); doc.setTimestamp(Math.abs(randomLong())); @@ -51,7 +51,7 @@ public class DataResolverTests extends MonitoringIndexNameResolverTestCase { } public void testDataResolver() { - assertThat(newDataResolver().index(newMarvelDoc()), equalTo(".monitoring-data-" + MarvelTemplateUtils.TEMPLATE_VERSION)); + assertThat(newDataResolver().index(newMonitoringDoc()), equalTo(".monitoring-data-" + MonitoringTemplateUtils.TEMPLATE_VERSION)); } private MonitoringIndexNameResolver.Data newDataResolver() { diff --git a/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/resolver/MonitoringIndexNameResolverTestCase.java b/elasticsearch/x-pack/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/agent/resolver/MonitoringIndexNameResolverTestCase.java similarity index 77% rename from elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/resolver/MonitoringIndexNameResolverTestCase.java rename to elasticsearch/x-pack/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/agent/resolver/MonitoringIndexNameResolverTestCase.java index 00e8a8d818a..65ba185f884 100644 --- a/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/resolver/MonitoringIndexNameResolverTestCase.java +++ b/elasticsearch/x-pack/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/agent/resolver/MonitoringIndexNameResolverTestCase.java @@ -3,28 +3,28 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.marvel.agent.resolver; +package org.elasticsearch.xpack.monitoring.agent.resolver; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.xcontent.XContentHelper; import org.elasticsearch.common.xcontent.XContentType; import org.elasticsearch.common.xcontent.support.XContentMapValues; -import org.elasticsearch.marvel.MonitoredSystem; -import org.elasticsearch.marvel.agent.exporter.MarvelTemplateUtils; -import org.elasticsearch.marvel.agent.exporter.MonitoringDoc; import org.elasticsearch.test.ESTestCase; +import org.elasticsearch.xpack.monitoring.MonitoredSystem; +import org.elasticsearch.xpack.monitoring.agent.exporter.MonitoringDoc; import java.io.IOException; import java.util.HashSet; import java.util.Map; import java.util.Set; -import static org.elasticsearch.marvel.agent.resolver.MonitoringIndexNameResolver.DELIMITER; -import static org.elasticsearch.marvel.agent.resolver.MonitoringIndexNameResolver.Fields.CLUSTER_UUID; -import static org.elasticsearch.marvel.agent.resolver.MonitoringIndexNameResolver.Fields.SOURCE_NODE; -import static org.elasticsearch.marvel.agent.resolver.MonitoringIndexNameResolver.Fields.TIMESTAMP; -import static org.elasticsearch.marvel.agent.resolver.MonitoringIndexNameResolver.PREFIX; +import static org.elasticsearch.xpack.monitoring.agent.exporter.MonitoringTemplateUtils.TEMPLATE_VERSION; +import static org.elasticsearch.xpack.monitoring.agent.resolver.MonitoringIndexNameResolver.DELIMITER; +import static org.elasticsearch.xpack.monitoring.agent.resolver.MonitoringIndexNameResolver.Fields.CLUSTER_UUID; +import static org.elasticsearch.xpack.monitoring.agent.resolver.MonitoringIndexNameResolver.Fields.SOURCE_NODE; +import static org.elasticsearch.xpack.monitoring.agent.resolver.MonitoringIndexNameResolver.Fields.TIMESTAMP; +import static org.elasticsearch.xpack.monitoring.agent.resolver.MonitoringIndexNameResolver.PREFIX; import static org.hamcrest.Matchers.allOf; import static org.hamcrest.Matchers.anyOf; import static org.hamcrest.Matchers.emptyArray; @@ -47,7 +47,7 @@ public abstract class MonitoringIndexNameResolverTestCase { @Override - protected MonitoringBulkDoc newMarvelDoc() { + protected MonitoringBulkDoc newMonitoringDoc() { MonitoringBulkDoc doc = new MonitoringBulkDoc(MonitoredSystem.KIBANA.getSystem(), Version.CURRENT.toString(), MonitoringIndex.TIMESTAMPED, "kibana_stats", null, new BytesArray("{\"field1\" : \"value1\"}")); @@ -56,7 +56,7 @@ public class MonitoringBulkTimestampedResolverTests } public void testMonitoringBulkResolver() throws Exception { - MonitoringBulkDoc doc = newMarvelDoc(); + MonitoringBulkDoc doc = newMonitoringDoc(); MonitoringBulkTimestampedResolver resolver = newResolver(doc); assertThat(resolver.index(doc), equalTo(".monitoring-kibana-2-2015.07.22")); diff --git a/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/resolver/cluster/ClusterInfoResolverTests.java b/elasticsearch/x-pack/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/agent/resolver/cluster/ClusterInfoResolverTests.java similarity index 85% rename from elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/resolver/cluster/ClusterInfoResolverTests.java rename to elasticsearch/x-pack/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/agent/resolver/cluster/ClusterInfoResolverTests.java index d0982ec6705..788a201d9c6 100644 --- a/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/resolver/cluster/ClusterInfoResolverTests.java +++ b/elasticsearch/x-pack/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/agent/resolver/cluster/ClusterInfoResolverTests.java @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.marvel.agent.resolver.cluster; +package org.elasticsearch.xpack.monitoring.agent.resolver.cluster; import org.elasticsearch.Version; import org.elasticsearch.action.admin.cluster.stats.ClusterStatsResponse; @@ -14,9 +14,9 @@ import org.elasticsearch.common.transport.DummyTransportAddress; import org.elasticsearch.common.unit.TimeValue; import org.elasticsearch.common.xcontent.XContentType; import org.elasticsearch.license.core.License; -import org.elasticsearch.marvel.agent.collector.cluster.ClusterInfoMonitoringDoc; -import org.elasticsearch.marvel.agent.exporter.MarvelTemplateUtils; -import org.elasticsearch.marvel.agent.resolver.MonitoringIndexNameResolverTestCase; +import org.elasticsearch.xpack.monitoring.agent.collector.cluster.ClusterInfoMonitoringDoc; +import org.elasticsearch.xpack.monitoring.agent.exporter.MonitoringTemplateUtils; +import org.elasticsearch.xpack.monitoring.agent.resolver.MonitoringIndexNameResolverTestCase; import java.util.Collections; import java.util.UUID; @@ -28,7 +28,7 @@ import static org.hamcrest.Matchers.equalTo; public class ClusterInfoResolverTests extends MonitoringIndexNameResolverTestCase { @Override - protected ClusterInfoMonitoringDoc newMarvelDoc() { + protected ClusterInfoMonitoringDoc newMonitoringDoc() { try { License.Builder licenseBuilder = License.builder() .uid(UUID.randomUUID().toString()) @@ -50,7 +50,7 @@ public class ClusterInfoResolverTests extends MonitoringIndexNameResolverTestCas .getDefault(Settings.EMPTY), randomAsciiOfLength(5), Collections.emptyList(), Collections.emptyList())); return doc; } catch (Exception e) { - throw new IllegalStateException("Failed to generated random ClusterInfoMarvelDoc", e); + throw new IllegalStateException("Failed to generated random ClusterInfoMonitoringDoc", e); } } @@ -62,11 +62,11 @@ public class ClusterInfoResolverTests extends MonitoringIndexNameResolverTestCas public void testClusterInfoResolver() throws Exception { String clusterUUID = UUID.randomUUID().toString(); - ClusterInfoMonitoringDoc doc = newMarvelDoc(); + ClusterInfoMonitoringDoc doc = newMonitoringDoc(); doc.setClusterUUID(clusterUUID); ClusterInfoResolver resolver = newResolver(); - assertThat(resolver.index(doc), equalTo(".monitoring-data-" + MarvelTemplateUtils.TEMPLATE_VERSION)); + assertThat(resolver.index(doc), equalTo(".monitoring-data-" + MonitoringTemplateUtils.TEMPLATE_VERSION)); assertThat(resolver.type(doc), equalTo(ClusterInfoResolver.TYPE)); assertThat(resolver.id(doc), equalTo(clusterUUID)); diff --git a/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/resolver/cluster/ClusterInfoTests.java b/elasticsearch/x-pack/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/agent/resolver/cluster/ClusterInfoTests.java similarity index 87% rename from elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/resolver/cluster/ClusterInfoTests.java rename to elasticsearch/x-pack/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/agent/resolver/cluster/ClusterInfoTests.java index fabb79d69f6..4da93724385 100644 --- a/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/resolver/cluster/ClusterInfoTests.java +++ b/elasticsearch/x-pack/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/agent/resolver/cluster/ClusterInfoTests.java @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.marvel.agent.resolver.cluster; +package org.elasticsearch.xpack.monitoring.agent.resolver.cluster; import org.elasticsearch.Version; import org.elasticsearch.action.get.GetResponse; @@ -11,12 +11,12 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.index.query.QueryBuilders; import org.elasticsearch.license.core.License; -import org.elasticsearch.marvel.MonitoringSettings; -import org.elasticsearch.marvel.agent.collector.cluster.ClusterStatsCollector; -import org.elasticsearch.marvel.agent.exporter.MarvelTemplateUtils; -import org.elasticsearch.marvel.agent.resolver.MonitoringIndexNameResolver; -import org.elasticsearch.marvel.test.MarvelIntegTestCase; import org.elasticsearch.test.ESIntegTestCase.ClusterScope; +import org.elasticsearch.xpack.monitoring.MonitoringSettings; +import org.elasticsearch.xpack.monitoring.agent.collector.cluster.ClusterStatsCollector; +import org.elasticsearch.xpack.monitoring.agent.exporter.MonitoringTemplateUtils; +import org.elasticsearch.xpack.monitoring.agent.resolver.MonitoringIndexNameResolver; +import org.elasticsearch.xpack.monitoring.test.MonitoringIntegTestCase; import org.junit.After; import org.junit.Before; @@ -33,7 +33,7 @@ import static org.hamcrest.Matchers.not; import static org.hamcrest.Matchers.notNullValue; @ClusterScope(scope = TEST) -public class ClusterInfoTests extends MarvelIntegTestCase { +public class ClusterInfoTests extends MonitoringIntegTestCase { @Override protected Settings nodeSettings(int nodeOrdinal) { @@ -46,13 +46,13 @@ public class ClusterInfoTests extends MarvelIntegTestCase { @Before public void init() throws Exception { - updateMarvelInterval(3L, TimeUnit.SECONDS); + updateMonitoringInterval(3L, TimeUnit.SECONDS); } @After public void cleanup() throws Exception { - updateMarvelInterval(-1, TimeUnit.SECONDS); - wipeMarvelIndices(); + updateMonitoringInterval(-1, TimeUnit.SECONDS); + wipeMonitoringIndices(); } public void testClusterInfo() throws Exception { @@ -62,11 +62,11 @@ public class ClusterInfoTests extends MarvelIntegTestCase { assertTrue(Strings.hasText(clusterUUID)); logger.debug("--> waiting for the monitoring data index to be created (it should have been created by the ClusterInfoCollector)"); - String dataIndex = ".monitoring-data-" + MarvelTemplateUtils.TEMPLATE_VERSION; + String dataIndex = ".monitoring-data-" + MonitoringTemplateUtils.TEMPLATE_VERSION; awaitIndexExists(dataIndex); logger.debug("--> waiting for cluster info collector to collect data"); - awaitMarvelDocsCount(equalTo(1L), ClusterInfoResolver.TYPE); + awaitMonitoringDocsCount(equalTo(1L), ClusterInfoResolver.TYPE); logger.debug("--> retrieving cluster info document"); GetResponse response = client().prepareGet(dataIndex, ClusterInfoResolver.TYPE, clusterUUID).get(); @@ -117,7 +117,7 @@ public class ClusterInfoTests extends MarvelIntegTestCase { assertThat(clusterStats, instanceOf(Map.class)); assertThat(((Map) clusterStats).size(), greaterThan(0)); - waitForMarvelTemplates(); + waitForMonitoringTemplates(); logger.debug("--> check that the cluster_info is not indexed"); securedFlush(); diff --git a/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/resolver/cluster/ClusterStateNodeResolverTests.java b/elasticsearch/x-pack/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/agent/resolver/cluster/ClusterStateNodeResolverTests.java similarity index 80% rename from elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/resolver/cluster/ClusterStateNodeResolverTests.java rename to elasticsearch/x-pack/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/agent/resolver/cluster/ClusterStateNodeResolverTests.java index a3a10ea24d5..b714a1bf4a6 100644 --- a/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/resolver/cluster/ClusterStateNodeResolverTests.java +++ b/elasticsearch/x-pack/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/agent/resolver/cluster/ClusterStateNodeResolverTests.java @@ -3,15 +3,15 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.marvel.agent.resolver.cluster; +package org.elasticsearch.xpack.monitoring.agent.resolver.cluster; import org.elasticsearch.Version; import org.elasticsearch.cluster.node.DiscoveryNode; import org.elasticsearch.common.transport.DummyTransportAddress; import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.marvel.agent.collector.cluster.ClusterStateNodeMonitoringDoc; -import org.elasticsearch.marvel.agent.exporter.MarvelTemplateUtils; -import org.elasticsearch.marvel.agent.resolver.MonitoringIndexNameResolverTestCase; +import org.elasticsearch.xpack.monitoring.agent.collector.cluster.ClusterStateNodeMonitoringDoc; +import org.elasticsearch.xpack.monitoring.agent.exporter.MonitoringTemplateUtils; +import org.elasticsearch.xpack.monitoring.agent.resolver.MonitoringIndexNameResolverTestCase; import java.util.UUID; @@ -24,7 +24,7 @@ public class ClusterStateNodeResolverTests extends MonitoringIndexNameResolverTestCase { @Override - protected ClusterStateNodeMonitoringDoc newMarvelDoc() { + protected ClusterStateNodeMonitoringDoc newMonitoringDoc() { ClusterStateNodeMonitoringDoc doc = new ClusterStateNodeMonitoringDoc(randomMonitoringId(), randomAsciiOfLength(2)); doc.setClusterUUID(randomAsciiOfLength(5)); doc.setTimestamp(Math.abs(randomLong())); @@ -48,13 +48,13 @@ public class ClusterStateNodeResolverTests extends final String nodeId = UUID.randomUUID().toString(); final String stateUUID = UUID.randomUUID().toString(); - ClusterStateNodeMonitoringDoc doc = newMarvelDoc(); + ClusterStateNodeMonitoringDoc doc = newMonitoringDoc(); doc.setNodeId(nodeId); doc.setStateUUID(stateUUID); doc.setTimestamp(1437580442979L); ClusterStateNodeResolver resolver = newResolver(); - assertThat(resolver.index(doc), equalTo(".monitoring-es-" + MarvelTemplateUtils.TEMPLATE_VERSION + "-2015.07.22")); + assertThat(resolver.index(doc), equalTo(".monitoring-es-" + MonitoringTemplateUtils.TEMPLATE_VERSION + "-2015.07.22")); assertThat(resolver.type(doc), equalTo(ClusterStateNodeResolver.TYPE)); assertThat(resolver.id(doc), nullValue()); diff --git a/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/resolver/cluster/ClusterStateResolverTests.java b/elasticsearch/x-pack/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/agent/resolver/cluster/ClusterStateResolverTests.java similarity index 84% rename from elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/resolver/cluster/ClusterStateResolverTests.java rename to elasticsearch/x-pack/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/agent/resolver/cluster/ClusterStateResolverTests.java index a1e349c2387..b157d72d3d3 100644 --- a/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/resolver/cluster/ClusterStateResolverTests.java +++ b/elasticsearch/x-pack/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/agent/resolver/cluster/ClusterStateResolverTests.java @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.marvel.agent.resolver.cluster; +package org.elasticsearch.xpack.monitoring.agent.resolver.cluster; import org.elasticsearch.Version; import org.elasticsearch.cluster.ClusterName; @@ -14,9 +14,9 @@ import org.elasticsearch.cluster.node.DiscoveryNodes; import org.elasticsearch.common.transport.DummyTransportAddress; import org.elasticsearch.common.transport.LocalTransportAddress; import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.marvel.agent.collector.cluster.ClusterStateMonitoringDoc; -import org.elasticsearch.marvel.agent.exporter.MarvelTemplateUtils; -import org.elasticsearch.marvel.agent.resolver.MonitoringIndexNameResolverTestCase; +import org.elasticsearch.xpack.monitoring.agent.collector.cluster.ClusterStateMonitoringDoc; +import org.elasticsearch.xpack.monitoring.agent.exporter.MonitoringTemplateUtils; +import org.elasticsearch.xpack.monitoring.agent.resolver.MonitoringIndexNameResolverTestCase; import java.io.IOException; @@ -28,7 +28,7 @@ import static org.hamcrest.Matchers.nullValue; public class ClusterStateResolverTests extends MonitoringIndexNameResolverTestCase { @Override - protected ClusterStateMonitoringDoc newMarvelDoc() { + protected ClusterStateMonitoringDoc newMonitoringDoc() { ClusterStateMonitoringDoc doc = new ClusterStateMonitoringDoc(randomMonitoringId(), randomAsciiOfLength(2)); doc.setClusterUUID(randomAsciiOfLength(5)); doc.setTimestamp(Math.abs(randomLong())); @@ -50,11 +50,11 @@ public class ClusterStateResolverTests extends MonitoringIndexNameResolverTestCa } public void testClusterStateResolver() throws IOException { - ClusterStateMonitoringDoc doc = newMarvelDoc(); + ClusterStateMonitoringDoc doc = newMonitoringDoc(); doc.setTimestamp(1437580442979L); ClusterStateResolver resolver = newResolver(); - assertThat(resolver.index(doc), equalTo(".monitoring-es-" + MarvelTemplateUtils.TEMPLATE_VERSION + "-2015.07.22")); + assertThat(resolver.index(doc), equalTo(".monitoring-es-" + MonitoringTemplateUtils.TEMPLATE_VERSION + "-2015.07.22")); assertThat(resolver.type(doc), equalTo(ClusterStateResolver.TYPE)); assertThat(resolver.id(doc), nullValue()); diff --git a/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/resolver/cluster/ClusterStateTests.java b/elasticsearch/x-pack/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/agent/resolver/cluster/ClusterStateTests.java similarity index 84% rename from elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/resolver/cluster/ClusterStateTests.java rename to elasticsearch/x-pack/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/agent/resolver/cluster/ClusterStateTests.java index 037423ed882..68431bb3209 100644 --- a/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/resolver/cluster/ClusterStateTests.java +++ b/elasticsearch/x-pack/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/agent/resolver/cluster/ClusterStateTests.java @@ -3,21 +3,22 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.marvel.agent.resolver.cluster; +package org.elasticsearch.xpack.monitoring.agent.resolver.cluster; import org.apache.lucene.util.LuceneTestCase; import org.elasticsearch.action.search.SearchResponse; import org.elasticsearch.cluster.node.DiscoveryNodes; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.index.query.QueryBuilders; -import org.elasticsearch.marvel.MonitoringSettings; -import org.elasticsearch.marvel.agent.collector.cluster.ClusterStateCollector; -import org.elasticsearch.marvel.agent.exporter.MarvelTemplateUtils; -import org.elasticsearch.marvel.agent.resolver.MonitoringIndexNameResolver; -import org.elasticsearch.marvel.test.MarvelIntegTestCase; import org.elasticsearch.search.SearchHit; import org.elasticsearch.test.ESIntegTestCase.ClusterScope; import org.elasticsearch.test.ESIntegTestCase.Scope; +import org.elasticsearch.xpack.monitoring.MonitoredSystem; +import org.elasticsearch.xpack.monitoring.MonitoringSettings; +import org.elasticsearch.xpack.monitoring.agent.collector.cluster.ClusterStateCollector; +import org.elasticsearch.xpack.monitoring.agent.exporter.MonitoringTemplateUtils; +import org.elasticsearch.xpack.monitoring.agent.resolver.MonitoringIndexNameResolver; +import org.elasticsearch.xpack.monitoring.test.MonitoringIntegTestCase; import org.junit.After; import org.junit.Before; @@ -25,9 +26,6 @@ import java.util.Map; import java.util.concurrent.TimeUnit; import static org.elasticsearch.index.query.QueryBuilders.matchQuery; -import static org.elasticsearch.marvel.MonitoredSystem.ES; -import static org.elasticsearch.marvel.agent.exporter.MarvelTemplateUtils.TEMPLATE_VERSION; -import static org.elasticsearch.marvel.agent.resolver.MonitoringIndexNameResolver.Fields.SOURCE_NODE; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertHitCount; import static org.hamcrest.Matchers.greaterThan; import static org.hamcrest.Matchers.greaterThanOrEqualTo; @@ -36,7 +34,7 @@ import static org.hamcrest.core.Is.is; //test is just too slow, please fix it to not be sleep-based @LuceneTestCase.BadApple(bugUrl = "https://github.com/elastic/x-plugins/issues/1007") @ClusterScope(scope = Scope.TEST) -public class ClusterStateTests extends MarvelIntegTestCase { +public class ClusterStateTests extends MonitoringIntegTestCase { private int randomInt = randomInt(); @@ -53,19 +51,19 @@ public class ClusterStateTests extends MarvelIntegTestCase { @Before public void init() throws Exception { - updateMarvelInterval(3L, TimeUnit.SECONDS); - waitForMarvelIndices(); + updateMonitoringInterval(3L, TimeUnit.SECONDS); + waitForMonitoringIndices(); } @After public void cleanup() throws Exception { - updateMarvelInterval(-1, TimeUnit.SECONDS); - wipeMarvelIndices(); + updateMonitoringInterval(-1, TimeUnit.SECONDS); + wipeMonitoringIndices(); } public void testClusterState() throws Exception { logger.debug("--> waiting for documents to be collected"); - awaitMarvelDocsCount(greaterThan(0L), ClusterStateResolver.TYPE); + awaitMonitoringDocsCount(greaterThan(0L), ClusterStateResolver.TYPE); logger.debug("--> searching for monitoring documents of type [{}]", ClusterStateResolver.TYPE); SearchResponse response = client().prepareSearch().setTypes(ClusterStateResolver.TYPE).get(); @@ -90,7 +88,7 @@ public class ClusterStateTests extends MarvelIntegTestCase { */ public void testNoNodesIndexing() throws Exception { logger.debug("--> waiting for documents to be collected"); - awaitMarvelDocsCount(greaterThan(0L), ClusterStateResolver.TYPE); + awaitMonitoringDocsCount(greaterThan(0L), ClusterStateResolver.TYPE); logger.debug("--> searching for monitoring documents of type [{}]", ClusterStateResolver.TYPE); SearchResponse response = client().prepareSearch().setTypes(ClusterStateResolver.TYPE).get(); @@ -109,14 +107,14 @@ public class ClusterStateTests extends MarvelIntegTestCase { final long nbNodes = internalCluster().size(); MonitoringIndexNameResolver.Timestamped timestampedResolver = - new MockTimestampedIndexNameResolver(ES, Settings.EMPTY, MarvelTemplateUtils.TEMPLATE_VERSION); + new MockTimestampedIndexNameResolver(MonitoredSystem.ES, Settings.EMPTY, MonitoringTemplateUtils.TEMPLATE_VERSION); assertNotNull(timestampedResolver); String timestampedIndex = timestampedResolver.indexPattern(); awaitIndexExists(timestampedIndex); logger.debug("--> waiting for documents to be collected"); - awaitMarvelDocsCount(greaterThanOrEqualTo(nbNodes), ClusterStateNodeResolver.TYPE); + awaitMonitoringDocsCount(greaterThanOrEqualTo(nbNodes), ClusterStateNodeResolver.TYPE); logger.debug("--> searching for monitoring documents of type [{}]", ClusterStateNodeResolver.TYPE); SearchResponse response = client().prepareSearch(timestampedIndex).setTypes(ClusterStateNodeResolver.TYPE).get(); @@ -126,7 +124,7 @@ public class ClusterStateTests extends MarvelIntegTestCase { String[] filters = { MonitoringIndexNameResolver.Fields.CLUSTER_UUID, MonitoringIndexNameResolver.Fields.TIMESTAMP, - SOURCE_NODE, + MonitoringIndexNameResolver.Fields.SOURCE_NODE, ClusterStateNodeResolver.Fields.STATE_UUID, ClusterStateNodeResolver.Fields.NODE, ClusterStateNodeResolver.Fields.NODE + "." @@ -145,7 +143,7 @@ public class ClusterStateTests extends MarvelIntegTestCase { assertThat(client().prepareSearch().setSize(0) .setIndices(timestampedIndex) .setTypes(ClusterStateNodeResolver.TYPE) - .setQuery(QueryBuilders.matchQuery(SOURCE_NODE + ".attributes.custom", randomInt)) + .setQuery(QueryBuilders.matchQuery(MonitoringIndexNameResolver.Fields.SOURCE_NODE + ".attributes.custom", randomInt)) .get().getHits().getTotalHits(), greaterThan(0L)); logger.debug("--> cluster state nodes successfully collected"); @@ -154,14 +152,14 @@ public class ClusterStateTests extends MarvelIntegTestCase { public void testDiscoveryNodes() throws Exception { final long nbNodes = internalCluster().size(); - MonitoringIndexNameResolver.Data dataResolver = new MockDataIndexNameResolver(MarvelTemplateUtils.TEMPLATE_VERSION); + MonitoringIndexNameResolver.Data dataResolver = new MockDataIndexNameResolver(MonitoringTemplateUtils.TEMPLATE_VERSION); assertNotNull(dataResolver); String dataIndex = dataResolver.indexPattern(); awaitIndexExists(dataIndex); logger.debug("--> waiting for documents to be collected"); - awaitMarvelDocsCount(greaterThanOrEqualTo(nbNodes), DiscoveryNodeResolver.TYPE); + awaitMonitoringDocsCount(greaterThanOrEqualTo(nbNodes), DiscoveryNodeResolver.TYPE); logger.debug("--> searching for monitoring documents of type [{}]", DiscoveryNodeResolver.TYPE); SearchResponse response = client().prepareSearch(dataIndex).setTypes(DiscoveryNodeResolver.TYPE).get(); diff --git a/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/resolver/cluster/ClusterStatsResolverTests.java b/elasticsearch/x-pack/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/agent/resolver/cluster/ClusterStatsResolverTests.java similarity index 89% rename from elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/resolver/cluster/ClusterStatsResolverTests.java rename to elasticsearch/x-pack/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/agent/resolver/cluster/ClusterStatsResolverTests.java index acccd2da2c9..f9ac50ce672 100644 --- a/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/resolver/cluster/ClusterStatsResolverTests.java +++ b/elasticsearch/x-pack/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/agent/resolver/cluster/ClusterStatsResolverTests.java @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.marvel.agent.resolver.cluster; +package org.elasticsearch.xpack.monitoring.agent.resolver.cluster; import org.elasticsearch.Version; import org.elasticsearch.action.admin.cluster.node.info.NodeInfo; @@ -33,9 +33,6 @@ import org.elasticsearch.index.shard.ShardId; import org.elasticsearch.index.shard.ShardPath; import org.elasticsearch.indices.NodeIndicesStats; import org.elasticsearch.ingest.IngestInfo; -import org.elasticsearch.marvel.agent.collector.cluster.ClusterStatsMonitoringDoc; -import org.elasticsearch.marvel.agent.exporter.MarvelTemplateUtils; -import org.elasticsearch.marvel.agent.resolver.MonitoringIndexNameResolverTestCase; import org.elasticsearch.monitor.fs.FsInfo; import org.elasticsearch.monitor.jvm.JvmInfo; import org.elasticsearch.monitor.os.DummyOsInfo; @@ -43,6 +40,9 @@ import org.elasticsearch.monitor.process.ProcessInfo; import org.elasticsearch.threadpool.ThreadPool; import org.elasticsearch.threadpool.ThreadPoolInfo; import org.elasticsearch.transport.TransportInfo; +import org.elasticsearch.xpack.monitoring.agent.collector.cluster.ClusterStatsMonitoringDoc; +import org.elasticsearch.xpack.monitoring.agent.exporter.MonitoringTemplateUtils; +import org.elasticsearch.xpack.monitoring.agent.resolver.MonitoringIndexNameResolverTestCase; import java.nio.file.Path; import java.util.Collections; @@ -59,7 +59,7 @@ import static org.hamcrest.Matchers.nullValue; public class ClusterStatsResolverTests extends MonitoringIndexNameResolverTestCase { @Override - protected ClusterStatsMonitoringDoc newMarvelDoc() { + protected ClusterStatsMonitoringDoc newMonitoringDoc() { ClusterStatsMonitoringDoc doc = new ClusterStatsMonitoringDoc(randomMonitoringId(), randomAsciiOfLength(2)); doc.setClusterUUID(randomAsciiOfLength(5)); doc.setTimestamp(Math.abs(randomLong())); @@ -74,11 +74,11 @@ public class ClusterStatsResolverTests extends MonitoringIndexNameResolverTestCa } public void testClusterStatsResolver() throws Exception { - ClusterStatsMonitoringDoc doc = newMarvelDoc(); + ClusterStatsMonitoringDoc doc = newMonitoringDoc(); doc.setTimestamp(1437580442979L); ClusterStatsResolver resolver = newResolver(); - assertThat(resolver.index(doc), equalTo(".monitoring-es-" + MarvelTemplateUtils.TEMPLATE_VERSION + "-2015.07.22")); + assertThat(resolver.index(doc), equalTo(".monitoring-es-" + MonitoringTemplateUtils.TEMPLATE_VERSION + "-2015.07.22")); assertThat(resolver.type(doc), equalTo(ClusterStatsResolver.TYPE)); assertThat(resolver.id(doc), nullValue()); @@ -90,7 +90,7 @@ public class ClusterStatsResolverTests extends MonitoringIndexNameResolverTestCa } /** - * @return a testing {@link ClusterStatsResponse} used to resolve a marvel document. + * @return a testing {@link ClusterStatsResponse} used to resolve a monitoring document. */ private ClusterStatsResponse randomClusterStats() { List responses = Collections.singletonList( @@ -103,7 +103,7 @@ public class ClusterStatsResolverTests extends MonitoringIndexNameResolverTestCa } /** - * @return a random {@link NodeInfo} used to resolve a marvel document. + * @return a random {@link NodeInfo} used to resolve a monitoring document. */ private NodeInfo randomNodeInfo() { BoundTransportAddress transportAddress = new BoundTransportAddress(new TransportAddress[]{DummyTransportAddress.INSTANCE}, @@ -118,7 +118,7 @@ public class ClusterStatsResolverTests extends MonitoringIndexNameResolverTestCa } /** - * @return a random {@link NodeStats} used to resolve a marvel document. + * @return a random {@link NodeStats} used to resolve a monitoring document. */ private NodeStats randomNodeStats() { Index index = new Index("test", UUID.randomUUID().toString()); @@ -133,7 +133,7 @@ public class ClusterStatsResolverTests extends MonitoringIndexNameResolverTestCa } /** - * @return a random ShardStats[] used to resolve a marvel document. + * @return a random ShardStats[] used to resolve a monitoring document. */ private ShardStats[] randomShardStats() { Index index = new Index("test", UUID.randomUUID().toString()); diff --git a/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/resolver/cluster/ClusterStatsTests.java b/elasticsearch/x-pack/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/agent/resolver/cluster/ClusterStatsTests.java similarity index 83% rename from elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/resolver/cluster/ClusterStatsTests.java rename to elasticsearch/x-pack/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/agent/resolver/cluster/ClusterStatsTests.java index d787ff3cea6..a965e2bb71e 100644 --- a/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/resolver/cluster/ClusterStatsTests.java +++ b/elasticsearch/x-pack/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/agent/resolver/cluster/ClusterStatsTests.java @@ -3,17 +3,17 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.marvel.agent.resolver.cluster; +package org.elasticsearch.xpack.monitoring.agent.resolver.cluster; import org.elasticsearch.action.admin.cluster.stats.ClusterStatsNodes; import org.elasticsearch.action.search.SearchResponse; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.marvel.MonitoringSettings; -import org.elasticsearch.marvel.agent.collector.cluster.ClusterStatsCollector; -import org.elasticsearch.marvel.test.MarvelIntegTestCase; import org.elasticsearch.search.SearchHit; import org.elasticsearch.test.ESIntegTestCase.ClusterScope; import org.elasticsearch.test.ESIntegTestCase.Scope; +import org.elasticsearch.xpack.monitoring.MonitoringSettings; +import org.elasticsearch.xpack.monitoring.agent.collector.cluster.ClusterStatsCollector; +import org.elasticsearch.xpack.monitoring.test.MonitoringIntegTestCase; import org.junit.After; import java.util.Locale; @@ -24,7 +24,7 @@ import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; import static org.hamcrest.Matchers.greaterThan; @ClusterScope(scope = Scope.TEST, numClientNodes = 0) -public class ClusterStatsTests extends MarvelIntegTestCase { +public class ClusterStatsTests extends MonitoringIntegTestCase { @Override protected Settings nodeSettings(int nodeOrdinal) { @@ -38,8 +38,8 @@ public class ClusterStatsTests extends MarvelIntegTestCase { @After public void cleanup() throws Exception { - updateMarvelInterval(-1, TimeUnit.SECONDS); - wipeMarvelIndices(); + updateMonitoringInterval(-1, TimeUnit.SECONDS); + wipeMonitoringIndices(); } public void testClusterStats() throws Exception { @@ -60,9 +60,9 @@ public class ClusterStatsTests extends MarvelIntegTestCase { securedEnsureGreen(); // ok.. we'll start collecting now... - updateMarvelInterval(3L, TimeUnit.SECONDS); + updateMonitoringInterval(3L, TimeUnit.SECONDS); - awaitMarvelDocsCount(greaterThan(0L), ClusterStatsResolver.TYPE); + awaitMonitoringDocsCount(greaterThan(0L), ClusterStatsResolver.TYPE); assertBusy(new Runnable() { @Override diff --git a/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/resolver/indices/IndexRecoveryResolverTests.java b/elasticsearch/x-pack/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/agent/resolver/indices/IndexRecoveryResolverTests.java similarity index 83% rename from elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/resolver/indices/IndexRecoveryResolverTests.java rename to elasticsearch/x-pack/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/agent/resolver/indices/IndexRecoveryResolverTests.java index b4643226244..618c6bd70b3 100644 --- a/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/resolver/indices/IndexRecoveryResolverTests.java +++ b/elasticsearch/x-pack/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/agent/resolver/indices/IndexRecoveryResolverTests.java @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.marvel.agent.resolver.indices; +package org.elasticsearch.xpack.monitoring.agent.resolver.indices; import org.elasticsearch.Version; import org.elasticsearch.action.admin.indices.recovery.RecoveryResponse; @@ -12,9 +12,9 @@ import org.elasticsearch.common.transport.DummyTransportAddress; import org.elasticsearch.common.xcontent.XContentType; import org.elasticsearch.index.shard.ShardId; import org.elasticsearch.indices.recovery.RecoveryState; -import org.elasticsearch.marvel.agent.collector.indices.IndexRecoveryMonitoringDoc; -import org.elasticsearch.marvel.agent.exporter.MarvelTemplateUtils; -import org.elasticsearch.marvel.agent.resolver.MonitoringIndexNameResolverTestCase; +import org.elasticsearch.xpack.monitoring.agent.collector.indices.IndexRecoveryMonitoringDoc; +import org.elasticsearch.xpack.monitoring.agent.exporter.MonitoringTemplateUtils; +import org.elasticsearch.xpack.monitoring.agent.resolver.MonitoringIndexNameResolverTestCase; import java.util.Collections; import java.util.HashMap; @@ -28,7 +28,7 @@ import static org.hamcrest.Matchers.nullValue; public class IndexRecoveryResolverTests extends MonitoringIndexNameResolverTestCase { @Override - protected IndexRecoveryMonitoringDoc newMarvelDoc() { + protected IndexRecoveryMonitoringDoc newMonitoringDoc() { IndexRecoveryMonitoringDoc doc = new IndexRecoveryMonitoringDoc(randomMonitoringId(), randomAsciiOfLength(2)); doc.setClusterUUID(randomAsciiOfLength(5)); doc.setTimestamp(Math.abs(randomLong())); @@ -53,11 +53,11 @@ public class IndexRecoveryResolverTests extends MonitoringIndexNameResolverTestC } public void testIndexRecoveryResolver() throws Exception { - IndexRecoveryMonitoringDoc doc = newMarvelDoc(); + IndexRecoveryMonitoringDoc doc = newMonitoringDoc(); doc.setTimestamp(1437580442979L); IndexRecoveryResolver resolver = newResolver(); - assertThat(resolver.index(doc), equalTo(".monitoring-es-" + MarvelTemplateUtils.TEMPLATE_VERSION + "-2015.07.22")); + assertThat(resolver.index(doc), equalTo(".monitoring-es-" + MonitoringTemplateUtils.TEMPLATE_VERSION + "-2015.07.22")); assertThat(resolver.type(doc), equalTo(IndexRecoveryResolver.TYPE)); assertThat(resolver.id(doc), nullValue()); diff --git a/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/resolver/indices/IndexRecoveryTests.java b/elasticsearch/x-pack/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/agent/resolver/indices/IndexRecoveryTests.java similarity index 87% rename from elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/resolver/indices/IndexRecoveryTests.java rename to elasticsearch/x-pack/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/agent/resolver/indices/IndexRecoveryTests.java index 561563f4445..45f2d48168d 100644 --- a/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/resolver/indices/IndexRecoveryTests.java +++ b/elasticsearch/x-pack/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/agent/resolver/indices/IndexRecoveryTests.java @@ -3,18 +3,18 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.marvel.agent.resolver.indices; +package org.elasticsearch.xpack.monitoring.agent.resolver.indices; import org.elasticsearch.action.admin.indices.recovery.RecoveryResponse; import org.elasticsearch.action.search.SearchResponse; import org.elasticsearch.common.Strings; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.marvel.MonitoringSettings; -import org.elasticsearch.marvel.agent.collector.indices.IndexRecoveryCollector; -import org.elasticsearch.marvel.agent.resolver.MonitoringIndexNameResolver; -import org.elasticsearch.marvel.test.MarvelIntegTestCase; import org.elasticsearch.search.SearchHit; import org.elasticsearch.test.ESIntegTestCase.ClusterScope; +import org.elasticsearch.xpack.monitoring.MonitoringSettings; +import org.elasticsearch.xpack.monitoring.agent.collector.indices.IndexRecoveryCollector; +import org.elasticsearch.xpack.monitoring.agent.resolver.MonitoringIndexNameResolver; +import org.elasticsearch.xpack.monitoring.test.MonitoringIntegTestCase; import org.junit.After; import java.util.Map; @@ -27,7 +27,7 @@ import static org.hamcrest.Matchers.greaterThan; import static org.hamcrest.Matchers.is; @ClusterScope(scope = TEST) -public class IndexRecoveryTests extends MarvelIntegTestCase { +public class IndexRecoveryTests extends MonitoringIntegTestCase { private static final String INDEX_PREFIX = "test-index-recovery-"; @@ -44,8 +44,8 @@ public class IndexRecoveryTests extends MarvelIntegTestCase { @After public void cleanup() throws Exception { - updateMarvelInterval(-1, TimeUnit.SECONDS); - wipeMarvelIndices(); + updateMonitoringInterval(-1, TimeUnit.SECONDS); + wipeMonitoringIndices(); } public void testIndexRecovery() throws Exception { @@ -66,10 +66,10 @@ public class IndexRecoveryTests extends MarvelIntegTestCase { } }); - updateMarvelInterval(3L, TimeUnit.SECONDS); - waitForMarvelIndices(); + updateMonitoringInterval(3L, TimeUnit.SECONDS); + waitForMonitoringIndices(); - awaitMarvelDocsCount(greaterThan(0L), IndexRecoveryResolver.TYPE); + awaitMonitoringDocsCount(greaterThan(0L), IndexRecoveryResolver.TYPE); String clusterUUID = client().admin().cluster().prepareState().setMetaData(true).get().getState().metaData().clusterUUID(); assertTrue(Strings.hasText(clusterUUID)); diff --git a/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/resolver/indices/IndexStatsResolverTests.java b/elasticsearch/x-pack/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/agent/resolver/indices/IndexStatsResolverTests.java similarity index 89% rename from elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/resolver/indices/IndexStatsResolverTests.java rename to elasticsearch/x-pack/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/agent/resolver/indices/IndexStatsResolverTests.java index 1be2c883894..f5511ddc811 100644 --- a/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/resolver/indices/IndexStatsResolverTests.java +++ b/elasticsearch/x-pack/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/agent/resolver/indices/IndexStatsResolverTests.java @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.marvel.agent.resolver.indices; +package org.elasticsearch.xpack.monitoring.agent.resolver.indices; import org.elasticsearch.Version; import org.elasticsearch.action.admin.indices.stats.CommonStats; @@ -26,9 +26,9 @@ import org.elasticsearch.index.shard.IndexingStats; import org.elasticsearch.index.shard.ShardId; import org.elasticsearch.index.shard.ShardPath; import org.elasticsearch.index.store.StoreStats; -import org.elasticsearch.marvel.agent.collector.indices.IndexStatsMonitoringDoc; -import org.elasticsearch.marvel.agent.exporter.MarvelTemplateUtils; -import org.elasticsearch.marvel.agent.resolver.MonitoringIndexNameResolverTestCase; +import org.elasticsearch.xpack.monitoring.agent.collector.indices.IndexStatsMonitoringDoc; +import org.elasticsearch.xpack.monitoring.agent.exporter.MonitoringTemplateUtils; +import org.elasticsearch.xpack.monitoring.agent.resolver.MonitoringIndexNameResolverTestCase; import java.nio.file.Path; import java.util.UUID; @@ -41,7 +41,7 @@ import static org.hamcrest.Matchers.nullValue; public class IndexStatsResolverTests extends MonitoringIndexNameResolverTestCase { @Override - protected IndexStatsMonitoringDoc newMarvelDoc() { + protected IndexStatsMonitoringDoc newMonitoringDoc() { IndexStatsMonitoringDoc doc = new IndexStatsMonitoringDoc(randomMonitoringId(), randomAsciiOfLength(2)); doc.setClusterUUID(randomAsciiOfLength(5)); doc.setTimestamp(Math.abs(randomLong())); @@ -56,12 +56,12 @@ public class IndexStatsResolverTests extends MonitoringIndexNameResolverTestCase } public void testIndexStatsResolver() throws Exception { - IndexStatsMonitoringDoc doc = newMarvelDoc(); + IndexStatsMonitoringDoc doc = newMonitoringDoc(); doc.setTimestamp(1437580442979L); doc.setSourceNode(new DiscoveryNode("id", DummyTransportAddress.INSTANCE, emptyMap(), emptySet(), Version.CURRENT)); IndexStatsResolver resolver = newResolver(); - assertThat(resolver.index(doc), equalTo(".monitoring-es-" + MarvelTemplateUtils.TEMPLATE_VERSION + "-2015.07.22")); + assertThat(resolver.index(doc), equalTo(".monitoring-es-" + MonitoringTemplateUtils.TEMPLATE_VERSION + "-2015.07.22")); assertThat(resolver.type(doc), equalTo(IndexStatsResolver.TYPE)); assertThat(resolver.id(doc), nullValue()); diff --git a/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/resolver/indices/IndexStatsTests.java b/elasticsearch/x-pack/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/agent/resolver/indices/IndexStatsTests.java similarity index 85% rename from elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/resolver/indices/IndexStatsTests.java rename to elasticsearch/x-pack/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/agent/resolver/indices/IndexStatsTests.java index d1af88aadaf..76f439e0e0c 100644 --- a/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/resolver/indices/IndexStatsTests.java +++ b/elasticsearch/x-pack/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/agent/resolver/indices/IndexStatsTests.java @@ -3,17 +3,17 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.marvel.agent.resolver.indices; +package org.elasticsearch.xpack.monitoring.agent.resolver.indices; import org.elasticsearch.action.search.SearchResponse; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.index.query.QueryBuilders; -import org.elasticsearch.marvel.MonitoringSettings; -import org.elasticsearch.marvel.agent.collector.indices.IndexStatsCollector; -import org.elasticsearch.marvel.test.MarvelIntegTestCase; import org.elasticsearch.search.SearchHit; import org.elasticsearch.test.ESIntegTestCase.ClusterScope; import org.elasticsearch.test.ESIntegTestCase.Scope; +import org.elasticsearch.xpack.monitoring.MonitoringSettings; +import org.elasticsearch.xpack.monitoring.agent.collector.indices.IndexStatsCollector; +import org.elasticsearch.xpack.monitoring.test.MonitoringIntegTestCase; import org.junit.After; import java.util.Map; @@ -22,7 +22,7 @@ import java.util.concurrent.TimeUnit; import static org.hamcrest.Matchers.greaterThan; @ClusterScope(scope = Scope.TEST, numClientNodes = 0) -public class IndexStatsTests extends MarvelIntegTestCase { +public class IndexStatsTests extends MonitoringIntegTestCase { @Override protected Settings nodeSettings(int nodeOrdinal) { @@ -36,8 +36,8 @@ public class IndexStatsTests extends MarvelIntegTestCase { @After public void cleanup() throws Exception { - updateMarvelInterval(-1, TimeUnit.SECONDS); - wipeMarvelIndices(); + updateMonitoringInterval(-1, TimeUnit.SECONDS); + wipeMonitoringIndices(); } @AwaitsFix(bugUrl = "https://github.com/elastic/x-plugins/issues/1396") @@ -61,10 +61,10 @@ public class IndexStatsTests extends MarvelIntegTestCase { securedFlush(); securedRefresh(); - updateMarvelInterval(3L, TimeUnit.SECONDS); - waitForMarvelIndices(); + updateMonitoringInterval(3L, TimeUnit.SECONDS); + waitForMonitoringIndices(); - awaitMarvelDocsCount(greaterThan(0L), IndexStatsResolver.TYPE); + awaitMonitoringDocsCount(greaterThan(0L), IndexStatsResolver.TYPE); logger.debug("--> wait for index stats collector to collect stat for each index"); assertBusy(new Runnable() { diff --git a/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/resolver/indices/IndicesStatsResolverTests.java b/elasticsearch/x-pack/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/agent/resolver/indices/IndicesStatsResolverTests.java similarity index 90% rename from elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/resolver/indices/IndicesStatsResolverTests.java rename to elasticsearch/x-pack/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/agent/resolver/indices/IndicesStatsResolverTests.java index e28342679e4..b38dd409db9 100644 --- a/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/resolver/indices/IndicesStatsResolverTests.java +++ b/elasticsearch/x-pack/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/agent/resolver/indices/IndicesStatsResolverTests.java @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.marvel.agent.resolver.indices; +package org.elasticsearch.xpack.monitoring.agent.resolver.indices; import org.elasticsearch.Version; import org.elasticsearch.action.admin.indices.stats.CommonStats; @@ -27,9 +27,9 @@ import org.elasticsearch.index.shard.IndexingStats; import org.elasticsearch.index.shard.ShardId; import org.elasticsearch.index.shard.ShardPath; import org.elasticsearch.index.store.StoreStats; -import org.elasticsearch.marvel.agent.collector.indices.IndicesStatsMonitoringDoc; -import org.elasticsearch.marvel.agent.exporter.MarvelTemplateUtils; -import org.elasticsearch.marvel.agent.resolver.MonitoringIndexNameResolverTestCase; +import org.elasticsearch.xpack.monitoring.agent.collector.indices.IndicesStatsMonitoringDoc; +import org.elasticsearch.xpack.monitoring.agent.exporter.MonitoringTemplateUtils; +import org.elasticsearch.xpack.monitoring.agent.resolver.MonitoringIndexNameResolverTestCase; import java.nio.file.Path; import java.util.ArrayList; @@ -45,7 +45,7 @@ import static org.hamcrest.Matchers.nullValue; public class IndicesStatsResolverTests extends MonitoringIndexNameResolverTestCase { @Override - protected IndicesStatsMonitoringDoc newMarvelDoc() { + protected IndicesStatsMonitoringDoc newMonitoringDoc() { IndicesStatsMonitoringDoc doc = new IndicesStatsMonitoringDoc(randomMonitoringId(), randomAsciiOfLength(2)); doc.setClusterUUID(randomAsciiOfLength(5)); doc.setTimestamp(Math.abs(randomLong())); @@ -60,13 +60,13 @@ public class IndicesStatsResolverTests extends MonitoringIndexNameResolverTestCa } public void testIndicesStatsResolver() throws Exception { - IndicesStatsMonitoringDoc doc = newMarvelDoc(); + IndicesStatsMonitoringDoc doc = newMonitoringDoc(); doc.setClusterUUID(randomAsciiOfLength(5)); doc.setTimestamp(1437580442979L); doc.setSourceNode(new DiscoveryNode("id", DummyTransportAddress.INSTANCE, emptyMap(), emptySet(), Version.CURRENT)); IndicesStatsResolver resolver = newResolver(); - assertThat(resolver.index(doc), equalTo(".monitoring-es-" + MarvelTemplateUtils.TEMPLATE_VERSION + "-2015.07.22")); + assertThat(resolver.index(doc), equalTo(".monitoring-es-" + MonitoringTemplateUtils.TEMPLATE_VERSION + "-2015.07.22")); assertThat(resolver.type(doc), equalTo(IndicesStatsResolver.TYPE)); assertThat(resolver.id(doc), nullValue()); diff --git a/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/resolver/indices/IndicesStatsTests.java b/elasticsearch/x-pack/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/agent/resolver/indices/IndicesStatsTests.java similarity index 84% rename from elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/resolver/indices/IndicesStatsTests.java rename to elasticsearch/x-pack/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/agent/resolver/indices/IndicesStatsTests.java index 25ae10e8e2f..bce40dc9f86 100644 --- a/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/resolver/indices/IndicesStatsTests.java +++ b/elasticsearch/x-pack/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/agent/resolver/indices/IndicesStatsTests.java @@ -3,17 +3,17 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.marvel.agent.resolver.indices; +package org.elasticsearch.xpack.monitoring.agent.resolver.indices; import org.elasticsearch.action.admin.indices.stats.IndicesStatsResponse; import org.elasticsearch.action.search.SearchResponse; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.marvel.MonitoringSettings; -import org.elasticsearch.marvel.agent.collector.indices.IndicesStatsCollector; -import org.elasticsearch.marvel.test.MarvelIntegTestCase; import org.elasticsearch.search.SearchHit; import org.elasticsearch.test.ESIntegTestCase.ClusterScope; import org.elasticsearch.test.ESIntegTestCase.Scope; +import org.elasticsearch.xpack.monitoring.MonitoringSettings; +import org.elasticsearch.xpack.monitoring.agent.collector.indices.IndicesStatsCollector; +import org.elasticsearch.xpack.monitoring.test.MonitoringIntegTestCase; import org.junit.After; import java.util.Map; @@ -22,7 +22,7 @@ import java.util.concurrent.TimeUnit; import static org.hamcrest.Matchers.greaterThan; @ClusterScope(scope = Scope.TEST, numClientNodes = 0) -public class IndicesStatsTests extends MarvelIntegTestCase { +public class IndicesStatsTests extends MonitoringIntegTestCase { @Override protected Settings nodeSettings(int nodeOrdinal) { @@ -36,8 +36,8 @@ public class IndicesStatsTests extends MarvelIntegTestCase { @After public void cleanup() throws Exception { - updateMarvelInterval(-1, TimeUnit.SECONDS); - wipeMarvelIndices(); + updateMonitoringInterval(-1, TimeUnit.SECONDS); + wipeMonitoringIndices(); } public void testIndicesStats() throws Exception { @@ -69,11 +69,11 @@ public class IndicesStatsTests extends MarvelIntegTestCase { } }); - updateMarvelInterval(3L, TimeUnit.SECONDS); - waitForMarvelIndices(); + updateMonitoringInterval(3L, TimeUnit.SECONDS); + waitForMonitoringIndices(); logger.debug("--> wait for indices stats collector to collect global stat"); - awaitMarvelDocsCount(greaterThan(0L), IndicesStatsResolver.TYPE); + awaitMonitoringDocsCount(greaterThan(0L), IndicesStatsResolver.TYPE); logger.debug("--> searching for monitoring documents of type [{}]", IndicesStatsResolver.TYPE); SearchResponse response = client().prepareSearch().setTypes(IndicesStatsResolver.TYPE).get(); diff --git a/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/resolver/node/DiscoveryNodeResolverTests.java b/elasticsearch/x-pack/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/agent/resolver/node/DiscoveryNodeResolverTests.java similarity index 78% rename from elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/resolver/node/DiscoveryNodeResolverTests.java rename to elasticsearch/x-pack/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/agent/resolver/node/DiscoveryNodeResolverTests.java index 179f9fd1f8e..41a915d1cc8 100644 --- a/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/resolver/node/DiscoveryNodeResolverTests.java +++ b/elasticsearch/x-pack/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/agent/resolver/node/DiscoveryNodeResolverTests.java @@ -3,17 +3,17 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.marvel.agent.resolver.node; +package org.elasticsearch.xpack.monitoring.agent.resolver.node; import org.elasticsearch.Version; import org.elasticsearch.cluster.node.DiscoveryNode; import org.elasticsearch.common.transport.DummyTransportAddress; import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.marvel.agent.collector.cluster.DiscoveryNodeMonitoringDoc; -import org.elasticsearch.marvel.agent.exporter.MarvelTemplateUtils; -import org.elasticsearch.marvel.agent.resolver.MonitoringIndexNameResolverTestCase; -import org.elasticsearch.marvel.agent.resolver.cluster.DiscoveryNodeResolver; import org.elasticsearch.test.VersionUtils; +import org.elasticsearch.xpack.monitoring.agent.collector.cluster.DiscoveryNodeMonitoringDoc; +import org.elasticsearch.xpack.monitoring.agent.exporter.MonitoringTemplateUtils; +import org.elasticsearch.xpack.monitoring.agent.resolver.MonitoringIndexNameResolverTestCase; +import org.elasticsearch.xpack.monitoring.agent.resolver.cluster.DiscoveryNodeResolver; import java.util.UUID; @@ -24,7 +24,7 @@ import static org.hamcrest.Matchers.equalTo; public class DiscoveryNodeResolverTests extends MonitoringIndexNameResolverTestCase { @Override - protected DiscoveryNodeMonitoringDoc newMarvelDoc() { + protected DiscoveryNodeMonitoringDoc newMonitoringDoc() { DiscoveryNodeMonitoringDoc doc = new DiscoveryNodeMonitoringDoc(randomMonitoringId(), randomAsciiOfLength(2)); doc.setClusterUUID(randomAsciiOfLength(5)); doc.setTimestamp(Math.abs(randomLong())); @@ -41,11 +41,11 @@ public class DiscoveryNodeResolverTests extends MonitoringIndexNameResolverTestC } public void testDiscoveryNodeResolver() throws Exception { - DiscoveryNodeMonitoringDoc doc = newMarvelDoc(); + DiscoveryNodeMonitoringDoc doc = newMonitoringDoc(); doc.setTimestamp(1437580442979L); DiscoveryNodeResolver resolver = newResolver(); - assertThat(resolver.index(doc), equalTo(".monitoring-data-" + MarvelTemplateUtils.TEMPLATE_VERSION)); + assertThat(resolver.index(doc), equalTo(".monitoring-data-" + MonitoringTemplateUtils.TEMPLATE_VERSION)); assertThat(resolver.type(doc), equalTo(DiscoveryNodeResolver.TYPE)); assertThat(resolver.id(doc), equalTo(doc.getNode().getId())); diff --git a/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/resolver/node/MultiNodesStatsTests.java b/elasticsearch/x-pack/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/agent/resolver/node/MultiNodesStatsTests.java similarity index 91% rename from elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/resolver/node/MultiNodesStatsTests.java rename to elasticsearch/x-pack/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/agent/resolver/node/MultiNodesStatsTests.java index 3c6a862d84a..c5002592bf8 100644 --- a/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/resolver/node/MultiNodesStatsTests.java +++ b/elasticsearch/x-pack/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/agent/resolver/node/MultiNodesStatsTests.java @@ -3,13 +3,11 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.marvel.agent.resolver.node; +package org.elasticsearch.xpack.monitoring.agent.resolver.node; import org.elasticsearch.action.search.SearchResponse; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.index.IndexNotFoundException; -import org.elasticsearch.marvel.MonitoringSettings; -import org.elasticsearch.marvel.test.MarvelIntegTestCase; import org.elasticsearch.node.Node; import org.elasticsearch.search.aggregations.Aggregation; import org.elasticsearch.search.aggregations.AggregationBuilders; @@ -17,6 +15,8 @@ import org.elasticsearch.search.aggregations.bucket.terms.StringTerms; import org.elasticsearch.test.ESIntegTestCase.ClusterScope; import org.elasticsearch.test.ESIntegTestCase.Scope; import org.elasticsearch.test.InternalTestCluster; +import org.elasticsearch.xpack.monitoring.MonitoringSettings; +import org.elasticsearch.xpack.monitoring.test.MonitoringIntegTestCase; import org.junit.After; import java.util.List; @@ -28,7 +28,7 @@ import static org.hamcrest.Matchers.greaterThanOrEqualTo; import static org.hamcrest.Matchers.instanceOf; @ClusterScope(scope = Scope.TEST, numDataNodes = 0, numClientNodes = 0, transportClientRatio = 0.0) -public class MultiNodesStatsTests extends MarvelIntegTestCase { +public class MultiNodesStatsTests extends MonitoringIntegTestCase { @Override protected Settings nodeSettings(int nodeOrdinal) { @@ -41,8 +41,8 @@ public class MultiNodesStatsTests extends MarvelIntegTestCase { @After public void cleanup() throws Exception { - updateMarvelInterval(-1, TimeUnit.SECONDS); - wipeMarvelIndices(); + updateMonitoringInterval(-1, TimeUnit.SECONDS); + wipeMonitoringIndices(); } public void testMultipleNodes() throws Exception { @@ -81,8 +81,8 @@ public class MultiNodesStatsTests extends MarvelIntegTestCase { assertNoTimeout(client().admin().cluster().prepareHealth().setWaitForNodes(Integer.toString(nbNodes)).get()); }); - updateMarvelInterval(3L, TimeUnit.SECONDS); - waitForMarvelIndices(); + updateMonitoringInterval(3L, TimeUnit.SECONDS); + waitForMonitoringIndices(); logger.debug("--> checking that every node correctly reported its own node stats"); assertBusy(() -> { diff --git a/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/resolver/node/NodeStatsResolverTests.java b/elasticsearch/x-pack/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/agent/resolver/node/NodeStatsResolverTests.java similarity index 92% rename from elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/resolver/node/NodeStatsResolverTests.java rename to elasticsearch/x-pack/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/agent/resolver/node/NodeStatsResolverTests.java index f9ff1b162a5..c7552b42b89 100644 --- a/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/resolver/node/NodeStatsResolverTests.java +++ b/elasticsearch/x-pack/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/agent/resolver/node/NodeStatsResolverTests.java @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.marvel.agent.resolver.node; +package org.elasticsearch.xpack.monitoring.agent.resolver.node; import org.apache.lucene.util.Constants; import org.elasticsearch.Version; @@ -27,15 +27,15 @@ import org.elasticsearch.index.shard.ShardId; import org.elasticsearch.index.shard.ShardPath; import org.elasticsearch.index.store.StoreStats; import org.elasticsearch.indices.NodeIndicesStats; -import org.elasticsearch.marvel.agent.collector.node.NodeStatsMonitoringDoc; -import org.elasticsearch.marvel.agent.exporter.MarvelTemplateUtils; -import org.elasticsearch.marvel.agent.resolver.MonitoringIndexNameResolverTestCase; import org.elasticsearch.monitor.fs.FsInfo; import org.elasticsearch.monitor.jvm.JvmStats; import org.elasticsearch.monitor.os.OsProbe; import org.elasticsearch.monitor.process.ProcessProbe; import org.elasticsearch.threadpool.ThreadPool; import org.elasticsearch.threadpool.ThreadPoolStats; +import org.elasticsearch.xpack.monitoring.agent.collector.node.NodeStatsMonitoringDoc; +import org.elasticsearch.xpack.monitoring.agent.exporter.MonitoringTemplateUtils; +import org.elasticsearch.xpack.monitoring.agent.resolver.MonitoringIndexNameResolverTestCase; import org.elasticsearch.xpack.watcher.execution.InternalWatchExecutor; import java.io.IOException; @@ -55,7 +55,7 @@ import static org.hamcrest.Matchers.nullValue; public class NodeStatsResolverTests extends MonitoringIndexNameResolverTestCase { @Override - protected NodeStatsMonitoringDoc newMarvelDoc() { + protected NodeStatsMonitoringDoc newMonitoringDoc() { NodeStatsMonitoringDoc doc = new NodeStatsMonitoringDoc(randomMonitoringId(), randomAsciiOfLength(2)); doc.setClusterUUID(randomAsciiOfLength(5)); doc.setTimestamp(Math.abs(randomLong())); @@ -84,11 +84,11 @@ public class NodeStatsResolverTests extends MonitoringIndexNameResolverTestCase< } public void testNodeStatsResolver() throws IOException { - NodeStatsMonitoringDoc doc = newMarvelDoc(); + NodeStatsMonitoringDoc doc = newMonitoringDoc(); doc.setTimestamp(1437580442979L); NodeStatsResolver resolver = newResolver(); - assertThat(resolver.index(doc), equalTo(".monitoring-es-" + MarvelTemplateUtils.TEMPLATE_VERSION + "-2015.07.22")); + assertThat(resolver.index(doc), equalTo(".monitoring-es-" + MonitoringTemplateUtils.TEMPLATE_VERSION + "-2015.07.22")); assertThat(resolver.type(doc), equalTo(NodeStatsResolver.TYPE)); assertThat(resolver.id(doc), nullValue()); diff --git a/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/resolver/node/NodeStatsTests.java b/elasticsearch/x-pack/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/agent/resolver/node/NodeStatsTests.java similarity index 84% rename from elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/resolver/node/NodeStatsTests.java rename to elasticsearch/x-pack/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/agent/resolver/node/NodeStatsTests.java index 3758a09d0c6..867423fa29e 100644 --- a/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/resolver/node/NodeStatsTests.java +++ b/elasticsearch/x-pack/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/agent/resolver/node/NodeStatsTests.java @@ -3,18 +3,18 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.marvel.agent.resolver.node; +package org.elasticsearch.xpack.monitoring.agent.resolver.node; import org.apache.lucene.util.Constants; import org.elasticsearch.action.search.SearchResponse; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.marvel.MonitoringSettings; -import org.elasticsearch.marvel.agent.collector.node.NodeStatsCollector; -import org.elasticsearch.marvel.agent.exporter.local.LocalExporter; -import org.elasticsearch.marvel.test.MarvelIntegTestCase; import org.elasticsearch.search.SearchHit; import org.elasticsearch.test.ESIntegTestCase.ClusterScope; import org.elasticsearch.test.ESIntegTestCase.Scope; +import org.elasticsearch.xpack.monitoring.MonitoringSettings; +import org.elasticsearch.xpack.monitoring.agent.collector.node.NodeStatsCollector; +import org.elasticsearch.xpack.monitoring.agent.exporter.local.LocalExporter; +import org.elasticsearch.xpack.monitoring.test.MonitoringIntegTestCase; import org.junit.After; import java.util.Arrays; @@ -25,7 +25,7 @@ import static org.hamcrest.Matchers.greaterThan; // numClientNodes is set to 0 because Client nodes don't have Filesystem stats @ClusterScope(scope = Scope.TEST, numClientNodes = 0, transportClientRatio = 0.0) -public class NodeStatsTests extends MarvelIntegTestCase { +public class NodeStatsTests extends MonitoringIntegTestCase { @Override protected Settings nodeSettings(int nodeOrdinal) { @@ -39,8 +39,8 @@ public class NodeStatsTests extends MarvelIntegTestCase { @After public void cleanup() throws Exception { - updateMarvelInterval(-1, TimeUnit.SECONDS); - wipeMarvelIndices(); + updateMonitoringInterval(-1, TimeUnit.SECONDS); + wipeMonitoringIndices(); } @AwaitsFix(bugUrl = "https://github.com/elastic/x-plugins/issues/2588") @@ -54,10 +54,10 @@ public class NodeStatsTests extends MarvelIntegTestCase { securedFlush(); securedRefresh(); - updateMarvelInterval(3L, TimeUnit.SECONDS); - waitForMarvelIndices(); + updateMonitoringInterval(3L, TimeUnit.SECONDS); + waitForMonitoringIndices(); - awaitMarvelDocsCount(greaterThan(0L), NodeStatsResolver.TYPE); + awaitMonitoringDocsCount(greaterThan(0L), NodeStatsResolver.TYPE); logger.debug("--> searching for monitoring documents of type [{}]", NodeStatsResolver.TYPE); SearchResponse response = client().prepareSearch().setTypes(NodeStatsResolver.TYPE).get(); diff --git a/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/resolver/shards/ShardsResolverTests.java b/elasticsearch/x-pack/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/agent/resolver/shards/ShardsResolverTests.java similarity index 90% rename from elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/resolver/shards/ShardsResolverTests.java rename to elasticsearch/x-pack/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/agent/resolver/shards/ShardsResolverTests.java index 38021b420fd..d9aab143d33 100644 --- a/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/resolver/shards/ShardsResolverTests.java +++ b/elasticsearch/x-pack/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/agent/resolver/shards/ShardsResolverTests.java @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.marvel.agent.resolver.shards; +package org.elasticsearch.xpack.monitoring.agent.resolver.shards; import org.elasticsearch.Version; import org.elasticsearch.cluster.node.DiscoveryNode; @@ -13,9 +13,9 @@ import org.elasticsearch.common.transport.DummyTransportAddress; import org.elasticsearch.common.xcontent.XContentType; import org.elasticsearch.index.Index; import org.elasticsearch.index.shard.ShardId; -import org.elasticsearch.marvel.agent.collector.shards.ShardMonitoringDoc; -import org.elasticsearch.marvel.agent.exporter.MarvelTemplateUtils; -import org.elasticsearch.marvel.agent.resolver.MonitoringIndexNameResolverTestCase; +import org.elasticsearch.xpack.monitoring.agent.collector.shards.ShardMonitoringDoc; +import org.elasticsearch.xpack.monitoring.agent.exporter.MonitoringTemplateUtils; +import org.elasticsearch.xpack.monitoring.agent.resolver.MonitoringIndexNameResolverTestCase; import java.util.UUID; @@ -26,7 +26,7 @@ import static org.hamcrest.Matchers.equalTo; public class ShardsResolverTests extends MonitoringIndexNameResolverTestCase { @Override - protected ShardMonitoringDoc newMarvelDoc() { + protected ShardMonitoringDoc newMonitoringDoc() { ShardMonitoringDoc doc = new ShardMonitoringDoc(randomMonitoringId(), randomAsciiOfLength(2)); doc.setClusterUUID(randomAsciiOfLength(5)); doc.setTimestamp(Math.abs(randomLong())); @@ -43,7 +43,7 @@ public class ShardsResolverTests extends MonitoringIndexNameResolverTestCase searching for monitoring documents of type [{}]", ShardsResolver.TYPE); SearchResponse response = client().prepareSearch().setTypes(ShardsResolver.TYPE).get(); @@ -96,10 +96,10 @@ public class ShardsTests extends MarvelIntegTestCase { assertAcked(prepareCreate(indexName) .setSettings(IndexMetaData.SETTING_NUMBER_OF_SHARDS, 1, IndexMetaData.SETTING_NUMBER_OF_REPLICAS, 0)); - updateMarvelInterval(3L, TimeUnit.SECONDS); - waitForMarvelIndices(); + updateMonitoringInterval(3L, TimeUnit.SECONDS); + waitForMonitoringIndices(); - awaitMarvelDocsCount(greaterThan(0L), ShardsResolver.TYPE); + awaitMonitoringDocsCount(greaterThan(0L), ShardsResolver.TYPE); SearchRequestBuilder searchRequestBuilder = client() .prepareSearch() diff --git a/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/settings/MarvelSettingsTests.java b/elasticsearch/x-pack/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/agent/settings/MonitoringSettingsTests.java similarity index 93% rename from elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/settings/MarvelSettingsTests.java rename to elasticsearch/x-pack/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/agent/settings/MonitoringSettingsTests.java index 6a7e6f754ac..ef914685f36 100644 --- a/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/settings/MarvelSettingsTests.java +++ b/elasticsearch/x-pack/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/agent/settings/MonitoringSettingsTests.java @@ -3,17 +3,17 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.marvel.agent.settings; +package org.elasticsearch.xpack.monitoring.agent.settings; import org.elasticsearch.action.admin.cluster.settings.ClusterUpdateSettingsRequestBuilder; import org.elasticsearch.common.network.NetworkModule; import org.elasticsearch.common.settings.Setting; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.unit.TimeValue; -import org.elasticsearch.marvel.MonitoringSettings; -import org.elasticsearch.marvel.agent.AgentService; -import org.elasticsearch.marvel.test.MarvelIntegTestCase; import org.elasticsearch.test.ESIntegTestCase; +import org.elasticsearch.xpack.monitoring.MonitoringSettings; +import org.elasticsearch.xpack.monitoring.agent.AgentService; +import org.elasticsearch.xpack.monitoring.test.MonitoringIntegTestCase; import java.util.Arrays; import java.util.List; @@ -24,7 +24,7 @@ import static org.hamcrest.Matchers.equalTo; //test is just too slow, please fix it to not be sleep-based //@BadApple(bugUrl = "https://github.com/elastic/x-plugins/issues/1007") @ESIntegTestCase.ClusterScope(scope = ESIntegTestCase.Scope.TEST, supportsDedicatedMasters = false, numDataNodes = 1, numClientNodes = 0) -public class MarvelSettingsTests extends MarvelIntegTestCase { +public class MonitoringSettingsTests extends MonitoringIntegTestCase { private final TimeValue interval = newRandomTimeValue(); private final TimeValue indexStatsTimeout = newRandomTimeValue(); private final TimeValue indicesStatsTimeout = newRandomTimeValue(); @@ -40,11 +40,11 @@ public class MarvelSettingsTests extends MarvelIntegTestCase { return Settings.builder() .put(super.nodeSettings(nodeOrdinal)) .put(NetworkModule.HTTP_ENABLED.getKey(), false) - .put(marvelSettings()) + .put(monitoringSettings()) .build(); } - private Settings marvelSettings() { + private Settings monitoringSettings() { return Settings.builder() .put(MonitoringSettings.INTERVAL.getKey(), interval) .put(MonitoringSettings.INDEX_STATS_TIMEOUT.getKey(), indexStatsTimeout) @@ -58,7 +58,7 @@ public class MarvelSettingsTests extends MarvelIntegTestCase { .build(); } - public void testMarvelSettings() throws Exception { + public void testMonitoringSettings() throws Exception { logger.info("--> testing monitoring settings service initialization"); for (final MonitoringSettings monitoringSettings : internalCluster().getInstances(MonitoringSettings.class)) { assertThat(monitoringSettings.indexStatsTimeout().millis(), equalTo(indexStatsTimeout.millis())); @@ -78,7 +78,7 @@ public class MarvelSettingsTests extends MarvelIntegTestCase { logger.info("--> testing monitoring dynamic settings update"); Settings.Builder transientSettings = Settings.builder(); - final Setting[] marvelSettings = new Setting[] { + final Setting[] monitoringSettings = new Setting[] { MonitoringSettings.INDICES, MonitoringSettings.INTERVAL, MonitoringSettings.INDEX_RECOVERY_TIMEOUT, @@ -88,7 +88,7 @@ public class MarvelSettingsTests extends MarvelIntegTestCase { MonitoringSettings.COLLECTORS, MonitoringSettings.CLUSTER_STATE_TIMEOUT, MonitoringSettings.CLUSTER_STATS_TIMEOUT }; - for (Setting setting : marvelSettings) { + for (Setting setting : monitoringSettings) { if (setting.isDynamic()) { Object updated = null; if (setting.get(Settings.EMPTY) instanceof TimeValue) { @@ -111,7 +111,7 @@ public class MarvelSettingsTests extends MarvelIntegTestCase { assertAcked(prepareRandomUpdateSettings(updatedSettings).get()); logger.error("--> checking that the value has been correctly updated on all monitoring settings services"); - for (Setting setting : marvelSettings) { + for (Setting setting : monitoringSettings) { if (setting.isDynamic() == false) { continue; } diff --git a/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/cleaner/AbstractIndicesCleanerTestCase.java b/elasticsearch/x-pack/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/cleaner/AbstractIndicesCleanerTestCase.java similarity index 90% rename from elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/cleaner/AbstractIndicesCleanerTestCase.java rename to elasticsearch/x-pack/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/cleaner/AbstractIndicesCleanerTestCase.java index 31c25bc8635..7d6f8e00eed 100644 --- a/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/cleaner/AbstractIndicesCleanerTestCase.java +++ b/elasticsearch/x-pack/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/cleaner/AbstractIndicesCleanerTestCase.java @@ -3,20 +3,20 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.marvel.cleaner; +package org.elasticsearch.xpack.monitoring.cleaner; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.unit.TimeValue; -import org.elasticsearch.marvel.MonitoringSettings; -import org.elasticsearch.marvel.MonitoredSystem; -import org.elasticsearch.marvel.agent.exporter.Exporter; -import org.elasticsearch.marvel.agent.exporter.Exporters; -import org.elasticsearch.marvel.agent.exporter.MarvelTemplateUtils; -import org.elasticsearch.marvel.agent.exporter.MonitoringDoc; -import org.elasticsearch.marvel.agent.resolver.MonitoringIndexNameResolver; -import org.elasticsearch.marvel.test.MarvelIntegTestCase; import org.elasticsearch.test.ESIntegTestCase.ClusterScope; import org.elasticsearch.test.VersionUtils; +import org.elasticsearch.xpack.monitoring.MonitoredSystem; +import org.elasticsearch.xpack.monitoring.MonitoringSettings; +import org.elasticsearch.xpack.monitoring.agent.exporter.Exporter; +import org.elasticsearch.xpack.monitoring.agent.exporter.Exporters; +import org.elasticsearch.xpack.monitoring.agent.exporter.MonitoringDoc; +import org.elasticsearch.xpack.monitoring.agent.exporter.MonitoringTemplateUtils; +import org.elasticsearch.xpack.monitoring.agent.resolver.MonitoringIndexNameResolver; +import org.elasticsearch.xpack.monitoring.test.MonitoringIntegTestCase; import org.joda.time.DateTime; import org.joda.time.DateTimeZone; @@ -25,7 +25,7 @@ import java.util.Locale; import static org.elasticsearch.test.ESIntegTestCase.Scope.TEST; @ClusterScope(scope = TEST, numDataNodes = 0, numClientNodes = 0, transportClientRatio = 0.0) -public abstract class AbstractIndicesCleanerTestCase extends MarvelIntegTestCase { +public abstract class AbstractIndicesCleanerTestCase extends MonitoringIntegTestCase { @Override protected Settings nodeSettings(int nodeOrdinal) { @@ -192,7 +192,7 @@ public abstract class AbstractIndicesCleanerTestCase extends MarvelIntegTestCase * Creates a monitoring data index in a given version. */ protected void createDataIndex(DateTime creationDate) { - createDataIndex(creationDate, MarvelTemplateUtils.TEMPLATE_VERSION); + createDataIndex(creationDate, MonitoringTemplateUtils.TEMPLATE_VERSION); } /** @@ -206,7 +206,7 @@ public abstract class AbstractIndicesCleanerTestCase extends MarvelIntegTestCase * Creates a monitoring timestamped index using the current template version. */ protected void createTimestampedIndex(DateTime creationDate) { - createTimestampedIndex(creationDate, MarvelTemplateUtils.TEMPLATE_VERSION); + createTimestampedIndex(creationDate, MonitoringTemplateUtils.TEMPLATE_VERSION); } /** diff --git a/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/cleaner/CleanerServiceTests.java b/elasticsearch/x-pack/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/cleaner/CleanerServiceTests.java similarity index 97% rename from elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/cleaner/CleanerServiceTests.java rename to elasticsearch/x-pack/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/cleaner/CleanerServiceTests.java index 769ee62f4a3..89f2b72af5e 100644 --- a/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/cleaner/CleanerServiceTests.java +++ b/elasticsearch/x-pack/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/cleaner/CleanerServiceTests.java @@ -3,16 +3,16 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.marvel.cleaner; +package org.elasticsearch.xpack.monitoring.cleaner; import org.elasticsearch.common.settings.ClusterSettings; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.unit.TimeValue; -import org.elasticsearch.marvel.MonitoringSettings; -import org.elasticsearch.marvel.MonitoringLicensee; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.threadpool.TestThreadPool; import org.elasticsearch.threadpool.ThreadPool; +import org.elasticsearch.xpack.monitoring.MonitoringLicensee; +import org.elasticsearch.xpack.monitoring.MonitoringSettings; import org.joda.time.DateTime; import org.joda.time.DateTimeZone; import org.junit.After; diff --git a/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/cleaner/local/LocalIndicesCleanerTests.java b/elasticsearch/x-pack/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/cleaner/local/LocalIndicesCleanerTests.java similarity index 90% rename from elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/cleaner/local/LocalIndicesCleanerTests.java rename to elasticsearch/x-pack/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/cleaner/local/LocalIndicesCleanerTests.java index d36ea8f10c2..ff56bb9fd11 100644 --- a/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/cleaner/local/LocalIndicesCleanerTests.java +++ b/elasticsearch/x-pack/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/cleaner/local/LocalIndicesCleanerTests.java @@ -3,15 +3,15 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.marvel.cleaner.local; +package org.elasticsearch.xpack.monitoring.cleaner.local; import org.elasticsearch.cluster.metadata.IndexMetaData; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.index.IndexNotFoundException; -import org.elasticsearch.marvel.agent.exporter.local.LocalExporter; -import org.elasticsearch.marvel.cleaner.AbstractIndicesCleanerTestCase; import org.elasticsearch.plugins.Plugin; import org.elasticsearch.test.InternalSettingsPlugin; +import org.elasticsearch.xpack.monitoring.agent.exporter.local.LocalExporter; +import org.elasticsearch.xpack.monitoring.cleaner.AbstractIndicesCleanerTestCase; import org.joda.time.DateTime; import java.util.ArrayList; diff --git a/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/license/LicenseIntegrationTests.java b/elasticsearch/x-pack/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/license/LicenseIntegrationTests.java similarity index 95% rename from elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/license/LicenseIntegrationTests.java rename to elasticsearch/x-pack/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/license/LicenseIntegrationTests.java index fe7cec1ae51..b741512f376 100644 --- a/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/license/LicenseIntegrationTests.java +++ b/elasticsearch/x-pack/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/license/LicenseIntegrationTests.java @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.marvel.license; +package org.elasticsearch.xpack.monitoring.license; import org.elasticsearch.action.ActionRequest; import org.elasticsearch.action.ActionResponse; @@ -20,12 +20,12 @@ import org.elasticsearch.license.plugin.core.LicenseState; import org.elasticsearch.license.plugin.core.Licensee; import org.elasticsearch.license.plugin.core.LicenseeRegistry; import org.elasticsearch.license.plugin.core.LicensesManagerService; -import org.elasticsearch.marvel.MonitoringLicensee; -import org.elasticsearch.marvel.test.MarvelIntegTestCase; import org.elasticsearch.plugins.Plugin; import org.elasticsearch.plugins.ActionPlugin.ActionHandler; import org.elasticsearch.test.ESIntegTestCase.ClusterScope; import org.elasticsearch.xpack.XPackPlugin; +import org.elasticsearch.xpack.monitoring.MonitoringLicensee; +import org.elasticsearch.xpack.monitoring.test.MonitoringIntegTestCase; import java.util.ArrayList; import java.util.Arrays; @@ -40,7 +40,7 @@ import static org.hamcrest.Matchers.is; import static org.hamcrest.Matchers.isOneOf; @ClusterScope(scope = SUITE, transportClientRatio = 0, numClientNodes = 0) -public class LicenseIntegrationTests extends MarvelIntegTestCase { +public class LicenseIntegrationTests extends MonitoringIntegTestCase { @Override protected Collection> nodePlugins() { return Arrays.asList(InternalXPackPlugin.class); diff --git a/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/license/MarvelLicenseeTests.java b/elasticsearch/x-pack/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/license/MonitoringLicenseeTests.java similarity index 96% rename from elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/license/MarvelLicenseeTests.java rename to elasticsearch/x-pack/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/license/MonitoringLicenseeTests.java index 98bdf99bcb3..837816ad1e4 100644 --- a/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/license/MarvelLicenseeTests.java +++ b/elasticsearch/x-pack/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/license/MonitoringLicenseeTests.java @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.marvel.license; +package org.elasticsearch.xpack.monitoring.license; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.license.core.License.OperationMode; @@ -11,7 +11,7 @@ import org.elasticsearch.license.plugin.core.AbstractLicenseeTestCase; import org.elasticsearch.license.plugin.core.LicenseState; import org.elasticsearch.license.plugin.core.Licensee.Status; import org.elasticsearch.license.plugin.core.LicenseeRegistry; -import org.elasticsearch.marvel.MonitoringLicensee; +import org.elasticsearch.xpack.monitoring.MonitoringLicensee; import java.util.function.Predicate; @@ -26,7 +26,7 @@ import static org.mockito.Mockito.when; *

    * If you change the behavior of these tests, then it means that licensing changes for Monitoring! */ -public class MarvelLicenseeTests extends AbstractLicenseeTestCase { +public class MonitoringLicenseeTests extends AbstractLicenseeTestCase { private final LicenseeRegistry registry = mock(LicenseeRegistry.class); private final MonitoringLicensee licensee = new MonitoringLicensee(Settings.EMPTY, registry); diff --git a/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/security/MarvelInternalClientTests.java b/elasticsearch/x-pack/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/security/MonitoringInternalClientTests.java similarity index 93% rename from elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/security/MarvelInternalClientTests.java rename to elasticsearch/x-pack/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/security/MonitoringInternalClientTests.java index 3727e937679..6c37e15d673 100644 --- a/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/security/MarvelInternalClientTests.java +++ b/elasticsearch/x-pack/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/security/MonitoringInternalClientTests.java @@ -3,16 +3,16 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.marvel.security; +package org.elasticsearch.xpack.monitoring.security; import org.elasticsearch.ElasticsearchSecurityException; import org.elasticsearch.action.ActionRequestBuilder; import org.elasticsearch.common.network.NetworkModule; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.index.IndexNotFoundException; -import org.elasticsearch.marvel.MonitoringSettings; -import org.elasticsearch.marvel.test.MarvelIntegTestCase; import org.elasticsearch.rest.RestStatus; +import org.elasticsearch.xpack.monitoring.MonitoringSettings; +import org.elasticsearch.xpack.monitoring.test.MonitoringIntegTestCase; import org.elasticsearch.xpack.security.InternalClient; import java.util.ArrayList; @@ -20,7 +20,7 @@ import java.util.ArrayList; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked; import static org.hamcrest.Matchers.is; -public class MarvelInternalClientTests extends MarvelIntegTestCase { +public class MonitoringInternalClientTests extends MonitoringIntegTestCase { @Override protected Settings nodeSettings(int nodeOrdinal) { diff --git a/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/security/MarvelSettingsFilterTests.java b/elasticsearch/x-pack/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/security/MonitoringSettingsFilterTests.java similarity index 93% rename from elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/security/MarvelSettingsFilterTests.java rename to elasticsearch/x-pack/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/security/MonitoringSettingsFilterTests.java index 0bc1db070d6..c6603f67969 100644 --- a/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/security/MarvelSettingsFilterTests.java +++ b/elasticsearch/x-pack/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/security/MonitoringSettingsFilterTests.java @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.marvel.security; +package org.elasticsearch.xpack.monitoring.security; import org.apache.http.Header; import org.apache.http.message.BasicHeader; @@ -11,8 +11,8 @@ import org.elasticsearch.client.Response; import org.elasticsearch.common.network.NetworkModule; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.xcontent.json.JsonXContent; -import org.elasticsearch.marvel.MonitoringSettings; -import org.elasticsearch.marvel.test.MarvelIntegTestCase; +import org.elasticsearch.xpack.monitoring.MonitoringSettings; +import org.elasticsearch.xpack.monitoring.test.MonitoringIntegTestCase; import org.elasticsearch.xpack.security.authc.support.SecuredString; import org.hamcrest.Matchers; @@ -24,7 +24,7 @@ import static org.elasticsearch.xpack.security.authc.support.UsernamePasswordTok import static org.elasticsearch.xpack.security.authc.support.UsernamePasswordToken.basicAuthHeaderValue; import static org.hamcrest.CoreMatchers.nullValue; -public class MarvelSettingsFilterTests extends MarvelIntegTestCase { +public class MonitoringSettingsFilterTests extends MonitoringIntegTestCase { @Override protected Settings nodeSettings(int nodeOrdinal) { diff --git a/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/support/VersionUtilsTests.java b/elasticsearch/x-pack/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/support/VersionUtilsTests.java similarity index 97% rename from elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/support/VersionUtilsTests.java rename to elasticsearch/x-pack/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/support/VersionUtilsTests.java index 9f37cab21ac..e7f29f2d2ae 100644 --- a/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/support/VersionUtilsTests.java +++ b/elasticsearch/x-pack/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/support/VersionUtilsTests.java @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.marvel.support; +package org.elasticsearch.xpack.monitoring.support; import org.elasticsearch.Version; import org.elasticsearch.test.ESTestCase; diff --git a/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/test/MarvelIntegTestCase.java b/elasticsearch/x-pack/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/test/MonitoringIntegTestCase.java similarity index 93% rename from elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/test/MarvelIntegTestCase.java rename to elasticsearch/x-pack/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/test/MonitoringIntegTestCase.java index ef97b11204a..620ded5c39b 100644 --- a/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/test/MarvelIntegTestCase.java +++ b/elasticsearch/x-pack/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/test/MonitoringIntegTestCase.java @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.marvel.test; +package org.elasticsearch.xpack.monitoring.test; import org.elasticsearch.ElasticsearchException; import org.elasticsearch.client.Client; @@ -17,20 +17,7 @@ import org.elasticsearch.common.util.concurrent.CountDown; import org.elasticsearch.common.xcontent.ToXContent; import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.index.IndexNotFoundException; -import org.elasticsearch.marvel.MonitoredSystem; -import org.elasticsearch.marvel.MonitoringSettings; -import org.elasticsearch.marvel.agent.AgentService; -import org.elasticsearch.marvel.agent.exporter.MonitoringDoc; -import org.elasticsearch.marvel.agent.resolver.MonitoringIndexNameResolver; -import org.elasticsearch.marvel.agent.resolver.ResolversRegistry; -import org.elasticsearch.marvel.client.MonitoringClient; import org.elasticsearch.plugins.Plugin; -import org.elasticsearch.xpack.security.Security; -import org.elasticsearch.xpack.security.authc.file.FileRealm; -import org.elasticsearch.xpack.security.authc.support.Hasher; -import org.elasticsearch.xpack.security.authc.support.SecuredString; -import org.elasticsearch.xpack.security.authz.store.FileRolesStore; -import org.elasticsearch.xpack.security.crypto.InternalCryptoService; import org.elasticsearch.test.ESIntegTestCase; import org.elasticsearch.test.TestCluster; import org.elasticsearch.test.store.MockFSIndexStore; @@ -38,6 +25,19 @@ import org.elasticsearch.test.transport.AssertingLocalTransport; import org.elasticsearch.test.transport.MockTransportService; import org.elasticsearch.xpack.XPackClient; import org.elasticsearch.xpack.XPackPlugin; +import org.elasticsearch.xpack.monitoring.MonitoredSystem; +import org.elasticsearch.xpack.monitoring.MonitoringSettings; +import org.elasticsearch.xpack.monitoring.agent.AgentService; +import org.elasticsearch.xpack.monitoring.agent.exporter.MonitoringDoc; +import org.elasticsearch.xpack.monitoring.agent.resolver.MonitoringIndexNameResolver; +import org.elasticsearch.xpack.monitoring.agent.resolver.ResolversRegistry; +import org.elasticsearch.xpack.monitoring.client.MonitoringClient; +import org.elasticsearch.xpack.security.Security; +import org.elasticsearch.xpack.security.authc.file.FileRealm; +import org.elasticsearch.xpack.security.authc.support.Hasher; +import org.elasticsearch.xpack.security.authc.support.SecuredString; +import org.elasticsearch.xpack.security.authz.store.FileRolesStore; +import org.elasticsearch.xpack.security.crypto.InternalCryptoService; import org.elasticsearch.xpack.watcher.Watcher; import org.hamcrest.Matcher; import org.jboss.netty.util.internal.SystemPropertyUtil; @@ -60,8 +60,8 @@ import java.util.function.Function; import java.util.stream.Collectors; import java.util.stream.StreamSupport; -import static org.elasticsearch.xpack.security.authc.support.UsernamePasswordToken.basicAuthHeaderValue; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked; +import static org.elasticsearch.xpack.security.authc.support.UsernamePasswordToken.basicAuthHeaderValue; import static org.hamcrest.Matchers.allOf; import static org.hamcrest.Matchers.greaterThan; import static org.hamcrest.Matchers.is; @@ -70,7 +70,7 @@ import static org.hamcrest.Matchers.lessThan; /** * */ -public abstract class MarvelIntegTestCase extends ESIntegTestCase { +public abstract class MonitoringIntegTestCase extends ESIntegTestCase { public static final String MONITORING_INDICES_PREFIX = MonitoringIndexNameResolver.PREFIX + MonitoringIndexNameResolver.DELIMITER; @@ -209,7 +209,7 @@ public abstract class MarvelIntegTestCase extends ESIntegTestCase { } } - protected void wipeMarvelIndices() throws Exception { + protected void wipeMonitoringIndices() throws Exception { CountDown retries = new CountDown(3); assertBusy(new Runnable() { @Override @@ -218,7 +218,7 @@ public abstract class MarvelIntegTestCase extends ESIntegTestCase { boolean exist = client().admin().indices().prepareExists(MONITORING_INDICES_PREFIX + "*") .get().isExists(); if (exist) { - deleteMarvelIndices(); + deleteMonitoringIndices(); } else { retries.countDown(); } @@ -230,23 +230,23 @@ public abstract class MarvelIntegTestCase extends ESIntegTestCase { }); } - protected void deleteMarvelIndices() { + protected void deleteMonitoringIndices() { if (securityEnabled) { try { assertAcked(client().admin().indices().prepareDelete(MONITORING_INDICES_PREFIX + "*")); } catch (IndexNotFoundException e) { - // if security couldn't resolve any marvel index, it'll throw index not found exception. + // if security couldn't resolve any monitoring index, it'll throw index not found exception. } } else { assertAcked(client().admin().indices().prepareDelete(MONITORING_INDICES_PREFIX + "*")); } } - protected void awaitMarvelDocsCount(Matcher matcher, String... types) throws Exception { - assertBusy(() -> assertMarvelDocsCount(matcher, types), 30, TimeUnit.SECONDS); + protected void awaitMonitoringDocsCount(Matcher matcher, String... types) throws Exception { + assertBusy(() -> assertMonitoringDocsCount(matcher, types), 30, TimeUnit.SECONDS); } - protected void ensureMarvelIndicesYellow() { + protected void ensureMonitoringIndicesYellow() { if (securityEnabled) { try { ensureYellow(".monitoring-es-*"); @@ -258,7 +258,7 @@ public abstract class MarvelIntegTestCase extends ESIntegTestCase { } } - protected void assertMarvelDocsCount(Matcher matcher, String... types) { + protected void assertMonitoringDocsCount(Matcher matcher, String... types) { try { securedFlushAndRefresh(MONITORING_INDICES_PREFIX + "*"); long count = client().prepareSearch(MONITORING_INDICES_PREFIX + "*") @@ -289,7 +289,7 @@ public abstract class MarvelIntegTestCase extends ESIntegTestCase { assertTrue("failed to find a template matching [" + name + "]", found); } - protected void waitForMarvelTemplate(String name) throws Exception { + protected void waitForMonitoringTemplate(String name) throws Exception { assertBusy(new Runnable() { @Override public void run() { @@ -298,13 +298,13 @@ public abstract class MarvelIntegTestCase extends ESIntegTestCase { }, 30, TimeUnit.SECONDS); } - protected void waitForMarvelTemplates() throws Exception { + protected void waitForMonitoringTemplates() throws Exception { assertBusy(() -> monitoringTemplates().keySet().forEach(this::assertTemplateInstalled), 30, TimeUnit.SECONDS); } - protected void waitForMarvelIndices() throws Exception { + protected void waitForMonitoringIndices() throws Exception { awaitIndexExists(MONITORING_INDICES_PREFIX + "*"); - assertBusy(this::ensureMarvelIndicesYellow); + assertBusy(this::ensureMonitoringIndicesYellow); } protected void awaitIndexExists(final String index) throws Exception { @@ -433,7 +433,7 @@ public abstract class MarvelIntegTestCase extends ESIntegTestCase { return parent + "." + field; } - protected void updateMarvelInterval(long value, TimeUnit timeUnit) { + protected void updateMonitoringInterval(long value, TimeUnit timeUnit) { assertAcked(client().admin().cluster().prepareUpdateSettings().setTransientSettings( Settings.builder().put(MonitoringSettings.INTERVAL.getKey(), value, timeUnit))); } @@ -528,7 +528,7 @@ public abstract class MarvelIntegTestCase extends ESIntegTestCase { return; } try { - Path folder = createTempDir().resolve("marvel_security"); + Path folder = createTempDir().resolve("monitoring_security"); Files.createDirectories(folder); builder.put("xpack.security.enabled", true) diff --git a/elasticsearch/x-pack/marvel/src/test/resources/log4j.properties b/elasticsearch/x-pack/monitoring/src/test/resources/log4j.properties similarity index 85% rename from elasticsearch/x-pack/marvel/src/test/resources/log4j.properties rename to elasticsearch/x-pack/monitoring/src/test/resources/log4j.properties index 1a3fffd3f21..e3c658e4f28 100644 --- a/elasticsearch/x-pack/marvel/src/test/resources/log4j.properties +++ b/elasticsearch/x-pack/monitoring/src/test/resources/log4j.properties @@ -8,4 +8,4 @@ log4j.appender.out=org.apache.log4j.ConsoleAppender log4j.appender.out.layout=org.apache.log4j.PatternLayout log4j.appender.out.layout.conversionPattern=[%d{ISO8601}][%-5p][%-25c] %m%n -log4j.logger.org.elasticsearch.marvel=TRACE +log4j.logger.org.elasticsearch.xpack.monitoring=TRACE diff --git a/elasticsearch/x-pack/marvel/src/test/resources/monitoring-test.json b/elasticsearch/x-pack/monitoring/src/test/resources/monitoring-test.json similarity index 100% rename from elasticsearch/x-pack/marvel/src/test/resources/monitoring-test.json rename to elasticsearch/x-pack/monitoring/src/test/resources/monitoring-test.json diff --git a/elasticsearch/x-pack/marvel/src/test/resources/rest-api-spec/api/xpack.monitoring.bulk.json b/elasticsearch/x-pack/monitoring/src/test/resources/rest-api-spec/api/xpack.monitoring.bulk.json similarity index 89% rename from elasticsearch/x-pack/marvel/src/test/resources/rest-api-spec/api/xpack.monitoring.bulk.json rename to elasticsearch/x-pack/monitoring/src/test/resources/rest-api-spec/api/xpack.monitoring.bulk.json index 0364bbef636..a884fa43bbe 100644 --- a/elasticsearch/x-pack/marvel/src/test/resources/rest-api-spec/api/xpack.monitoring.bulk.json +++ b/elasticsearch/x-pack/monitoring/src/test/resources/rest-api-spec/api/xpack.monitoring.bulk.json @@ -1,6 +1,6 @@ { "xpack.monitoring.bulk": { - "documentation": "http://www.elastic.co/guide/en/marvel/current/appendix-api-bulk.html", + "documentation": "http://www.elastic.co/guide/en/monitoring/current/appendix-api-bulk.html", "methods": ["POST", "PUT"], "url": { "path": "/_xpack/monitoring/_bulk", diff --git a/elasticsearch/x-pack/marvel/src/test/resources/rest-api-spec/test/monitoring/bulk/10_basic.yaml b/elasticsearch/x-pack/monitoring/src/test/resources/rest-api-spec/test/monitoring/bulk/10_basic.yaml similarity index 100% rename from elasticsearch/x-pack/marvel/src/test/resources/rest-api-spec/test/monitoring/bulk/10_basic.yaml rename to elasticsearch/x-pack/monitoring/src/test/resources/rest-api-spec/test/monitoring/bulk/10_basic.yaml diff --git a/elasticsearch/x-pack/security/config/x-pack/roles.yml b/elasticsearch/x-pack/security/config/x-pack/roles.yml index 774f5ac8684..d90d16e6921 100644 --- a/elasticsearch/x-pack/security/config/x-pack/roles.yml +++ b/elasticsearch/x-pack/security/config/x-pack/roles.yml @@ -8,7 +8,7 @@ logstash: - read - create_index -# Marvel user role. Assign to marvel users. +# Monitoring user role. Assign to monitoring users. monitoring_user: indices: - names: @@ -20,8 +20,8 @@ monitoring_user: - view_index_metadata - read -# Marvel remote agent role. Assign to the agent user on the remote marvel cluster -# to which the marvel agent will export all its data +# Monitoring remote agent role. Assign to the agent user on the remote monitoring cluster +# to which the monitoring agent will export all its data remote_monitoring_agent: cluster: [ "manage_index_templates", "monitor" ] indices: diff --git a/elasticsearch/x-pack/security/src/main/java/org/elasticsearch/xpack/security/authz/permission/KibanaRole.java b/elasticsearch/x-pack/security/src/main/java/org/elasticsearch/xpack/security/authz/permission/KibanaRole.java index 74db969b0ab..e75551d2f56 100644 --- a/elasticsearch/x-pack/security/src/main/java/org/elasticsearch/xpack/security/authz/permission/KibanaRole.java +++ b/elasticsearch/x-pack/security/src/main/java/org/elasticsearch/xpack/security/authz/permission/KibanaRole.java @@ -5,7 +5,7 @@ */ package org.elasticsearch.xpack.security.authz.permission; -import org.elasticsearch.marvel.action.MonitoringBulkAction; +import org.elasticsearch.xpack.monitoring.action.MonitoringBulkAction; import org.elasticsearch.xpack.security.authz.RoleDescriptor; import org.elasticsearch.xpack.security.authz.privilege.ClusterPrivilege; import org.elasticsearch.xpack.security.authz.privilege.Privilege.Name; diff --git a/elasticsearch/x-pack/security/src/test/java/org/elasticsearch/test/SecuritySettingsSource.java b/elasticsearch/x-pack/security/src/test/java/org/elasticsearch/test/SecuritySettingsSource.java index ab581e8af55..0a026b3b6f8 100644 --- a/elasticsearch/x-pack/security/src/test/java/org/elasticsearch/test/SecuritySettingsSource.java +++ b/elasticsearch/x-pack/security/src/test/java/org/elasticsearch/test/SecuritySettingsSource.java @@ -10,7 +10,7 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.PathUtils; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.util.concurrent.ThreadContext; -import org.elasticsearch.marvel.Monitoring; +import org.elasticsearch.xpack.monitoring.Monitoring; import org.elasticsearch.plugins.Plugin; import org.elasticsearch.test.ESIntegTestCase.Scope; import org.elasticsearch.xpack.security.authc.file.FileRealm; diff --git a/elasticsearch/x-pack/security/src/test/java/org/elasticsearch/xpack/security/authz/permission/KibanaRoleTests.java b/elasticsearch/x-pack/security/src/test/java/org/elasticsearch/xpack/security/authz/permission/KibanaRoleTests.java index 30b8b0b62a8..451257a36f6 100644 --- a/elasticsearch/x-pack/security/src/test/java/org/elasticsearch/xpack/security/authz/permission/KibanaRoleTests.java +++ b/elasticsearch/x-pack/security/src/test/java/org/elasticsearch/xpack/security/authz/permission/KibanaRoleTests.java @@ -16,7 +16,7 @@ import org.elasticsearch.action.admin.indices.settings.put.UpdateSettingsAction; import org.elasticsearch.action.admin.indices.template.put.PutIndexTemplateAction; import org.elasticsearch.action.delete.DeleteAction; import org.elasticsearch.action.index.IndexAction; -import org.elasticsearch.marvel.action.MonitoringBulkAction; +import org.elasticsearch.xpack.monitoring.action.MonitoringBulkAction; import org.elasticsearch.xpack.security.authc.Authentication; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.transport.TransportRequest; diff --git a/elasticsearch/x-pack/security/src/test/java/org/elasticsearch/xpack/security/authz/permission/KibanaUserRoleTests.java b/elasticsearch/x-pack/security/src/test/java/org/elasticsearch/xpack/security/authz/permission/KibanaUserRoleTests.java index 994ebbbf723..36ba19047e6 100644 --- a/elasticsearch/x-pack/security/src/test/java/org/elasticsearch/xpack/security/authz/permission/KibanaUserRoleTests.java +++ b/elasticsearch/x-pack/security/src/test/java/org/elasticsearch/xpack/security/authz/permission/KibanaUserRoleTests.java @@ -18,7 +18,7 @@ import org.elasticsearch.action.delete.DeleteAction; import org.elasticsearch.action.index.IndexAction; import org.elasticsearch.action.search.MultiSearchAction; import org.elasticsearch.action.search.SearchAction; -import org.elasticsearch.marvel.action.MonitoringBulkAction; +import org.elasticsearch.xpack.monitoring.action.MonitoringBulkAction; import org.elasticsearch.xpack.security.authc.Authentication; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.transport.TransportRequest; diff --git a/elasticsearch/x-pack/security/src/test/resources/org/elasticsearch/transport/actions b/elasticsearch/x-pack/security/src/test/resources/org/elasticsearch/transport/actions index 0f984306848..f680b281f94 100644 --- a/elasticsearch/x-pack/security/src/test/resources/org/elasticsearch/transport/actions +++ b/elasticsearch/x-pack/security/src/test/resources/org/elasticsearch/transport/actions @@ -79,6 +79,7 @@ cluster:monitor/xpack/usage cluster:monitor/xpack/license/get cluster:admin/xpack/license/delete cluster:admin/xpack/license/put +cluster:admin/xpack/monitoring/bulk cluster:admin/xpack/security/realm/cache/clear cluster:admin/xpack/security/roles/cache/clear cluster:admin/xpack/security/user/authenticate diff --git a/elasticsearch/x-pack/security/src/test/resources/org/elasticsearch/xpack/security/authz/store/default_roles.yml b/elasticsearch/x-pack/security/src/test/resources/org/elasticsearch/xpack/security/authz/store/default_roles.yml index 8a15b4afcd7..3ab7820fb73 100644 --- a/elasticsearch/x-pack/security/src/test/resources/org/elasticsearch/xpack/security/authz/store/default_roles.yml +++ b/elasticsearch/x-pack/security/src/test/resources/org/elasticsearch/xpack/security/authz/store/default_roles.yml @@ -8,7 +8,7 @@ logstash: - read - create_index -# Marvel user role. Assign to marvel users. +# Monitoring user role. Assign to monitoring users. monitoring_user: indices: - names: @@ -20,8 +20,8 @@ monitoring_user: - view_index_metadata - read -# Marvel remote agent role. Assign to the agent user on the remote marvel cluster -# to which the marvel agent will export all its data +# Monitoring remote agent role. Assign to the agent user on the remote monitoring cluster +# to which the monitoring agent will export all its data remote_monitoring_agent: cluster: [ "manage_index_templates" ] indices: diff --git a/elasticsearch/x-pack/src/main/java/org/elasticsearch/xpack/XPackClient.java b/elasticsearch/x-pack/src/main/java/org/elasticsearch/xpack/XPackClient.java index 4f54624f516..3a233022fda 100644 --- a/elasticsearch/x-pack/src/main/java/org/elasticsearch/xpack/XPackClient.java +++ b/elasticsearch/x-pack/src/main/java/org/elasticsearch/xpack/XPackClient.java @@ -8,7 +8,7 @@ package org.elasticsearch.xpack; import org.elasticsearch.action.ActionListener; import org.elasticsearch.client.Client; import org.elasticsearch.license.plugin.LicensingClient; -import org.elasticsearch.marvel.client.MonitoringClient; +import org.elasticsearch.xpack.monitoring.client.MonitoringClient; import org.elasticsearch.xpack.security.authc.support.SecuredString; import org.elasticsearch.xpack.security.client.SecurityClient; import org.elasticsearch.xpack.watcher.client.WatcherClient; diff --git a/elasticsearch/x-pack/src/main/java/org/elasticsearch/xpack/XPackPlugin.java b/elasticsearch/x-pack/src/main/java/org/elasticsearch/xpack/XPackPlugin.java index 974261b15e5..6878b68c678 100644 --- a/elasticsearch/x-pack/src/main/java/org/elasticsearch/xpack/XPackPlugin.java +++ b/elasticsearch/x-pack/src/main/java/org/elasticsearch/xpack/XPackPlugin.java @@ -21,8 +21,8 @@ import org.elasticsearch.common.settings.Settings; import org.elasticsearch.env.Environment; import org.elasticsearch.index.IndexModule; import org.elasticsearch.license.plugin.Licensing; -import org.elasticsearch.marvel.Monitoring; -import org.elasticsearch.marvel.MonitoringSettings; +import org.elasticsearch.xpack.monitoring.Monitoring; +import org.elasticsearch.xpack.monitoring.MonitoringSettings; import org.elasticsearch.plugins.ActionPlugin; import org.elasticsearch.plugins.Plugin; import org.elasticsearch.plugins.ScriptPlugin; diff --git a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/WatcherPluginDisableTests.java b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/WatcherPluginDisableTests.java index 17235571e41..edd002d8d13 100644 --- a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/WatcherPluginDisableTests.java +++ b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/WatcherPluginDisableTests.java @@ -12,7 +12,7 @@ import org.elasticsearch.client.ResponseException; import org.elasticsearch.common.network.NetworkModule; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.http.HttpServerTransport; -import org.elasticsearch.marvel.Monitoring; +import org.elasticsearch.xpack.monitoring.Monitoring; import org.elasticsearch.plugins.Plugin; import org.elasticsearch.xpack.security.Security; import org.elasticsearch.test.ESIntegTestCase; diff --git a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/test/AbstractWatcherIntegrationTestCase.java b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/test/AbstractWatcherIntegrationTestCase.java index a848fdd69d8..c0e046756d4 100644 --- a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/test/AbstractWatcherIntegrationTestCase.java +++ b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/test/AbstractWatcherIntegrationTestCase.java @@ -22,7 +22,7 @@ import org.elasticsearch.common.util.Callback; import org.elasticsearch.common.xcontent.XContentHelper; import org.elasticsearch.common.xcontent.support.XContentMapValues; import org.elasticsearch.index.query.QueryBuilder; -import org.elasticsearch.marvel.Monitoring; +import org.elasticsearch.xpack.monitoring.Monitoring; import org.elasticsearch.plugins.Plugin; import org.elasticsearch.script.MockMustacheScriptEngine; import org.elasticsearch.search.SearchHit; diff --git a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/test/integration/WatcherSettingsFilterTests.java b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/test/integration/WatcherSettingsFilterTests.java index 4b9ea2d045d..bce92636f85 100644 --- a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/test/integration/WatcherSettingsFilterTests.java +++ b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/test/integration/WatcherSettingsFilterTests.java @@ -14,7 +14,7 @@ import org.elasticsearch.common.network.NetworkModule; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.xcontent.json.JsonXContent; import org.elasticsearch.common.xcontent.support.XContentMapValues; -import org.elasticsearch.marvel.test.MarvelIntegTestCase; +import org.elasticsearch.xpack.monitoring.test.MonitoringIntegTestCase; import org.elasticsearch.xpack.security.authc.support.SecuredString; import org.elasticsearch.xpack.watcher.test.AbstractWatcherIntegrationTestCase; import org.junit.After; @@ -53,8 +53,8 @@ public class WatcherSettingsFilterTests extends AbstractWatcherIntegrationTestCa if (securityEnabled()) { headers = new Header[] { new BasicHeader(BASIC_AUTH_HEADER, - basicAuthHeaderValue(MarvelIntegTestCase.SecuritySettings.TEST_USERNAME, - new SecuredString(MarvelIntegTestCase.SecuritySettings.TEST_PASSWORD.toCharArray())))}; + basicAuthHeaderValue(MonitoringIntegTestCase.SecuritySettings.TEST_USERNAME, + new SecuredString(MonitoringIntegTestCase.SecuritySettings.TEST_PASSWORD.toCharArray())))}; } else { headers = new Header[0]; }