Merge remote-tracking branch 'origin/master' into migrate-tool-master

Original commit: elastic/x-pack-elasticsearch@eaa4b2923f
This commit is contained in:
Lee Hinman 2016-06-29 09:30:07 -06:00
commit db39da77c5
162 changed files with 1012 additions and 962 deletions

View File

@ -174,7 +174,7 @@ integTest {
setupCommand 'setupTestUser', setupCommand 'setupTestUser',
'bin/x-pack/users', 'useradd', 'test_user', '-p', 'changeme', '-r', 'superuser' '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' 'bin/x-pack/users', 'useradd', 'monitoring_agent', '-p', 'changeme', '-r', 'remote_monitoring_agent'
// Required to detect that the monitoring agent service has started // Required to detect that the monitoring agent service has started

View File

@ -57,7 +57,7 @@ dependencies {
// we keep the source directories in the original structure of split plugins, // 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 // 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 { sourceSets {
main { main {
java.srcDir("${module}src/main/java") java.srcDir("${module}src/main/java")

View File

@ -5,14 +5,16 @@
*/ */
package org.elasticsearch.xpack.graph; 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.component.LifecycleComponent;
import org.elasticsearch.common.inject.Module; import org.elasticsearch.common.inject.Module;
import org.elasticsearch.common.network.NetworkModule; import org.elasticsearch.common.network.NetworkModule;
import org.elasticsearch.common.settings.Setting; import org.elasticsearch.common.settings.Setting;
import org.elasticsearch.common.settings.Settings; 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.Plugin;
import org.elasticsearch.plugins.ActionPlugin.ActionHandler;
import org.elasticsearch.xpack.XPackPlugin; import org.elasticsearch.xpack.XPackPlugin;
import org.elasticsearch.xpack.graph.action.GraphExploreAction; import org.elasticsearch.xpack.graph.action.GraphExploreAction;
import org.elasticsearch.xpack.graph.action.TransportGraphExploreAction; import org.elasticsearch.xpack.graph.action.TransportGraphExploreAction;
@ -22,7 +24,10 @@ import java.util.Collection;
import java.util.Collections; import java.util.Collections;
import java.util.List; 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"; public static final String NAME = "graph";
private final boolean transportClientMode; private final boolean transportClientMode;
@ -50,10 +55,12 @@ public class Graph extends Plugin {
return Collections.singletonList(GraphLicensee.class); return Collections.singletonList(GraphLicensee.class);
} }
public void onModule(ActionModule actionModule) { @Override
public List<ActionHandler<? extends ActionRequest<?>, ? extends ActionResponse>> getActions() {
if (enabled) { if (enabled) {
actionModule.registerAction(GraphExploreAction.INSTANCE, TransportGraphExploreAction.class); return singletonList(new ActionHandler<>(GraphExploreAction.INSTANCE, TransportGraphExploreAction.class));
} }
return emptyList();
} }
public void onModule(NetworkModule module) { public void onModule(NetworkModule module) {

View File

@ -13,14 +13,13 @@ import org.elasticsearch.common.settings.Settings.Builder;
import org.elasticsearch.common.unit.TimeValue; import org.elasticsearch.common.unit.TimeValue;
import org.elasticsearch.index.query.QueryBuilders; import org.elasticsearch.index.query.QueryBuilders;
import org.elasticsearch.index.query.ScriptQueryBuilder; 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.Plugin;
import org.elasticsearch.plugins.ScriptPlugin; import org.elasticsearch.plugins.ScriptPlugin;
import org.elasticsearch.script.AbstractSearchScript; import org.elasticsearch.script.AbstractSearchScript;
import org.elasticsearch.script.ExecutableScript; import org.elasticsearch.script.ExecutableScript;
import org.elasticsearch.script.NativeScriptFactory; import org.elasticsearch.script.NativeScriptFactory;
import org.elasticsearch.script.Script; import org.elasticsearch.script.Script;
import org.elasticsearch.script.ScriptModule;
import org.elasticsearch.script.ScriptService.ScriptType; import org.elasticsearch.script.ScriptService.ScriptType;
import org.elasticsearch.xpack.security.Security; import org.elasticsearch.xpack.security.Security;
import org.elasticsearch.test.ESSingleNodeTestCase; import org.elasticsearch.test.ESSingleNodeTestCase;

View File

@ -5,7 +5,8 @@
*/ */
package org.elasticsearch.license.plugin; 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.cluster.metadata.MetaData;
import org.elasticsearch.common.component.LifecycleComponent; import org.elasticsearch.common.component.LifecycleComponent;
import org.elasticsearch.common.inject.Inject; 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.network.NetworkModule;
import org.elasticsearch.common.settings.Setting; import org.elasticsearch.common.settings.Setting;
import org.elasticsearch.common.settings.Settings; 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.DeleteLicenseAction;
import org.elasticsearch.license.plugin.action.delete.TransportDeleteLicenseAction; import org.elasticsearch.license.plugin.action.delete.TransportDeleteLicenseAction;
import org.elasticsearch.license.plugin.action.get.GetLicenseAction; 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.RestDeleteLicenseAction;
import org.elasticsearch.license.plugin.rest.RestGetLicenseAction; import org.elasticsearch.license.plugin.rest.RestGetLicenseAction;
import org.elasticsearch.license.plugin.rest.RestPutLicenseAction; import org.elasticsearch.license.plugin.rest.RestPutLicenseAction;
import org.elasticsearch.plugins.ActionPlugin;
import java.util.Arrays;
import java.util.Collection; import java.util.Collection;
import java.util.Collections; import java.util.Collections;
import java.util.List; 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.isTribeNode;
import static org.elasticsearch.xpack.XPackPlugin.transportClientMode; import static org.elasticsearch.xpack.XPackPlugin.transportClientMode;
public class Licensing { public class Licensing implements ActionPlugin {
public static final String NAME = "license"; public static final String NAME = "license";
private final boolean isTransportClient; private final boolean isTransportClient;
@ -59,12 +61,14 @@ public class Licensing {
} }
} }
public void onModule(ActionModule module) { @Override
if (isTribeNode == false) { public List<ActionHandler<? extends ActionRequest<?>, ? extends ActionResponse>> getActions() {
module.registerAction(PutLicenseAction.INSTANCE, TransportPutLicenseAction.class); if (isTribeNode) {
module.registerAction(GetLicenseAction.INSTANCE, TransportGetLicenseAction.class); return emptyList();
module.registerAction(DeleteLicenseAction.INSTANCE, TransportDeleteLicenseAction.class);
} }
return Arrays.asList(new ActionHandler<>(PutLicenseAction.INSTANCE, TransportPutLicenseAction.class),
new ActionHandler<>(GetLicenseAction.INSTANCE, TransportGetLicenseAction.class),
new ActionHandler<>(DeleteLicenseAction.INSTANCE, TransportDeleteLicenseAction.class));
} }
public Collection<Class<? extends LifecycleComponent>> nodeServices() { public Collection<Class<? extends LifecycleComponent>> nodeServices() {

View File

@ -23,7 +23,7 @@ import org.elasticsearch.license.plugin.core.LicenseState;
import org.elasticsearch.license.plugin.core.LicensesManagerService; import org.elasticsearch.license.plugin.core.LicensesManagerService;
import org.elasticsearch.license.plugin.core.LicensesMetaData; import org.elasticsearch.license.plugin.core.LicensesMetaData;
import org.elasticsearch.license.plugin.core.LicensesStatus; 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.plugins.Plugin;
import org.elasticsearch.xpack.security.Security; import org.elasticsearch.xpack.security.Security;
import org.elasticsearch.test.ESIntegTestCase; import org.elasticsearch.test.ESIntegTestCase;

View File

@ -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.PutLicenseRequestBuilder;
import org.elasticsearch.license.plugin.action.put.PutLicenseResponse; import org.elasticsearch.license.plugin.action.put.PutLicenseResponse;
import org.elasticsearch.license.plugin.core.LicensesStatus; 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.node.Node;
import org.elasticsearch.plugins.Plugin; import org.elasticsearch.plugins.Plugin;
import org.elasticsearch.xpack.security.Security; import org.elasticsearch.xpack.security.Security;

View File

@ -20,7 +20,7 @@ import org.elasticsearch.common.network.NetworkModule;
import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.transport.TransportAddress; import org.elasticsearch.common.transport.TransportAddress;
import org.elasticsearch.discovery.zen.ping.unicast.UnicastZenPing; 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.node.Node;
import org.elasticsearch.plugins.Plugin; import org.elasticsearch.plugins.Plugin;
import org.elasticsearch.xpack.security.Security; import org.elasticsearch.xpack.security.Security;

View File

@ -3,7 +3,7 @@
* or more contributor license agreements. Licensed under the Elastic License; * or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with 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; import java.util.Locale;

View File

@ -3,22 +3,24 @@
* or more contributor license agreements. Licensed under the Elastic License; * or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with 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.ActionModule; import org.elasticsearch.action.ActionRequest;
import org.elasticsearch.action.ActionResponse;
import org.elasticsearch.common.component.LifecycleComponent; import org.elasticsearch.common.component.LifecycleComponent;
import org.elasticsearch.common.inject.Module; import org.elasticsearch.common.inject.Module;
import org.elasticsearch.common.network.NetworkModule; import org.elasticsearch.common.network.NetworkModule;
import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.settings.SettingsModule; import org.elasticsearch.xpack.XPackPlugin;
import org.elasticsearch.marvel.action.MonitoringBulkAction; import org.elasticsearch.xpack.monitoring.action.MonitoringBulkAction;
import org.elasticsearch.marvel.action.TransportMonitoringBulkAction; import org.elasticsearch.xpack.monitoring.action.TransportMonitoringBulkAction;
import org.elasticsearch.marvel.agent.AgentService; import org.elasticsearch.xpack.monitoring.agent.AgentService;
import org.elasticsearch.marvel.agent.collector.CollectorModule; import org.elasticsearch.xpack.monitoring.agent.collector.CollectorModule;
import org.elasticsearch.marvel.agent.exporter.ExporterModule; import org.elasticsearch.xpack.monitoring.agent.exporter.ExporterModule;
import org.elasticsearch.marvel.cleaner.CleanerService; import org.elasticsearch.xpack.monitoring.cleaner.CleanerService;
import org.elasticsearch.marvel.client.MonitoringClientModule; import org.elasticsearch.xpack.monitoring.client.MonitoringClientModule;
import org.elasticsearch.marvel.rest.action.RestMonitoringBulkAction; import org.elasticsearch.xpack.monitoring.rest.action.RestMonitoringBulkAction;
import org.elasticsearch.plugins.ActionPlugin;
import org.elasticsearch.xpack.XPackPlugin; import org.elasticsearch.xpack.XPackPlugin;
import java.util.ArrayList; import java.util.ArrayList;
@ -27,13 +29,16 @@ import java.util.Collection;
import java.util.Collections; import java.util.Collections;
import java.util.List; 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: * 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 * - node clients: all modules are binded
* - transport clients: only action/transport actions are binded * - transport clients: only action/transport actions are binded
* - tribe clients: everything is disables by default but can be enabled per tribe cluster * - 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"; public static final String NAME = "monitoring";
@ -77,10 +82,12 @@ public class Monitoring {
CleanerService.class); CleanerService.class);
} }
public void onModule(ActionModule module) { @Override
public List<ActionHandler<? extends ActionRequest<?>, ? extends ActionResponse>> getActions() {
if (enabled && tribeNode == false) { 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) { public void onModule(NetworkModule module) {

View File

@ -3,7 +3,7 @@
* or more contributor license agreements. Licensed under the Elastic License; * or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with 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.Nullable;
import org.elasticsearch.common.inject.Inject; 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.io.stream.StreamOutput;
import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.xcontent.XContentBuilder; 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.XPackFeatureSet;
import org.elasticsearch.xpack.monitoring.agent.exporter.Exporter;
import org.elasticsearch.xpack.monitoring.agent.exporter.Exporters;
import java.io.IOException; import java.io.IOException;
import java.util.HashMap; import java.util.HashMap;

View File

@ -3,7 +3,7 @@
* or more contributor license agreements. Licensed under the Elastic License; * or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with 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.Strings;
import org.elasticsearch.common.inject.Inject; import org.elasticsearch.common.inject.Inject;
@ -17,7 +17,7 @@ import org.elasticsearch.license.plugin.core.Licensee;
import org.elasticsearch.license.plugin.core.LicenseeRegistry; 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.
* <p> * <p>
* Once the license expires, the agent will stop: * Once the license expires, the agent will stop:
* <ul> * <ul>

View File

@ -3,13 +3,13 @@
* or more contributor license agreements. Licensed under the Elastic License; * or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with 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.AbstractModule;
import org.elasticsearch.common.inject.util.Providers; 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.XPackPlugin;
import org.elasticsearch.xpack.monitoring.agent.AgentService;
import org.elasticsearch.xpack.monitoring.cleaner.CleanerService;
public class MonitoringModule extends AbstractModule { public class MonitoringModule extends AbstractModule {

View File

@ -3,7 +3,7 @@
* or more contributor license agreements. Licensed under the Elastic License; * or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with 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.Booleans;
import org.elasticsearch.common.component.AbstractComponent; 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.ClusterSettings;
import org.elasticsearch.common.settings.Setting; import org.elasticsearch.common.settings.Setting;
import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.settings.SettingsModule;
import org.elasticsearch.common.unit.TimeValue; import org.elasticsearch.common.unit.TimeValue;
import org.elasticsearch.xpack.XPackPlugin; import org.elasticsearch.xpack.XPackPlugin;
@ -43,7 +42,7 @@ public class MonitoringSettings extends AbstractComponent {
public static final Setting<Boolean> ENABLED = public static final Setting<Boolean> ENABLED =
new Setting<>(XPackPlugin.featureEnabledSetting(Monitoring.NAME), 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)), (s) -> String.valueOf(!XPackPlugin.isTribeNode(s) && !XPackPlugin.isTribeClientNode(s)),
Booleans::parseBooleanExact, Booleans::parseBooleanExact,

View File

@ -3,7 +3,7 @@
* or more contributor license agreements. Licensed under the Elastic License; * or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with 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.action.Action;
import org.elasticsearch.client.ElasticsearchClient; import org.elasticsearch.client.ElasticsearchClient;

View File

@ -3,12 +3,12 @@
* or more contributor license agreements. Licensed under the Elastic License; * or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with 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.bytes.BytesReference;
import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamInput;
import org.elasticsearch.common.io.stream.StreamOutput; 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; import java.io.IOException;

View File

@ -3,7 +3,7 @@
* or more contributor license agreements. Licensed under the Elastic License; * or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with 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.ActionRequest;
import org.elasticsearch.action.ActionRequestValidationException; 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 * 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. * supported by the monitoring plugin, the monitoring documents will be indexed in a single batch using a normal bulk request.
* <p> * <p>
* 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 * 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. * guarantee that these information will be effectively used.
*/ */

View File

@ -3,7 +3,7 @@
* or more contributor license agreements. Licensed under the Elastic License; * or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with 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.action.ActionRequestBuilder;
import org.elasticsearch.client.ElasticsearchClient; import org.elasticsearch.client.ElasticsearchClient;

View File

@ -3,7 +3,7 @@
* or more contributor license agreements. Licensed under the Elastic License; * or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with 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.ElasticsearchException;
import org.elasticsearch.ExceptionsHelper; import org.elasticsearch.ExceptionsHelper;

View File

@ -3,7 +3,7 @@
* or more contributor license agreements. Licensed under the Elastic License; * or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with 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.Strings;
import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamInput;

View File

@ -3,22 +3,22 @@
* or more contributor license agreements. Licensed under the Elastic License; * or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with 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.ActionListener;
import org.elasticsearch.action.support.ActionFilters; import org.elasticsearch.action.support.ActionFilters;
import org.elasticsearch.action.support.HandledTransportAction; import org.elasticsearch.action.support.HandledTransportAction;
import org.elasticsearch.cluster.service.ClusterService;
import org.elasticsearch.cluster.block.ClusterBlockLevel; import org.elasticsearch.cluster.block.ClusterBlockLevel;
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver; import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
import org.elasticsearch.cluster.node.DiscoveryNode; import org.elasticsearch.cluster.node.DiscoveryNode;
import org.elasticsearch.cluster.service.ClusterService;
import org.elasticsearch.common.inject.Inject; import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.util.concurrent.AbstractRunnable; 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.threadpool.ThreadPool;
import org.elasticsearch.transport.TransportService; 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.Collection;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;

View File

@ -3,7 +3,7 @@
* or more contributor license agreements. Licensed under the Elastic License; * or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with 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.Strings;
import org.elasticsearch.common.component.AbstractLifecycleComponent; 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.CollectionUtils;
import org.elasticsearch.common.util.concurrent.EsExecutors; import org.elasticsearch.common.util.concurrent.EsExecutors;
import org.elasticsearch.common.util.concurrent.ReleasableLock; import org.elasticsearch.common.util.concurrent.ReleasableLock;
import org.elasticsearch.marvel.MonitoringSettings; import org.elasticsearch.xpack.monitoring.MonitoringSettings;
import org.elasticsearch.marvel.agent.collector.Collector; import org.elasticsearch.xpack.monitoring.agent.collector.Collector;
import org.elasticsearch.marvel.agent.collector.cluster.ClusterStatsCollector; import org.elasticsearch.xpack.monitoring.agent.collector.cluster.ClusterStatsCollector;
import org.elasticsearch.marvel.agent.exporter.ExportException; import org.elasticsearch.xpack.monitoring.agent.exporter.ExportException;
import org.elasticsearch.marvel.agent.exporter.Exporter; import org.elasticsearch.xpack.monitoring.agent.exporter.Exporter;
import org.elasticsearch.marvel.agent.exporter.Exporters; import org.elasticsearch.xpack.monitoring.agent.exporter.Exporters;
import org.elasticsearch.marvel.agent.exporter.MonitoringDoc; import org.elasticsearch.xpack.monitoring.agent.exporter.MonitoringDoc;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collection; import java.util.Collection;

View File

@ -3,19 +3,19 @@
* or more contributor license agreements. Licensed under the Elastic License; * or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with 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.ElasticsearchTimeoutException;
import org.elasticsearch.Version; import org.elasticsearch.Version;
import org.elasticsearch.cluster.service.ClusterService;
import org.elasticsearch.cluster.node.DiscoveryNode; import org.elasticsearch.cluster.node.DiscoveryNode;
import org.elasticsearch.cluster.service.ClusterService;
import org.elasticsearch.common.component.AbstractLifecycleComponent; import org.elasticsearch.common.component.AbstractLifecycleComponent;
import org.elasticsearch.common.inject.Inject; import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.marvel.MonitoringSettings; import org.elasticsearch.xpack.monitoring.MonitoredSystem;
import org.elasticsearch.marvel.MonitoredSystem; import org.elasticsearch.xpack.monitoring.MonitoringLicensee;
import org.elasticsearch.marvel.agent.exporter.MonitoringDoc; import org.elasticsearch.xpack.monitoring.MonitoringSettings;
import org.elasticsearch.marvel.MonitoringLicensee; import org.elasticsearch.xpack.monitoring.agent.exporter.MonitoringDoc;
import java.util.Collection; import java.util.Collection;

View File

@ -3,10 +3,10 @@
* or more contributor license agreements. Licensed under the Elastic License; * or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with 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.common.component.LifecycleComponent;
import org.elasticsearch.marvel.agent.exporter.MonitoringDoc; import org.elasticsearch.xpack.monitoring.agent.exporter.MonitoringDoc;
import java.util.Collection; import java.util.Collection;

View File

@ -3,17 +3,17 @@
* or more contributor license agreements. Licensed under the Elastic License; * or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with 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.AbstractModule;
import org.elasticsearch.common.inject.multibindings.Multibinder; import org.elasticsearch.common.inject.multibindings.Multibinder;
import org.elasticsearch.marvel.agent.collector.cluster.ClusterStateCollector; import org.elasticsearch.xpack.monitoring.agent.collector.cluster.ClusterStateCollector;
import org.elasticsearch.marvel.agent.collector.cluster.ClusterStatsCollector; import org.elasticsearch.xpack.monitoring.agent.collector.cluster.ClusterStatsCollector;
import org.elasticsearch.marvel.agent.collector.indices.IndexRecoveryCollector; import org.elasticsearch.xpack.monitoring.agent.collector.indices.IndexRecoveryCollector;
import org.elasticsearch.marvel.agent.collector.indices.IndexStatsCollector; import org.elasticsearch.xpack.monitoring.agent.collector.indices.IndexStatsCollector;
import org.elasticsearch.marvel.agent.collector.indices.IndicesStatsCollector; import org.elasticsearch.xpack.monitoring.agent.collector.indices.IndicesStatsCollector;
import org.elasticsearch.marvel.agent.collector.node.NodeStatsCollector; import org.elasticsearch.xpack.monitoring.agent.collector.node.NodeStatsCollector;
import org.elasticsearch.marvel.agent.collector.shards.ShardsCollector; import org.elasticsearch.xpack.monitoring.agent.collector.shards.ShardsCollector;
import java.util.HashSet; import java.util.HashSet;
import java.util.Set; import java.util.Set;

View File

@ -3,11 +3,11 @@
* or more contributor license agreements. Licensed under the Elastic License; * or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with 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.action.admin.cluster.stats.ClusterStatsResponse;
import org.elasticsearch.license.core.License; 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 { public class ClusterInfoMonitoringDoc extends MonitoringDoc {

View File

@ -3,20 +3,20 @@
* or more contributor license agreements. Licensed under the Elastic License; * or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with 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.action.admin.cluster.health.ClusterHealthResponse;
import org.elasticsearch.client.Client; import org.elasticsearch.client.Client;
import org.elasticsearch.cluster.service.ClusterService;
import org.elasticsearch.cluster.ClusterState; import org.elasticsearch.cluster.ClusterState;
import org.elasticsearch.cluster.node.DiscoveryNode; import org.elasticsearch.cluster.node.DiscoveryNode;
import org.elasticsearch.cluster.node.DiscoveryNodes; import org.elasticsearch.cluster.node.DiscoveryNodes;
import org.elasticsearch.cluster.service.ClusterService;
import org.elasticsearch.common.inject.Inject; import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.marvel.MonitoringSettings; import org.elasticsearch.xpack.monitoring.MonitoringLicensee;
import org.elasticsearch.marvel.agent.collector.AbstractCollector; import org.elasticsearch.xpack.monitoring.MonitoringSettings;
import org.elasticsearch.marvel.agent.exporter.MonitoringDoc; import org.elasticsearch.xpack.monitoring.agent.collector.AbstractCollector;
import org.elasticsearch.marvel.MonitoringLicensee; import org.elasticsearch.xpack.monitoring.agent.exporter.MonitoringDoc;
import org.elasticsearch.xpack.security.InternalClient; import org.elasticsearch.xpack.security.InternalClient;
import java.util.ArrayList; import java.util.ArrayList;
@ -72,7 +72,7 @@ public class ClusterStateCollector extends AbstractCollector<ClusterStateCollect
DiscoveryNodes nodes = clusterState.nodes(); DiscoveryNodes nodes = clusterState.nodes();
if (nodes != null) { if (nodes != null) {
for (DiscoveryNode node : nodes) { for (DiscoveryNode node : nodes) {
// Adds a document for every node in the marvel timestamped index (type "nodes") // Adds a document for every node in the monitoring timestamped index (type "nodes")
ClusterStateNodeMonitoringDoc clusterStateNodeDoc = new ClusterStateNodeMonitoringDoc(monitoringId(), monitoringVersion()); ClusterStateNodeMonitoringDoc clusterStateNodeDoc = new ClusterStateNodeMonitoringDoc(monitoringId(), monitoringVersion());
clusterStateNodeDoc.setClusterUUID(clusterUUID);; clusterStateNodeDoc.setClusterUUID(clusterUUID);;
clusterStateNodeDoc.setTimestamp(timestamp); clusterStateNodeDoc.setTimestamp(timestamp);
@ -81,7 +81,7 @@ public class ClusterStateCollector extends AbstractCollector<ClusterStateCollect
clusterStateNodeDoc.setNodeId(node.getId()); clusterStateNodeDoc.setNodeId(node.getId());
results.add(clusterStateNodeDoc); results.add(clusterStateNodeDoc);
// Adds a document for every node in the marvel data index (type "node") // Adds a document for every node in the monitoring data index (type "node")
DiscoveryNodeMonitoringDoc discoveryNodeDoc = new DiscoveryNodeMonitoringDoc(monitoringId(), monitoringVersion()); DiscoveryNodeMonitoringDoc discoveryNodeDoc = new DiscoveryNodeMonitoringDoc(monitoringId(), monitoringVersion());
discoveryNodeDoc.setClusterUUID(clusterUUID); discoveryNodeDoc.setClusterUUID(clusterUUID);
discoveryNodeDoc.setTimestamp(timestamp); discoveryNodeDoc.setTimestamp(timestamp);

View File

@ -3,11 +3,11 @@
* or more contributor license agreements. Licensed under the Elastic License; * or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with 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.cluster.ClusterState; import org.elasticsearch.cluster.ClusterState;
import org.elasticsearch.cluster.health.ClusterHealthStatus; import org.elasticsearch.cluster.health.ClusterHealthStatus;
import org.elasticsearch.marvel.agent.exporter.MonitoringDoc; import org.elasticsearch.xpack.monitoring.agent.exporter.MonitoringDoc;
public class ClusterStateMonitoringDoc extends MonitoringDoc { public class ClusterStateMonitoringDoc extends MonitoringDoc {

View File

@ -3,9 +3,9 @@
* or more contributor license agreements. Licensed under the Elastic License; * or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with 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.marvel.agent.exporter.MonitoringDoc; import org.elasticsearch.xpack.monitoring.agent.exporter.MonitoringDoc;
public class ClusterStateNodeMonitoringDoc extends MonitoringDoc { public class ClusterStateNodeMonitoringDoc extends MonitoringDoc {

View File

@ -3,23 +3,22 @@
* or more contributor license agreements. Licensed under the Elastic License; * or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with 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.ElasticsearchSecurityException; import org.elasticsearch.ElasticsearchSecurityException;
import org.elasticsearch.Version; import org.elasticsearch.Version;
import org.elasticsearch.action.admin.cluster.stats.ClusterStatsResponse; import org.elasticsearch.action.admin.cluster.stats.ClusterStatsResponse;
import org.elasticsearch.client.Client; import org.elasticsearch.client.Client;
import org.elasticsearch.cluster.ClusterName;
import org.elasticsearch.cluster.service.ClusterService;
import org.elasticsearch.cluster.node.DiscoveryNode; import org.elasticsearch.cluster.node.DiscoveryNode;
import org.elasticsearch.cluster.service.ClusterService;
import org.elasticsearch.common.inject.Inject; import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.license.plugin.core.LicenseUtils; import org.elasticsearch.license.plugin.core.LicenseUtils;
import org.elasticsearch.license.plugin.core.LicensesManagerService; import org.elasticsearch.license.plugin.core.LicensesManagerService;
import org.elasticsearch.marvel.MonitoringSettings; import org.elasticsearch.xpack.monitoring.MonitoringLicensee;
import org.elasticsearch.marvel.agent.collector.AbstractCollector; import org.elasticsearch.xpack.monitoring.MonitoringSettings;
import org.elasticsearch.marvel.agent.exporter.MonitoringDoc; import org.elasticsearch.xpack.monitoring.agent.collector.AbstractCollector;
import org.elasticsearch.marvel.MonitoringLicensee; import org.elasticsearch.xpack.monitoring.agent.exporter.MonitoringDoc;
import org.elasticsearch.xpack.security.InternalClient; import org.elasticsearch.xpack.security.InternalClient;
import java.util.ArrayList; import java.util.ArrayList;

View File

@ -3,10 +3,10 @@
* or more contributor license agreements. Licensed under the Elastic License; * or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with 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.action.admin.cluster.stats.ClusterStatsResponse;
import org.elasticsearch.marvel.agent.exporter.MonitoringDoc; import org.elasticsearch.xpack.monitoring.agent.exporter.MonitoringDoc;
public class ClusterStatsMonitoringDoc extends MonitoringDoc { public class ClusterStatsMonitoringDoc extends MonitoringDoc {

View File

@ -3,10 +3,10 @@
* or more contributor license agreements. Licensed under the Elastic License; * or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with 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.cluster.node.DiscoveryNode; import org.elasticsearch.cluster.node.DiscoveryNode;
import org.elasticsearch.marvel.agent.exporter.MonitoringDoc; import org.elasticsearch.xpack.monitoring.agent.exporter.MonitoringDoc;
public class DiscoveryNodeMonitoringDoc extends MonitoringDoc { public class DiscoveryNodeMonitoringDoc extends MonitoringDoc {

View File

@ -3,20 +3,20 @@
* or more contributor license agreements. Licensed under the Elastic License; * or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with 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.action.admin.indices.recovery.RecoveryResponse; import org.elasticsearch.action.admin.indices.recovery.RecoveryResponse;
import org.elasticsearch.action.support.IndicesOptions; import org.elasticsearch.action.support.IndicesOptions;
import org.elasticsearch.client.Client; import org.elasticsearch.client.Client;
import org.elasticsearch.cluster.service.ClusterService;
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver; import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
import org.elasticsearch.cluster.service.ClusterService;
import org.elasticsearch.common.inject.Inject; import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.index.IndexNotFoundException; import org.elasticsearch.index.IndexNotFoundException;
import org.elasticsearch.marvel.MonitoringSettings; import org.elasticsearch.xpack.monitoring.MonitoringLicensee;
import org.elasticsearch.marvel.agent.collector.AbstractCollector; import org.elasticsearch.xpack.monitoring.MonitoringSettings;
import org.elasticsearch.marvel.agent.exporter.MonitoringDoc; import org.elasticsearch.xpack.monitoring.agent.collector.AbstractCollector;
import org.elasticsearch.marvel.MonitoringLicensee; import org.elasticsearch.xpack.monitoring.agent.exporter.MonitoringDoc;
import org.elasticsearch.xpack.security.InternalClient; import org.elasticsearch.xpack.security.InternalClient;
import org.elasticsearch.xpack.security.Security; import org.elasticsearch.xpack.security.Security;

View File

@ -3,10 +3,10 @@
* or more contributor license agreements. Licensed under the Elastic License; * or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with 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.action.admin.indices.recovery.RecoveryResponse; import org.elasticsearch.action.admin.indices.recovery.RecoveryResponse;
import org.elasticsearch.marvel.agent.exporter.MonitoringDoc; import org.elasticsearch.xpack.monitoring.agent.exporter.MonitoringDoc;
public class IndexRecoveryMonitoringDoc extends MonitoringDoc { public class IndexRecoveryMonitoringDoc extends MonitoringDoc {

View File

@ -3,22 +3,22 @@
* or more contributor license agreements. Licensed under the Elastic License; * or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with 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.action.admin.indices.stats.IndexStats; import org.elasticsearch.action.admin.indices.stats.IndexStats;
import org.elasticsearch.action.admin.indices.stats.IndicesStatsResponse; import org.elasticsearch.action.admin.indices.stats.IndicesStatsResponse;
import org.elasticsearch.action.support.IndicesOptions; import org.elasticsearch.action.support.IndicesOptions;
import org.elasticsearch.client.Client; import org.elasticsearch.client.Client;
import org.elasticsearch.cluster.service.ClusterService;
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver; import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
import org.elasticsearch.cluster.node.DiscoveryNode; import org.elasticsearch.cluster.node.DiscoveryNode;
import org.elasticsearch.cluster.service.ClusterService;
import org.elasticsearch.common.inject.Inject; import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.index.IndexNotFoundException; import org.elasticsearch.index.IndexNotFoundException;
import org.elasticsearch.marvel.MonitoringSettings; import org.elasticsearch.xpack.monitoring.MonitoringLicensee;
import org.elasticsearch.marvel.agent.collector.AbstractCollector; import org.elasticsearch.xpack.monitoring.MonitoringSettings;
import org.elasticsearch.marvel.agent.exporter.MonitoringDoc; import org.elasticsearch.xpack.monitoring.agent.collector.AbstractCollector;
import org.elasticsearch.marvel.MonitoringLicensee; import org.elasticsearch.xpack.monitoring.agent.exporter.MonitoringDoc;
import org.elasticsearch.xpack.security.InternalClient; import org.elasticsearch.xpack.security.InternalClient;
import org.elasticsearch.xpack.security.Security; import org.elasticsearch.xpack.security.Security;

View File

@ -3,10 +3,10 @@
* or more contributor license agreements. Licensed under the Elastic License; * or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with 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.action.admin.indices.stats.IndexStats; import org.elasticsearch.action.admin.indices.stats.IndexStats;
import org.elasticsearch.marvel.agent.exporter.MonitoringDoc; import org.elasticsearch.xpack.monitoring.agent.exporter.MonitoringDoc;
public class IndexStatsMonitoringDoc extends MonitoringDoc { public class IndexStatsMonitoringDoc extends MonitoringDoc {

View File

@ -3,20 +3,20 @@
* or more contributor license agreements. Licensed under the Elastic License; * or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with 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.action.admin.indices.stats.IndicesStatsResponse; import org.elasticsearch.action.admin.indices.stats.IndicesStatsResponse;
import org.elasticsearch.action.support.IndicesOptions; import org.elasticsearch.action.support.IndicesOptions;
import org.elasticsearch.client.Client; import org.elasticsearch.client.Client;
import org.elasticsearch.cluster.service.ClusterService;
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver; import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
import org.elasticsearch.cluster.service.ClusterService;
import org.elasticsearch.common.inject.Inject; import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.index.IndexNotFoundException; import org.elasticsearch.index.IndexNotFoundException;
import org.elasticsearch.marvel.MonitoringSettings; import org.elasticsearch.xpack.monitoring.MonitoringLicensee;
import org.elasticsearch.marvel.agent.collector.AbstractCollector; import org.elasticsearch.xpack.monitoring.MonitoringSettings;
import org.elasticsearch.marvel.agent.exporter.MonitoringDoc; import org.elasticsearch.xpack.monitoring.agent.collector.AbstractCollector;
import org.elasticsearch.marvel.MonitoringLicensee; import org.elasticsearch.xpack.monitoring.agent.exporter.MonitoringDoc;
import org.elasticsearch.xpack.security.InternalClient; import org.elasticsearch.xpack.security.InternalClient;
import org.elasticsearch.xpack.security.Security; import org.elasticsearch.xpack.security.Security;

View File

@ -3,10 +3,10 @@
* or more contributor license agreements. Licensed under the Elastic License; * or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with 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.action.admin.indices.stats.IndicesStatsResponse; import org.elasticsearch.action.admin.indices.stats.IndicesStatsResponse;
import org.elasticsearch.marvel.agent.exporter.MonitoringDoc; import org.elasticsearch.xpack.monitoring.agent.exporter.MonitoringDoc;
public class IndicesStatsMonitoringDoc extends MonitoringDoc { public class IndicesStatsMonitoringDoc extends MonitoringDoc {

View File

@ -3,7 +3,7 @@
* or more contributor license agreements. Licensed under the Elastic License; * or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with 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.action.admin.cluster.node.stats.NodeStats; import org.elasticsearch.action.admin.cluster.node.stats.NodeStats;
import org.elasticsearch.action.admin.cluster.node.stats.NodesStatsRequest; import org.elasticsearch.action.admin.cluster.node.stats.NodesStatsRequest;
@ -11,16 +11,16 @@ import org.elasticsearch.action.admin.cluster.node.stats.NodesStatsResponse;
import org.elasticsearch.action.admin.indices.stats.CommonStatsFlags; import org.elasticsearch.action.admin.indices.stats.CommonStatsFlags;
import org.elasticsearch.bootstrap.BootstrapInfo; import org.elasticsearch.bootstrap.BootstrapInfo;
import org.elasticsearch.client.Client; import org.elasticsearch.client.Client;
import org.elasticsearch.cluster.service.ClusterService;
import org.elasticsearch.cluster.node.DiscoveryNode; import org.elasticsearch.cluster.node.DiscoveryNode;
import org.elasticsearch.cluster.routing.allocation.decider.DiskThresholdDecider; import org.elasticsearch.cluster.routing.allocation.decider.DiskThresholdDecider;
import org.elasticsearch.cluster.service.ClusterService;
import org.elasticsearch.common.inject.Inject; import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.env.NodeEnvironment; import org.elasticsearch.env.NodeEnvironment;
import org.elasticsearch.marvel.MonitoringSettings; import org.elasticsearch.xpack.monitoring.MonitoringLicensee;
import org.elasticsearch.marvel.agent.collector.AbstractCollector; import org.elasticsearch.xpack.monitoring.MonitoringSettings;
import org.elasticsearch.marvel.agent.exporter.MonitoringDoc; import org.elasticsearch.xpack.monitoring.agent.collector.AbstractCollector;
import org.elasticsearch.marvel.MonitoringLicensee; import org.elasticsearch.xpack.monitoring.agent.exporter.MonitoringDoc;
import org.elasticsearch.xpack.security.InternalClient; import org.elasticsearch.xpack.security.InternalClient;
import java.util.Collection; import java.util.Collection;

View File

@ -3,10 +3,10 @@
* or more contributor license agreements. Licensed under the Elastic License; * or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with 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.action.admin.cluster.node.stats.NodeStats; import org.elasticsearch.action.admin.cluster.node.stats.NodeStats;
import org.elasticsearch.marvel.agent.exporter.MonitoringDoc; import org.elasticsearch.xpack.monitoring.agent.exporter.MonitoringDoc;
public class NodeStatsMonitoringDoc extends MonitoringDoc { public class NodeStatsMonitoringDoc extends MonitoringDoc {

View File

@ -3,10 +3,10 @@
* or more contributor license agreements. Licensed under the Elastic License; * or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with 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.cluster.routing.ShardRouting; import org.elasticsearch.cluster.routing.ShardRouting;
import org.elasticsearch.marvel.agent.exporter.MonitoringDoc; import org.elasticsearch.xpack.monitoring.agent.exporter.MonitoringDoc;
public class ShardMonitoringDoc extends MonitoringDoc { public class ShardMonitoringDoc extends MonitoringDoc {

View File

@ -3,20 +3,20 @@
* or more contributor license agreements. Licensed under the Elastic License; * or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with 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.cluster.service.ClusterService;
import org.elasticsearch.cluster.ClusterState; import org.elasticsearch.cluster.ClusterState;
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver; import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
import org.elasticsearch.cluster.routing.RoutingTable; import org.elasticsearch.cluster.routing.RoutingTable;
import org.elasticsearch.cluster.routing.ShardRouting; import org.elasticsearch.cluster.routing.ShardRouting;
import org.elasticsearch.cluster.service.ClusterService;
import org.elasticsearch.common.inject.Inject; import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.regex.Regex; import org.elasticsearch.common.regex.Regex;
import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.marvel.MonitoringSettings; import org.elasticsearch.xpack.monitoring.MonitoringLicensee;
import org.elasticsearch.marvel.agent.collector.AbstractCollector; import org.elasticsearch.xpack.monitoring.MonitoringSettings;
import org.elasticsearch.marvel.agent.exporter.MonitoringDoc; import org.elasticsearch.xpack.monitoring.agent.collector.AbstractCollector;
import org.elasticsearch.marvel.MonitoringLicensee; import org.elasticsearch.xpack.monitoring.agent.exporter.MonitoringDoc;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;

View File

@ -3,7 +3,7 @@
* or more contributor license agreements. Licensed under the Elastic License; * or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with 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 java.util.Collection; import java.util.Collection;
import java.util.concurrent.atomic.AtomicReference; import java.util.concurrent.atomic.AtomicReference;

View File

@ -3,7 +3,7 @@
* or more contributor license agreements. Licensed under the Elastic License; * or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with 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.ElasticsearchException; import org.elasticsearch.ElasticsearchException;
import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamInput;

View File

@ -3,14 +3,14 @@
* or more contributor license agreements. Licensed under the Elastic License; * or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with 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.common.Nullable; import org.elasticsearch.common.Nullable;
import org.elasticsearch.common.logging.ESLogger; import org.elasticsearch.common.logging.ESLogger;
import org.elasticsearch.common.logging.Loggers; import org.elasticsearch.common.logging.Loggers;
import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.unit.TimeValue; import org.elasticsearch.common.unit.TimeValue;
import org.elasticsearch.marvel.MonitoringSettings; import org.elasticsearch.xpack.monitoring.MonitoringSettings;
import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicBoolean;

View File

@ -3,16 +3,16 @@
* or more contributor license agreements. Licensed under the Elastic License; * or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with 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.common.inject.AbstractModule; import org.elasticsearch.common.inject.AbstractModule;
import org.elasticsearch.common.inject.multibindings.MapBinder; import org.elasticsearch.common.inject.multibindings.MapBinder;
import org.elasticsearch.common.inject.util.Providers; import org.elasticsearch.common.inject.util.Providers;
import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.marvel.Monitoring;
import org.elasticsearch.marvel.agent.exporter.http.HttpExporter;
import org.elasticsearch.marvel.agent.exporter.local.LocalExporter;
import org.elasticsearch.xpack.XPackPlugin; import org.elasticsearch.xpack.XPackPlugin;
import org.elasticsearch.xpack.monitoring.Monitoring;
import org.elasticsearch.xpack.monitoring.agent.exporter.http.HttpExporter;
import org.elasticsearch.xpack.monitoring.agent.exporter.local.LocalExporter;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;

View File

@ -3,7 +3,7 @@
* or more contributor license agreements. Licensed under the Elastic License; * or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with 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.cluster.service.ClusterService; import org.elasticsearch.cluster.service.ClusterService;
import org.elasticsearch.common.component.AbstractLifecycleComponent; import org.elasticsearch.common.component.AbstractLifecycleComponent;
@ -13,9 +13,9 @@ import org.elasticsearch.common.logging.ESLogger;
import org.elasticsearch.common.settings.ClusterSettings; import org.elasticsearch.common.settings.ClusterSettings;
import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.settings.SettingsException; import org.elasticsearch.common.settings.SettingsException;
import org.elasticsearch.marvel.MonitoringSettings;
import org.elasticsearch.marvel.agent.exporter.local.LocalExporter;
import org.elasticsearch.node.Node; import org.elasticsearch.node.Node;
import org.elasticsearch.xpack.monitoring.MonitoringSettings;
import org.elasticsearch.xpack.monitoring.agent.exporter.local.LocalExporter;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collection; import java.util.Collection;

View File

@ -3,7 +3,7 @@
* or more contributor license agreements. Licensed under the Elastic License; * or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with 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.cluster.node.DiscoveryNode; import org.elasticsearch.cluster.node.DiscoveryNode;
import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamInput;

View File

@ -3,14 +3,14 @@
* or more contributor license agreements. Licensed under the Elastic License; * or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with 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.xpack.template.TemplateUtils; import org.elasticsearch.xpack.template.TemplateUtils;
import java.util.Locale; import java.util.Locale;
import java.util.regex.Pattern; import java.util.regex.Pattern;
public final class MarvelTemplateUtils { public final class MonitoringTemplateUtils {
private static final String TEMPLATE_FILE = "/monitoring-%s.json"; private static final String TEMPLATE_FILE = "/monitoring-%s.json";
private static final String TEMPLATE_VERSION_PROPERTY = Pattern.quote("${monitoring.template.version}"); private static final String TEMPLATE_VERSION_PROPERTY = Pattern.quote("${monitoring.template.version}");
@ -18,7 +18,7 @@ public final class MarvelTemplateUtils {
/** Current version of es and data templates **/ /** Current version of es and data templates **/
public static final Integer TEMPLATE_VERSION = 2; public static final Integer TEMPLATE_VERSION = 2;
private MarvelTemplateUtils() { private MonitoringTemplateUtils() {
} }
public static String loadTemplate(String id) { public static String loadTemplate(String id) {

View File

@ -3,7 +3,7 @@
* or more contributor license agreements. Licensed under the Elastic License; * or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with 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.ElasticsearchException; import org.elasticsearch.ElasticsearchException;
import org.elasticsearch.ExceptionsHelper; import org.elasticsearch.ExceptionsHelper;
@ -21,13 +21,13 @@ import org.elasticsearch.common.xcontent.XContentBuilder;
import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.common.xcontent.XContentParser;
import org.elasticsearch.common.xcontent.XContentType; import org.elasticsearch.common.xcontent.XContentType;
import org.elasticsearch.env.Environment; import org.elasticsearch.env.Environment;
import org.elasticsearch.marvel.agent.exporter.ExportBulk; import org.elasticsearch.xpack.monitoring.agent.exporter.ExportBulk;
import org.elasticsearch.marvel.agent.exporter.ExportException; import org.elasticsearch.xpack.monitoring.agent.exporter.ExportException;
import org.elasticsearch.marvel.agent.exporter.Exporter; import org.elasticsearch.xpack.monitoring.agent.exporter.Exporter;
import org.elasticsearch.marvel.agent.exporter.MonitoringDoc; import org.elasticsearch.xpack.monitoring.agent.exporter.MonitoringDoc;
import org.elasticsearch.marvel.agent.resolver.MonitoringIndexNameResolver; import org.elasticsearch.xpack.monitoring.agent.resolver.MonitoringIndexNameResolver;
import org.elasticsearch.marvel.agent.resolver.ResolversRegistry; import org.elasticsearch.xpack.monitoring.agent.resolver.ResolversRegistry;
import org.elasticsearch.marvel.support.VersionUtils; import org.elasticsearch.xpack.monitoring.support.VersionUtils;
import javax.net.ssl.HostnameVerifier; import javax.net.ssl.HostnameVerifier;
import javax.net.ssl.HttpsURLConnection; import javax.net.ssl.HttpsURLConnection;

View File

@ -3,7 +3,7 @@
* or more contributor license agreements. Licensed under the Elastic License; * or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with 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 java.net.MalformedURLException; import java.net.MalformedURLException;
import java.net.URISyntaxException; import java.net.URISyntaxException;

View File

@ -3,7 +3,7 @@
* or more contributor license agreements. Licensed under the Elastic License; * or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with 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.action.bulk.BulkItemResponse; import org.elasticsearch.action.bulk.BulkItemResponse;
import org.elasticsearch.action.bulk.BulkRequestBuilder; import org.elasticsearch.action.bulk.BulkRequestBuilder;
@ -11,12 +11,12 @@ import org.elasticsearch.action.bulk.BulkResponse;
import org.elasticsearch.action.index.IndexRequest; import org.elasticsearch.action.index.IndexRequest;
import org.elasticsearch.common.logging.ESLogger; import org.elasticsearch.common.logging.ESLogger;
import org.elasticsearch.common.xcontent.XContentType; import org.elasticsearch.common.xcontent.XContentType;
import org.elasticsearch.marvel.agent.exporter.ExportBulk;
import org.elasticsearch.marvel.agent.exporter.ExportException;
import org.elasticsearch.marvel.agent.exporter.MonitoringDoc;
import org.elasticsearch.marvel.agent.resolver.MonitoringIndexNameResolver;
import org.elasticsearch.marvel.agent.resolver.ResolversRegistry;
import org.elasticsearch.xpack.common.init.proxy.ClientProxy; import org.elasticsearch.xpack.common.init.proxy.ClientProxy;
import org.elasticsearch.xpack.monitoring.agent.exporter.ExportBulk;
import org.elasticsearch.xpack.monitoring.agent.exporter.ExportException;
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 java.util.Arrays; import java.util.Arrays;
import java.util.Collection; import java.util.Collection;

View File

@ -3,7 +3,7 @@
* or more contributor license agreements. Licensed under the Elastic License; * or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with 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 com.carrotsearch.hppc.cursors.ObjectCursor; import com.carrotsearch.hppc.cursors.ObjectCursor;
import com.carrotsearch.hppc.cursors.ObjectObjectCursor; import com.carrotsearch.hppc.cursors.ObjectObjectCursor;
@ -24,13 +24,13 @@ import org.elasticsearch.common.regex.Regex;
import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.unit.TimeValue; import org.elasticsearch.common.unit.TimeValue;
import org.elasticsearch.gateway.GatewayService; import org.elasticsearch.gateway.GatewayService;
import org.elasticsearch.marvel.agent.exporter.ExportBulk;
import org.elasticsearch.marvel.agent.exporter.Exporter;
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.cleaner.CleanerService;
import org.elasticsearch.xpack.common.init.proxy.ClientProxy; import org.elasticsearch.xpack.common.init.proxy.ClientProxy;
import org.elasticsearch.xpack.monitoring.agent.exporter.ExportBulk;
import org.elasticsearch.xpack.monitoring.agent.exporter.Exporter;
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.cleaner.CleanerService;
import org.elasticsearch.xpack.security.InternalClient; import org.elasticsearch.xpack.security.InternalClient;
import org.joda.time.DateTime; import org.joda.time.DateTime;
import org.joda.time.DateTimeZone; import org.joda.time.DateTimeZone;

View File

@ -3,7 +3,7 @@
* or more contributor license agreements. Licensed under the Elastic License; * or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with 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.bytes.BytesReference;
@ -14,9 +14,9 @@ import org.elasticsearch.common.settings.SettingsException;
import org.elasticsearch.common.xcontent.ToXContent; import org.elasticsearch.common.xcontent.ToXContent;
import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentBuilder;
import org.elasticsearch.common.xcontent.XContentType; import org.elasticsearch.common.xcontent.XContentType;
import org.elasticsearch.marvel.MonitoredSystem; import org.elasticsearch.xpack.monitoring.MonitoredSystem;
import org.elasticsearch.marvel.agent.exporter.MarvelTemplateUtils; import org.elasticsearch.xpack.monitoring.agent.exporter.MonitoringDoc;
import org.elasticsearch.marvel.agent.exporter.MonitoringDoc; import org.elasticsearch.xpack.monitoring.agent.exporter.MonitoringTemplateUtils;
import org.joda.time.DateTime; import org.joda.time.DateTime;
import org.joda.time.DateTimeZone; import org.joda.time.DateTimeZone;
import org.joda.time.format.DateTimeFormat; import org.joda.time.format.DateTimeFormat;
@ -133,7 +133,7 @@ public abstract class MonitoringIndexNameResolver<T extends MonitoringDoc> {
private final String index; private final String index;
public Data() { public Data() {
this(MarvelTemplateUtils.TEMPLATE_VERSION); this(MonitoringTemplateUtils.TEMPLATE_VERSION);
} }
// Used in tests // Used in tests
@ -153,12 +153,12 @@ public abstract class MonitoringIndexNameResolver<T extends MonitoringDoc> {
@Override @Override
public String templateName() { 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 @Override
public String template() { public String template() {
return MarvelTemplateUtils.loadTemplate(DATA); return MonitoringTemplateUtils.loadTemplate(DATA);
} }
} }
@ -176,7 +176,7 @@ public abstract class MonitoringIndexNameResolver<T extends MonitoringDoc> {
private final String index; private final String index;
public Timestamped(MonitoredSystem system, Settings settings) { public Timestamped(MonitoredSystem system, Settings settings) {
this(system, settings, MarvelTemplateUtils.TEMPLATE_VERSION); this(system, settings, MonitoringTemplateUtils.TEMPLATE_VERSION);
} }
// Used in tests // Used in tests
@ -209,12 +209,12 @@ public abstract class MonitoringIndexNameResolver<T extends MonitoringDoc> {
@Override @Override
public String templateName() { 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 @Override
public String template() { public String template() {
return MarvelTemplateUtils.loadTemplate(getId()); return MonitoringTemplateUtils.loadTemplate(getId());
} }
String getId() { String getId() {

View File

@ -3,36 +3,36 @@
* or more contributor license agreements. Licensed under the Elastic License; * or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with 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.Version;
import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.marvel.MonitoredSystem; import org.elasticsearch.xpack.monitoring.MonitoredSystem;
import org.elasticsearch.marvel.action.MonitoringBulkDoc; import org.elasticsearch.xpack.monitoring.action.MonitoringBulkDoc;
import org.elasticsearch.marvel.action.MonitoringIndex; import org.elasticsearch.xpack.monitoring.action.MonitoringIndex;
import org.elasticsearch.marvel.agent.collector.cluster.ClusterInfoMonitoringDoc; import org.elasticsearch.xpack.monitoring.agent.collector.cluster.ClusterInfoMonitoringDoc;
import org.elasticsearch.marvel.agent.collector.cluster.ClusterStateMonitoringDoc; import org.elasticsearch.xpack.monitoring.agent.collector.cluster.ClusterStateMonitoringDoc;
import org.elasticsearch.marvel.agent.collector.cluster.ClusterStateNodeMonitoringDoc; import org.elasticsearch.xpack.monitoring.agent.collector.cluster.ClusterStateNodeMonitoringDoc;
import org.elasticsearch.marvel.agent.collector.cluster.ClusterStatsMonitoringDoc; import org.elasticsearch.xpack.monitoring.agent.collector.cluster.ClusterStatsMonitoringDoc;
import org.elasticsearch.marvel.agent.collector.cluster.DiscoveryNodeMonitoringDoc; import org.elasticsearch.xpack.monitoring.agent.collector.cluster.DiscoveryNodeMonitoringDoc;
import org.elasticsearch.marvel.agent.collector.indices.IndexRecoveryMonitoringDoc; import org.elasticsearch.xpack.monitoring.agent.collector.indices.IndexRecoveryMonitoringDoc;
import org.elasticsearch.marvel.agent.collector.indices.IndexStatsMonitoringDoc; import org.elasticsearch.xpack.monitoring.agent.collector.indices.IndexStatsMonitoringDoc;
import org.elasticsearch.marvel.agent.collector.indices.IndicesStatsMonitoringDoc; import org.elasticsearch.xpack.monitoring.agent.collector.indices.IndicesStatsMonitoringDoc;
import org.elasticsearch.marvel.agent.collector.node.NodeStatsMonitoringDoc; import org.elasticsearch.xpack.monitoring.agent.collector.node.NodeStatsMonitoringDoc;
import org.elasticsearch.marvel.agent.collector.shards.ShardMonitoringDoc; import org.elasticsearch.xpack.monitoring.agent.collector.shards.ShardMonitoringDoc;
import org.elasticsearch.marvel.agent.exporter.MonitoringDoc; import org.elasticsearch.xpack.monitoring.agent.exporter.MonitoringDoc;
import org.elasticsearch.marvel.agent.resolver.bulk.MonitoringBulkDataResolver; import org.elasticsearch.xpack.monitoring.agent.resolver.bulk.MonitoringBulkDataResolver;
import org.elasticsearch.marvel.agent.resolver.bulk.MonitoringBulkTimestampedResolver; import org.elasticsearch.xpack.monitoring.agent.resolver.bulk.MonitoringBulkTimestampedResolver;
import org.elasticsearch.marvel.agent.resolver.cluster.ClusterInfoResolver; import org.elasticsearch.xpack.monitoring.agent.resolver.cluster.ClusterInfoResolver;
import org.elasticsearch.marvel.agent.resolver.cluster.ClusterStateNodeResolver; import org.elasticsearch.xpack.monitoring.agent.resolver.cluster.ClusterStateNodeResolver;
import org.elasticsearch.marvel.agent.resolver.cluster.ClusterStateResolver; import org.elasticsearch.xpack.monitoring.agent.resolver.cluster.ClusterStateResolver;
import org.elasticsearch.marvel.agent.resolver.cluster.ClusterStatsResolver; import org.elasticsearch.xpack.monitoring.agent.resolver.cluster.ClusterStatsResolver;
import org.elasticsearch.marvel.agent.resolver.cluster.DiscoveryNodeResolver; import org.elasticsearch.xpack.monitoring.agent.resolver.cluster.DiscoveryNodeResolver;
import org.elasticsearch.marvel.agent.resolver.indices.IndexRecoveryResolver; import org.elasticsearch.xpack.monitoring.agent.resolver.indices.IndexRecoveryResolver;
import org.elasticsearch.marvel.agent.resolver.indices.IndexStatsResolver; import org.elasticsearch.xpack.monitoring.agent.resolver.indices.IndexStatsResolver;
import org.elasticsearch.marvel.agent.resolver.indices.IndicesStatsResolver; import org.elasticsearch.xpack.monitoring.agent.resolver.indices.IndicesStatsResolver;
import org.elasticsearch.marvel.agent.resolver.node.NodeStatsResolver; import org.elasticsearch.xpack.monitoring.agent.resolver.node.NodeStatsResolver;
import org.elasticsearch.marvel.agent.resolver.shards.ShardsResolver; import org.elasticsearch.xpack.monitoring.agent.resolver.shards.ShardsResolver;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Iterator; import java.util.Iterator;
@ -40,15 +40,13 @@ import java.util.List;
import java.util.Objects; import java.util.Objects;
import java.util.function.Predicate; import java.util.function.Predicate;
import static org.elasticsearch.marvel.MonitoredSystem.ES;
public class ResolversRegistry implements Iterable<MonitoringIndexNameResolver> { public class ResolversRegistry implements Iterable<MonitoringIndexNameResolver> {
private final List<Registration> registrations = new ArrayList<>(); private final List<Registration> registrations = new ArrayList<>();
public ResolversRegistry(Settings settings) { public ResolversRegistry(Settings settings) {
// register built-in defaults resolvers // register built-in defaults resolvers
registerBuiltIn(ES, settings); registerBuiltIn(MonitoredSystem.ES, settings);
// register resolvers for monitored systems // register resolvers for monitored systems
registerMonitoredSystem(MonitoredSystem.KIBANA, settings); registerMonitoredSystem(MonitoredSystem.KIBANA, settings);

View File

@ -3,13 +3,13 @@
* or more contributor license agreements. Licensed under the Elastic License; * or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with 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.bytes.BytesReference;
import org.elasticsearch.common.xcontent.ToXContent; import org.elasticsearch.common.xcontent.ToXContent;
import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentBuilder;
import org.elasticsearch.marvel.action.MonitoringBulkDoc; import org.elasticsearch.xpack.monitoring.action.MonitoringBulkDoc;
import org.elasticsearch.marvel.agent.resolver.MonitoringIndexNameResolver; import org.elasticsearch.xpack.monitoring.agent.resolver.MonitoringIndexNameResolver;
import java.io.IOException; import java.io.IOException;

View File

@ -3,15 +3,15 @@
* or more contributor license agreements. Licensed under the Elastic License; * or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with 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.bytes.BytesReference;
import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.xcontent.ToXContent; import org.elasticsearch.common.xcontent.ToXContent;
import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentBuilder;
import org.elasticsearch.marvel.MonitoredSystem; import org.elasticsearch.xpack.monitoring.MonitoredSystem;
import org.elasticsearch.marvel.action.MonitoringBulkDoc; import org.elasticsearch.xpack.monitoring.action.MonitoringBulkDoc;
import org.elasticsearch.marvel.agent.resolver.MonitoringIndexNameResolver; import org.elasticsearch.xpack.monitoring.agent.resolver.MonitoringIndexNameResolver;
import java.io.IOException; import java.io.IOException;

View File

@ -3,7 +3,7 @@
* or more contributor license agreements. Licensed under the Elastic License; * or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with 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.action.admin.cluster.stats.ClusterStatsResponse;
import org.elasticsearch.common.collect.MapBuilder; 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.ToXContent;
import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentBuilder;
import org.elasticsearch.license.core.License; import org.elasticsearch.license.core.License;
import org.elasticsearch.marvel.agent.collector.cluster.ClusterInfoMonitoringDoc; import org.elasticsearch.xpack.monitoring.agent.collector.cluster.ClusterInfoMonitoringDoc;
import org.elasticsearch.marvel.agent.resolver.MonitoringIndexNameResolver; import org.elasticsearch.xpack.monitoring.agent.resolver.MonitoringIndexNameResolver;
import java.io.IOException; import java.io.IOException;
import java.nio.charset.StandardCharsets; import java.nio.charset.StandardCharsets;

View File

@ -3,14 +3,14 @@
* or more contributor license agreements. Licensed under the Elastic License; * or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with 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.settings.Settings;
import org.elasticsearch.common.xcontent.ToXContent; import org.elasticsearch.common.xcontent.ToXContent;
import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentBuilder;
import org.elasticsearch.marvel.MonitoredSystem; import org.elasticsearch.xpack.monitoring.MonitoredSystem;
import org.elasticsearch.marvel.agent.collector.cluster.ClusterStateNodeMonitoringDoc; import org.elasticsearch.xpack.monitoring.agent.collector.cluster.ClusterStateNodeMonitoringDoc;
import org.elasticsearch.marvel.agent.resolver.MonitoringIndexNameResolver; import org.elasticsearch.xpack.monitoring.agent.resolver.MonitoringIndexNameResolver;
import java.io.IOException; import java.io.IOException;

View File

@ -3,15 +3,15 @@
* or more contributor license agreements. Licensed under the Elastic License; * or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with 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.cluster.ClusterState;
import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.xcontent.ToXContent; import org.elasticsearch.common.xcontent.ToXContent;
import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentBuilder;
import org.elasticsearch.marvel.MonitoredSystem; import org.elasticsearch.xpack.monitoring.MonitoredSystem;
import org.elasticsearch.marvel.agent.collector.cluster.ClusterStateMonitoringDoc; import org.elasticsearch.xpack.monitoring.agent.collector.cluster.ClusterStateMonitoringDoc;
import org.elasticsearch.marvel.agent.resolver.MonitoringIndexNameResolver; import org.elasticsearch.xpack.monitoring.agent.resolver.MonitoringIndexNameResolver;
import java.io.IOException; import java.io.IOException;
import java.util.Locale; import java.util.Locale;

View File

@ -3,15 +3,15 @@
* or more contributor license agreements. Licensed under the Elastic License; * or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with 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.action.admin.cluster.stats.ClusterStatsResponse;
import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.xcontent.ToXContent; import org.elasticsearch.common.xcontent.ToXContent;
import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentBuilder;
import org.elasticsearch.marvel.MonitoredSystem; import org.elasticsearch.xpack.monitoring.MonitoredSystem;
import org.elasticsearch.marvel.agent.collector.cluster.ClusterStatsMonitoringDoc; import org.elasticsearch.xpack.monitoring.agent.collector.cluster.ClusterStatsMonitoringDoc;
import org.elasticsearch.marvel.agent.resolver.MonitoringIndexNameResolver; import org.elasticsearch.xpack.monitoring.agent.resolver.MonitoringIndexNameResolver;
import java.io.IOException; import java.io.IOException;

View File

@ -3,13 +3,13 @@
* or more contributor license agreements. Licensed under the Elastic License; * or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with 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.cluster.node.DiscoveryNode;
import org.elasticsearch.common.xcontent.ToXContent; import org.elasticsearch.common.xcontent.ToXContent;
import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentBuilder;
import org.elasticsearch.marvel.agent.collector.cluster.DiscoveryNodeMonitoringDoc; import org.elasticsearch.xpack.monitoring.agent.collector.cluster.DiscoveryNodeMonitoringDoc;
import org.elasticsearch.marvel.agent.resolver.MonitoringIndexNameResolver; import org.elasticsearch.xpack.monitoring.agent.resolver.MonitoringIndexNameResolver;
import java.io.IOException; import java.io.IOException;
import java.util.Map; import java.util.Map;

View File

@ -3,16 +3,16 @@
* or more contributor license agreements. Licensed under the Elastic License; * or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with 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.admin.indices.recovery.RecoveryResponse;
import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.xcontent.ToXContent; import org.elasticsearch.common.xcontent.ToXContent;
import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentBuilder;
import org.elasticsearch.indices.recovery.RecoveryState; import org.elasticsearch.indices.recovery.RecoveryState;
import org.elasticsearch.marvel.MonitoredSystem; import org.elasticsearch.xpack.monitoring.MonitoredSystem;
import org.elasticsearch.marvel.agent.collector.indices.IndexRecoveryMonitoringDoc; import org.elasticsearch.xpack.monitoring.agent.collector.indices.IndexRecoveryMonitoringDoc;
import org.elasticsearch.marvel.agent.resolver.MonitoringIndexNameResolver; import org.elasticsearch.xpack.monitoring.agent.resolver.MonitoringIndexNameResolver;
import java.io.IOException; import java.io.IOException;
import java.util.List; import java.util.List;

View File

@ -3,15 +3,15 @@
* or more contributor license agreements. Licensed under the Elastic License; * or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with 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.action.admin.indices.stats.IndexStats;
import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.xcontent.ToXContent; import org.elasticsearch.common.xcontent.ToXContent;
import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentBuilder;
import org.elasticsearch.marvel.MonitoredSystem; import org.elasticsearch.xpack.monitoring.MonitoredSystem;
import org.elasticsearch.marvel.agent.collector.indices.IndexStatsMonitoringDoc; import org.elasticsearch.xpack.monitoring.agent.collector.indices.IndexStatsMonitoringDoc;
import org.elasticsearch.marvel.agent.resolver.MonitoringIndexNameResolver; import org.elasticsearch.xpack.monitoring.agent.resolver.MonitoringIndexNameResolver;
import java.io.IOException; import java.io.IOException;

View File

@ -3,15 +3,15 @@
* or more contributor license agreements. Licensed under the Elastic License; * or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with 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.admin.indices.stats.IndicesStatsResponse;
import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.xcontent.ToXContent; import org.elasticsearch.common.xcontent.ToXContent;
import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentBuilder;
import org.elasticsearch.marvel.MonitoredSystem; import org.elasticsearch.xpack.monitoring.MonitoredSystem;
import org.elasticsearch.marvel.agent.collector.indices.IndicesStatsMonitoringDoc; import org.elasticsearch.xpack.monitoring.agent.collector.indices.IndicesStatsMonitoringDoc;
import org.elasticsearch.marvel.agent.resolver.MonitoringIndexNameResolver; import org.elasticsearch.xpack.monitoring.agent.resolver.MonitoringIndexNameResolver;
import java.io.IOException; import java.io.IOException;

View File

@ -3,15 +3,15 @@
* or more contributor license agreements. Licensed under the Elastic License; * or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with 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.action.admin.cluster.node.stats.NodeStats;
import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.xcontent.ToXContent; import org.elasticsearch.common.xcontent.ToXContent;
import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentBuilder;
import org.elasticsearch.marvel.MonitoredSystem; import org.elasticsearch.xpack.monitoring.MonitoredSystem;
import org.elasticsearch.marvel.agent.collector.node.NodeStatsMonitoringDoc; import org.elasticsearch.xpack.monitoring.agent.collector.node.NodeStatsMonitoringDoc;
import org.elasticsearch.marvel.agent.resolver.MonitoringIndexNameResolver; import org.elasticsearch.xpack.monitoring.agent.resolver.MonitoringIndexNameResolver;
import java.io.IOException; import java.io.IOException;

View File

@ -3,15 +3,15 @@
* or more contributor license agreements. Licensed under the Elastic License; * or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with 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.cluster.routing.ShardRouting;
import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.xcontent.ToXContent; import org.elasticsearch.common.xcontent.ToXContent;
import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentBuilder;
import org.elasticsearch.marvel.MonitoredSystem; import org.elasticsearch.xpack.monitoring.MonitoredSystem;
import org.elasticsearch.marvel.agent.collector.shards.ShardMonitoringDoc; import org.elasticsearch.xpack.monitoring.agent.collector.shards.ShardMonitoringDoc;
import org.elasticsearch.marvel.agent.resolver.MonitoringIndexNameResolver; import org.elasticsearch.xpack.monitoring.agent.resolver.MonitoringIndexNameResolver;
import java.io.IOException; import java.io.IOException;

View File

@ -3,7 +3,7 @@
* or more contributor license agreements. Licensed under the Elastic License; * or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with 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.component.AbstractLifecycleComponent;
import org.elasticsearch.common.inject.Inject; 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.AbstractLifecycleRunnable;
import org.elasticsearch.common.util.concurrent.EsRejectedExecutionException; import org.elasticsearch.common.util.concurrent.EsRejectedExecutionException;
import org.elasticsearch.common.util.concurrent.FutureUtils; 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.threadpool.ThreadPool;
import org.elasticsearch.xpack.monitoring.MonitoringLicensee;
import org.elasticsearch.xpack.monitoring.MonitoringSettings;
import org.joda.time.DateTime; import org.joda.time.DateTime;
import org.joda.time.chrono.ISOChronology; import org.joda.time.chrono.ISOChronology;

View File

@ -3,16 +3,16 @@
* or more contributor license agreements. Licensed under the Elastic License; * or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with 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.ActionFuture;
import org.elasticsearch.action.ActionListener; import org.elasticsearch.action.ActionListener;
import org.elasticsearch.client.Client; import org.elasticsearch.client.Client;
import org.elasticsearch.common.inject.Inject; import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.marvel.action.MonitoringBulkAction; import org.elasticsearch.xpack.monitoring.action.MonitoringBulkAction;
import org.elasticsearch.marvel.action.MonitoringBulkRequest; import org.elasticsearch.xpack.monitoring.action.MonitoringBulkRequest;
import org.elasticsearch.marvel.action.MonitoringBulkRequestBuilder; import org.elasticsearch.xpack.monitoring.action.MonitoringBulkRequestBuilder;
import org.elasticsearch.marvel.action.MonitoringBulkResponse; import org.elasticsearch.xpack.monitoring.action.MonitoringBulkResponse;
import java.util.Map; import java.util.Map;

View File

@ -3,7 +3,7 @@
* or more contributor license agreements. Licensed under the Elastic License; * or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with 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; import org.elasticsearch.common.inject.AbstractModule;

View File

@ -3,7 +3,7 @@
* or more contributor license agreements. Licensed under the Elastic License; * or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with 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.client.Client;
import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.Settings;

View File

@ -3,7 +3,7 @@
* or more contributor license agreements. Licensed under the Elastic License; * or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with 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.ElasticsearchParseException;
import org.elasticsearch.client.Client; import org.elasticsearch.client.Client;
@ -11,9 +11,6 @@ import org.elasticsearch.common.Strings;
import org.elasticsearch.common.inject.Inject; import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.xcontent.XContentBuilder; 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.BytesRestResponse;
import org.elasticsearch.rest.RestChannel; import org.elasticsearch.rest.RestChannel;
import org.elasticsearch.rest.RestController; 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.RestActions;
import org.elasticsearch.rest.action.support.RestBuilderListener; import org.elasticsearch.rest.action.support.RestBuilderListener;
import org.elasticsearch.xpack.XPackClient; 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.POST;
import static org.elasticsearch.rest.RestRequest.Method.PUT; import static org.elasticsearch.rest.RestRequest.Method.PUT;

View File

@ -3,7 +3,7 @@
* or more contributor license agreements. Licensed under the Elastic License; * or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with 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.Version;
import org.elasticsearch.common.Strings; import org.elasticsearch.common.Strings;

View File

@ -3,7 +3,7 @@
* or more contributor license agreements. Licensed under the Elastic License; * or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with 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.apache.lucene.util.IOUtils;
import org.elasticsearch.ElasticsearchException; import org.elasticsearch.ElasticsearchException;

View File

@ -3,16 +3,16 @@
* or more contributor license agreements. Licensed under the Elastic License; * or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with 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.io.stream.NamedWriteableRegistry;
import org.elasticsearch.common.settings.Settings; 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.test.ESTestCase;
import org.elasticsearch.xpack.XPackFeatureSet; 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.elasticsearch.xpack.watcher.support.xcontent.XContentSource;
import org.junit.Before; import org.junit.Before;

View File

@ -3,19 +3,16 @@
* or more contributor license agreements. Licensed under the Elastic License; * or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with 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.Client;
import org.elasticsearch.client.transport.TransportClient; import org.elasticsearch.client.transport.TransportClient;
import org.elasticsearch.common.inject.Module;
import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.test.ESTestCase; import org.elasticsearch.test.ESTestCase;
import java.util.Collection;
import static org.hamcrest.Matchers.is; import static org.hamcrest.Matchers.is;
public class MarvelPluginClientTests extends ESTestCase { public class MonitoringPluginClientTests extends ESTestCase {
public void testModulesWithClientSettings() { public void testModulesWithClientSettings() {
Settings settings = Settings.builder() Settings settings = Settings.builder()

View File

@ -3,32 +3,32 @@
* or more contributor license agreements. Licensed under the Elastic License; * or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with 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.NodeInfo;
import org.elasticsearch.action.admin.cluster.node.info.NodesInfoResponse; import org.elasticsearch.action.admin.cluster.node.info.NodesInfoResponse;
import org.elasticsearch.common.settings.Settings; 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.plugins.PluginInfo;
import org.elasticsearch.test.ESIntegTestCase.ClusterScope; import org.elasticsearch.test.ESIntegTestCase.ClusterScope;
import org.elasticsearch.xpack.XPackPlugin; 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.elasticsearch.test.ESIntegTestCase.Scope.TEST;
import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.equalTo;
@ClusterScope(scope = TEST, transportClientRatio = 0, numClientNodes = 0, numDataNodes = 0) @ClusterScope(scope = TEST, transportClientRatio = 0, numClientNodes = 0, numDataNodes = 0)
public class MarvelPluginTests extends MarvelIntegTestCase { public class MonitoringPluginTests extends MonitoringIntegTestCase {
@Override @Override
protected void startCollection() { protected void startCollection() {
// do nothing as marvel is sometime unbound // do nothing as monitoring is sometime unbound
} }
@Override @Override
protected void stopCollection() { protected void stopCollection() {
// do nothing as marvel is sometime unbound // do nothing as monitoring is sometime unbound
} }
@Override @Override
@ -39,7 +39,7 @@ public class MarvelPluginTests extends MarvelIntegTestCase {
.build(); .build();
} }
public void testMarvelEnabled() { public void testMonitoringEnabled() {
internalCluster().startNode(Settings.builder() internalCluster().startNode(Settings.builder()
.put(XPackPlugin.featureEnabledSetting(Monitoring.NAME), true) .put(XPackPlugin.featureEnabledSetting(Monitoring.NAME), true)
.build()); .build());
@ -47,7 +47,7 @@ public class MarvelPluginTests extends MarvelIntegTestCase {
assertServiceIsBound(AgentService.class); assertServiceIsBound(AgentService.class);
} }
public void testMarvelDisabled() { public void testMonitoringDisabled() {
internalCluster().startNode(Settings.builder() internalCluster().startNode(Settings.builder()
.put(XPackPlugin.featureEnabledSetting(Monitoring.NAME), false) .put(XPackPlugin.featureEnabledSetting(Monitoring.NAME), false)
.build()); .build());
@ -55,7 +55,7 @@ public class MarvelPluginTests extends MarvelIntegTestCase {
assertServiceIsNotBound(AgentService.class); assertServiceIsNotBound(AgentService.class);
} }
public void testMarvelEnabledOnTribeNode() { public void testMonitoringEnabledOnTribeNode() {
internalCluster().startNode(Settings.builder() internalCluster().startNode(Settings.builder()
.put(XPackPlugin.featureEnabledSetting(Monitoring.NAME), true) .put(XPackPlugin.featureEnabledSetting(Monitoring.NAME), true)
.put("tribe.name", "t1") .put("tribe.name", "t1")
@ -64,7 +64,7 @@ public class MarvelPluginTests extends MarvelIntegTestCase {
assertServiceIsBound(AgentService.class); assertServiceIsBound(AgentService.class);
} }
public void testMarvelDisabledOnTribeNode() { public void testMonitoringDisabledOnTribeNode() {
internalCluster().startNode(Settings.builder().put("tribe.name", "t1").build()); internalCluster().startNode(Settings.builder().put("tribe.name", "t1").build());
assertPluginIsLoaded(); assertPluginIsLoaded();
assertServiceIsNotBound(AgentService.class); assertServiceIsNotBound(AgentService.class);

View File

@ -3,19 +3,18 @@
* or more contributor license agreements. Licensed under the Elastic License; * or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with 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.settings.Settings;
import org.elasticsearch.common.unit.TimeValue; import org.elasticsearch.common.unit.TimeValue;
import org.elasticsearch.test.ESTestCase; import org.elasticsearch.test.ESTestCase;
import org.junit.Rule; import org.junit.Rule;
import org.junit.rules.ExpectedException; import org.junit.rules.ExpectedException;
/** /**
* Tests {@link MonitoringSettings} * Tests {@link MonitoringSettings}
*/ */
public class MarvelSettingsTests extends ESTestCase { public class MonitoringSettingsTests extends ESTestCase {
@Rule @Rule
public ExpectedException expectedException = ExpectedException.none(); public ExpectedException expectedException = ExpectedException.none();

View File

@ -3,14 +3,14 @@
* or more contributor license agreements. Licensed under the Elastic License; * or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with 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.Client;
import org.elasticsearch.common.bytes.BytesArray; 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.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.Collections;
import java.util.List; import java.util.List;

View File

@ -3,14 +3,14 @@
* or more contributor license agreements. Licensed under the Elastic License; * or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with 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.Version;
import org.elasticsearch.common.bytes.BytesArray; import org.elasticsearch.common.bytes.BytesArray;
import org.elasticsearch.common.io.stream.BytesStreamOutput; import org.elasticsearch.common.io.stream.BytesStreamOutput;
import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamInput;
import org.elasticsearch.marvel.agent.exporter.MonitoringDoc;
import org.elasticsearch.test.ESTestCase; import org.elasticsearch.test.ESTestCase;
import org.elasticsearch.xpack.monitoring.agent.exporter.MonitoringDoc;
import java.io.IOException; import java.io.IOException;
import java.util.HashMap; import java.util.HashMap;

View File

@ -3,7 +3,7 @@
* or more contributor license agreements. Licensed under the Elastic License; * or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with 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.action.ActionRequestValidationException;
import org.elasticsearch.common.bytes.BytesArray; import org.elasticsearch.common.bytes.BytesArray;

View File

@ -3,14 +3,14 @@
* or more contributor license agreements. Licensed under the Elastic License; * or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with 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.Version;
import org.elasticsearch.common.io.stream.BytesStreamOutput; import org.elasticsearch.common.io.stream.BytesStreamOutput;
import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamInput;
import org.elasticsearch.marvel.agent.exporter.ExportException;
import org.elasticsearch.rest.RestStatus; import org.elasticsearch.rest.RestStatus;
import org.elasticsearch.test.ESTestCase; import org.elasticsearch.test.ESTestCase;
import org.elasticsearch.xpack.monitoring.agent.exporter.ExportException;
import java.io.IOException; import java.io.IOException;

View File

@ -3,17 +3,17 @@
* or more contributor license agreements. Licensed under the Elastic License; * or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with 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.Version;
import org.elasticsearch.action.search.SearchResponse; import org.elasticsearch.action.search.SearchResponse;
import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.util.concurrent.AbstractRunnable; 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.search.SearchHit;
import org.elasticsearch.test.junit.annotations.TestLogging; 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.List;
import java.util.Map; import java.util.Map;
@ -30,7 +30,7 @@ import static org.hamcrest.Matchers.notNullValue;
import static org.hamcrest.Matchers.nullValue; import static org.hamcrest.Matchers.nullValue;
@TestLogging("_root:DEBUG") @TestLogging("_root:DEBUG")
public class MonitoringBulkTests extends MarvelIntegTestCase { public class MonitoringBulkTests extends MonitoringIntegTestCase {
@Override @Override
protected Settings transportClientSettings() { protected Settings transportClientSettings() {
@ -120,7 +120,7 @@ public class MonitoringBulkTests extends MarvelIntegTestCase {
} }
assertThat(exceptions, empty()); assertThat(exceptions, empty());
awaitMarvelDocsCount(greaterThanOrEqualTo(total.get()), "concurrent"); awaitMonitoringDocsCount(greaterThanOrEqualTo(total.get()), "concurrent");
} }
public void testUnsupportedSystem() throws Exception { public void testUnsupportedSystem() throws Exception {

View File

@ -3,7 +3,7 @@
* or more contributor license agreements. Licensed under the Elastic License; * or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with 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.BytesStreamOutput;
import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamInput;

View File

@ -3,14 +3,13 @@
* or more contributor license agreements. Licensed under the Elastic License; * or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with 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.ElasticsearchException;
import org.elasticsearch.Version; import org.elasticsearch.Version;
import org.elasticsearch.action.support.ActionFilters; import org.elasticsearch.action.support.ActionFilters;
import org.elasticsearch.action.support.PlainActionFuture; import org.elasticsearch.action.support.PlainActionFuture;
import org.elasticsearch.cluster.ClusterChangedEvent; import org.elasticsearch.cluster.ClusterChangedEvent;
import org.elasticsearch.cluster.ClusterName;
import org.elasticsearch.cluster.ClusterState; import org.elasticsearch.cluster.ClusterState;
import org.elasticsearch.cluster.ClusterStateUpdateTask; import org.elasticsearch.cluster.ClusterStateUpdateTask;
import org.elasticsearch.cluster.NodeConnectionsService; 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.transport.DummyTransportAddress;
import org.elasticsearch.common.util.concurrent.ConcurrentCollections; import org.elasticsearch.common.util.concurrent.ConcurrentCollections;
import org.elasticsearch.discovery.DiscoverySettings; 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.ESTestCase;
import org.elasticsearch.test.transport.CapturingTransport; import org.elasticsearch.test.transport.CapturingTransport;
import org.elasticsearch.threadpool.TestThreadPool; import org.elasticsearch.threadpool.TestThreadPool;
import org.elasticsearch.threadpool.ThreadPool; import org.elasticsearch.threadpool.ThreadPool;
import org.elasticsearch.transport.TransportService; 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.After;
import org.junit.AfterClass; import org.junit.AfterClass;
import org.junit.Before; import org.junit.Before;

View File

@ -3,11 +3,13 @@
* or more contributor license agreements. Licensed under the Elastic License; * or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with 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.RandomizedTest;
import com.carrotsearch.randomizedtesting.SysGlobals; import com.carrotsearch.randomizedtesting.SysGlobals;
import org.elasticsearch.action.ActionModule; import org.elasticsearch.action.ActionModule;
import org.elasticsearch.action.ActionRequest;
import org.elasticsearch.action.ActionResponse;
import org.elasticsearch.cluster.block.ClusterBlocks; import org.elasticsearch.cluster.block.ClusterBlocks;
import org.elasticsearch.common.component.AbstractComponent; import org.elasticsearch.common.component.AbstractComponent;
import org.elasticsearch.common.component.LifecycleComponent; import org.elasticsearch.common.component.LifecycleComponent;
@ -23,13 +25,15 @@ import org.elasticsearch.license.plugin.core.LicenseState;
import org.elasticsearch.license.plugin.core.Licensee; import org.elasticsearch.license.plugin.core.Licensee;
import org.elasticsearch.license.plugin.core.LicenseeRegistry; import org.elasticsearch.license.plugin.core.LicenseeRegistry;
import org.elasticsearch.license.plugin.core.LicensesManagerService; 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.Plugin;
import org.elasticsearch.plugins.ActionPlugin.ActionHandler;
import org.elasticsearch.xpack.security.InternalClient; import org.elasticsearch.xpack.security.InternalClient;
import org.elasticsearch.test.ESIntegTestCase; import org.elasticsearch.test.ESIntegTestCase;
import org.elasticsearch.test.ESIntegTestCase.ClusterScope; import org.elasticsearch.test.ESIntegTestCase.ClusterScope;
import org.elasticsearch.xpack.XPackPlugin; 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 org.junit.Before;
import java.util.ArrayList; import java.util.ArrayList;
@ -39,10 +43,11 @@ import java.util.Collections;
import java.util.List; import java.util.List;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
import static java.util.Collections.emptyList;
import static org.elasticsearch.common.unit.TimeValue.timeValueMinutes; import static org.elasticsearch.common.unit.TimeValue.timeValueMinutes;
@ClusterScope(scope = ESIntegTestCase.Scope.SUITE, randomDynamicTemplates = false, transportClientRatio = 0.0) @ClusterScope(scope = ESIntegTestCase.Scope.SUITE, randomDynamicTemplates = false, transportClientRatio = 0.0)
public abstract class AbstractCollectorTestCase extends MarvelIntegTestCase { public abstract class AbstractCollectorTestCase extends MonitoringIntegTestCase {
@Override @Override
protected Collection<Class<? extends Plugin>> nodePlugins() { protected Collection<Class<? extends Plugin>> nodePlugins() {
@ -204,7 +209,8 @@ public abstract class AbstractCollectorTestCase extends MarvelIntegTestCase {
} }
@Override @Override
public void onModule(ActionModule module) { public List<ActionHandler<? extends ActionRequest<?>, ? extends ActionResponse>> getActions() {
return emptyList();
} }
@Override @Override

View File

@ -3,18 +3,18 @@
* or more contributor license agreements. Licensed under the Elastic License; * or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with 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.Version;
import org.elasticsearch.cluster.service.ClusterService;
import org.elasticsearch.cluster.ClusterState; import org.elasticsearch.cluster.ClusterState;
import org.elasticsearch.cluster.metadata.IndexMetaData; import org.elasticsearch.cluster.metadata.IndexMetaData;
import org.elasticsearch.cluster.service.ClusterService;
import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.marvel.MonitoringSettings; import org.elasticsearch.xpack.monitoring.MonitoredSystem;
import org.elasticsearch.marvel.MonitoredSystem; import org.elasticsearch.xpack.monitoring.MonitoringLicensee;
import org.elasticsearch.marvel.agent.collector.AbstractCollectorTestCase; import org.elasticsearch.xpack.monitoring.MonitoringSettings;
import org.elasticsearch.marvel.agent.exporter.MonitoringDoc; import org.elasticsearch.xpack.monitoring.agent.collector.AbstractCollectorTestCase;
import org.elasticsearch.marvel.MonitoringLicensee; import org.elasticsearch.xpack.monitoring.agent.exporter.MonitoringDoc;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collection; import java.util.Collection;
@ -34,7 +34,7 @@ import static org.hamcrest.Matchers.notNullValue;
public class ClusterStateCollectorTests extends AbstractCollectorTestCase { public class ClusterStateCollectorTests extends AbstractCollectorTestCase {
public void testClusterStateCollectorNoIndices() throws Exception { public void testClusterStateCollectorNoIndices() throws Exception {
assertMarvelDocs(newClusterStateCollector().doCollect(), 0); assertMonitoringDocs(newClusterStateCollector().doCollect(), 0);
} }
public void testClusterStateCollectorOneIndex() throws Exception { public void testClusterStateCollectorOneIndex() throws Exception {
@ -53,7 +53,7 @@ public class ClusterStateCollectorTests extends AbstractCollectorTestCase {
securedRefresh(); securedRefresh();
assertHitCount(client().prepareSearch().setSize(0).get(), nbDocs); assertHitCount(client().prepareSearch().setSize(0).get(), nbDocs);
assertMarvelDocs(newClusterStateCollector().doCollect(), nbShards); assertMonitoringDocs(newClusterStateCollector().doCollect(), nbShards);
} }
public void testClusterStateCollectorMultipleIndices() throws Exception { public void testClusterStateCollectorMultipleIndices() throws Exception {
@ -84,23 +84,23 @@ public class ClusterStateCollectorTests extends AbstractCollectorTestCase {
} }
Collection<MonitoringDoc> results = newClusterStateCollector().doCollect(); Collection<MonitoringDoc> results = newClusterStateCollector().doCollect();
assertMarvelDocs(results, nbShards); assertMonitoringDocs(results, nbShards);
MonitoringDoc monitoringDoc = results.iterator().next(); MonitoringDoc monitoringDoc = results.iterator().next();
assertNotNull(monitoringDoc); assertNotNull(monitoringDoc);
assertThat(monitoringDoc, instanceOf(ClusterStateMonitoringDoc.class)); assertThat(monitoringDoc, instanceOf(ClusterStateMonitoringDoc.class));
ClusterStateMonitoringDoc clusterStateMarvelDoc = (ClusterStateMonitoringDoc) monitoringDoc; ClusterStateMonitoringDoc clusterStateMonitoringDoc = (ClusterStateMonitoringDoc) monitoringDoc;
assertThat(clusterStateMarvelDoc.getMonitoringId(), equalTo(MonitoredSystem.ES.getSystem())); assertThat(clusterStateMonitoringDoc.getMonitoringId(), equalTo(MonitoredSystem.ES.getSystem()));
assertThat(clusterStateMarvelDoc.getMonitoringVersion(), equalTo(Version.CURRENT.toString())); assertThat(clusterStateMonitoringDoc.getMonitoringVersion(), equalTo(Version.CURRENT.toString()));
assertThat(clusterStateMarvelDoc.getClusterUUID(), assertThat(clusterStateMonitoringDoc.getClusterUUID(),
equalTo(client().admin().cluster().prepareState().setMetaData(true).get().getState().metaData().clusterUUID())); equalTo(client().admin().cluster().prepareState().setMetaData(true).get().getState().metaData().clusterUUID()));
assertThat(clusterStateMarvelDoc.getTimestamp(), greaterThan(0L)); assertThat(clusterStateMonitoringDoc.getTimestamp(), greaterThan(0L));
assertThat(clusterStateMarvelDoc.getSourceNode(), notNullValue()); assertThat(clusterStateMonitoringDoc.getSourceNode(), notNullValue());
assertNotNull(clusterStateMarvelDoc.getClusterState()); assertNotNull(clusterStateMonitoringDoc.getClusterState());
ClusterState clusterState = clusterStateMarvelDoc.getClusterState(); ClusterState clusterState = clusterStateMonitoringDoc.getClusterState();
for (int i = 0; i < nbIndices; i++) { for (int i = 0; i < nbIndices; i++) {
assertThat(clusterState.getRoutingTable().allShards("test-" + i), hasSize(shardsPerIndex[i])); assertThat(clusterState.getRoutingTable().allShards("test-" + i), hasSize(shardsPerIndex[i]));
} }
@ -158,7 +158,7 @@ public class ClusterStateCollectorTests extends AbstractCollectorTestCase {
securedClient(nodeId)); securedClient(nodeId));
} }
private void assertMarvelDocs(Collection<MonitoringDoc> results, final int nbShards) { private void assertMonitoringDocs(Collection<MonitoringDoc> results, final int nbShards) {
assertThat("expecting 1 document for cluster state and 2 documents per node", results, hasSize(1 + internalCluster().size() * 2)); 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(); final ClusterState clusterState = securedClient().admin().cluster().prepareState().get().getState();
@ -178,20 +178,20 @@ public class ClusterStateCollectorTests extends AbstractCollectorTestCase {
instanceOf(ClusterStateNodeMonitoringDoc.class), instanceOf(DiscoveryNodeMonitoringDoc.class))); instanceOf(ClusterStateNodeMonitoringDoc.class), instanceOf(DiscoveryNodeMonitoringDoc.class)));
if (doc instanceof ClusterStateMonitoringDoc) { if (doc instanceof ClusterStateMonitoringDoc) {
ClusterStateMonitoringDoc clusterStateMarvelDoc = (ClusterStateMonitoringDoc) doc; ClusterStateMonitoringDoc clusterStateMonitoringDoc = (ClusterStateMonitoringDoc) doc;
assertThat(clusterStateMarvelDoc.getClusterState().getRoutingTable().allShards(), hasSize(nbShards)); assertThat(clusterStateMonitoringDoc.getClusterState().getRoutingTable().allShards(), hasSize(nbShards));
assertThat(clusterStateMarvelDoc.getClusterState().getNodes().getSize(), equalTo(internalCluster().size())); assertThat(clusterStateMonitoringDoc.getClusterState().getNodes().getSize(), equalTo(internalCluster().size()));
} else if (doc instanceof ClusterStateNodeMonitoringDoc) { } else if (doc instanceof ClusterStateNodeMonitoringDoc) {
ClusterStateNodeMonitoringDoc clusterStateNodeMarvelDoc = (ClusterStateNodeMonitoringDoc) doc; ClusterStateNodeMonitoringDoc clusterStateNodeMonitoringDoc = (ClusterStateNodeMonitoringDoc) doc;
assertThat(clusterStateNodeMarvelDoc.getStateUUID(), equalTo(stateUUID)); assertThat(clusterStateNodeMonitoringDoc.getStateUUID(), equalTo(stateUUID));
assertThat(clusterStateNodeMarvelDoc.getNodeId(), not(isEmptyOrNullString())); assertThat(clusterStateNodeMonitoringDoc.getNodeId(), not(isEmptyOrNullString()));
clusterStateNodes.add(clusterStateNodeMarvelDoc); clusterStateNodes.add(clusterStateNodeMonitoringDoc);
} else if (doc instanceof DiscoveryNodeMonitoringDoc) { } else if (doc instanceof DiscoveryNodeMonitoringDoc) {
DiscoveryNodeMonitoringDoc discoveryNodeMarvelDoc = (DiscoveryNodeMonitoringDoc) doc; DiscoveryNodeMonitoringDoc discoveryNodeMonitoringDoc = (DiscoveryNodeMonitoringDoc) doc;
assertNotNull(discoveryNodeMarvelDoc.getNode()); assertNotNull(discoveryNodeMonitoringDoc.getNode());
discoveryNodes.add(discoveryNodeMarvelDoc); discoveryNodes.add(discoveryNodeMonitoringDoc);
} else { } else {
fail("unknown monitoring document type " + doc); fail("unknown monitoring document type " + doc);

View File

@ -3,20 +3,19 @@
* or more contributor license agreements. Licensed under the Elastic License; * or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with 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.apache.lucene.util.LuceneTestCase.BadApple;
import org.elasticsearch.Version; import org.elasticsearch.Version;
import org.elasticsearch.cluster.ClusterName;
import org.elasticsearch.cluster.service.ClusterService; import org.elasticsearch.cluster.service.ClusterService;
import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.license.plugin.core.LicensesManagerService; import org.elasticsearch.license.plugin.core.LicensesManagerService;
import org.elasticsearch.marvel.MonitoringSettings; import org.elasticsearch.xpack.monitoring.MonitoredSystem;
import org.elasticsearch.marvel.MonitoredSystem; import org.elasticsearch.xpack.monitoring.MonitoringLicensee;
import org.elasticsearch.marvel.agent.collector.AbstractCollector; import org.elasticsearch.xpack.monitoring.MonitoringSettings;
import org.elasticsearch.marvel.agent.collector.AbstractCollectorTestCase; import org.elasticsearch.xpack.monitoring.agent.collector.AbstractCollector;
import org.elasticsearch.marvel.agent.exporter.MonitoringDoc; import org.elasticsearch.xpack.monitoring.agent.collector.AbstractCollectorTestCase;
import org.elasticsearch.marvel.MonitoringLicensee; import org.elasticsearch.xpack.monitoring.agent.exporter.MonitoringDoc;
import java.util.Collection; import java.util.Collection;
@ -39,23 +38,23 @@ public class ClusterStatsCollectorTests extends AbstractCollectorTestCase {
assertNotNull(monitoringDoc); assertNotNull(monitoringDoc);
assertThat(monitoringDoc, instanceOf(ClusterInfoMonitoringDoc.class)); assertThat(monitoringDoc, instanceOf(ClusterInfoMonitoringDoc.class));
ClusterInfoMonitoringDoc clusterInfoMarvelDoc = (ClusterInfoMonitoringDoc) monitoringDoc; ClusterInfoMonitoringDoc clusterInfoMonitoringDoc = (ClusterInfoMonitoringDoc) monitoringDoc;
assertThat(clusterInfoMarvelDoc.getMonitoringId(), equalTo(MonitoredSystem.ES.getSystem())); assertThat(clusterInfoMonitoringDoc.getMonitoringId(), equalTo(MonitoredSystem.ES.getSystem()));
assertThat(clusterInfoMarvelDoc.getMonitoringVersion(), equalTo(Version.CURRENT.toString())); assertThat(clusterInfoMonitoringDoc.getMonitoringVersion(), equalTo(Version.CURRENT.toString()));
assertThat(clusterInfoMarvelDoc.getClusterUUID(), assertThat(clusterInfoMonitoringDoc.getClusterUUID(),
equalTo(client().admin().cluster().prepareState().setMetaData(true).get().getState().metaData().clusterUUID())); equalTo(client().admin().cluster().prepareState().setMetaData(true).get().getState().metaData().clusterUUID()));
assertThat(clusterInfoMarvelDoc.getTimestamp(), greaterThan(0L)); assertThat(clusterInfoMonitoringDoc.getTimestamp(), greaterThan(0L));
assertThat(clusterInfoMarvelDoc.getSourceNode(), notNullValue()); assertThat(clusterInfoMonitoringDoc.getSourceNode(), notNullValue());
assertThat(clusterInfoMarvelDoc.getClusterName(), assertThat(clusterInfoMonitoringDoc.getClusterName(),
equalTo(client().admin().cluster().prepareState().setMetaData(true).get().getClusterName().value())); 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())); equalTo(client().admin().cluster().prepareNodesInfo().get().getNodes().get(0).getVersion().toString()));
assertThat(clusterInfoMarvelDoc.getLicense(), notNullValue()); assertThat(clusterInfoMonitoringDoc.getLicense(), notNullValue());
assertNotNull(clusterInfoMarvelDoc.getClusterStats()); assertNotNull(clusterInfoMonitoringDoc.getClusterStats());
assertThat(clusterInfoMarvelDoc.getClusterStats().getNodesStats().getCounts().getTotal(), assertThat(clusterInfoMonitoringDoc.getClusterStats().getNodesStats().getCounts().getTotal(),
equalTo(internalCluster().getNodeNames().length)); equalTo(internalCluster().getNodeNames().length));
// Check cluster stats document // Check cluster stats document
@ -63,16 +62,16 @@ public class ClusterStatsCollectorTests extends AbstractCollectorTestCase {
assertNotNull(monitoringDoc); assertNotNull(monitoringDoc);
assertThat(monitoringDoc, instanceOf(ClusterStatsMonitoringDoc.class)); assertThat(monitoringDoc, instanceOf(ClusterStatsMonitoringDoc.class));
ClusterStatsMonitoringDoc clusterStatsMarvelDoc = (ClusterStatsMonitoringDoc) monitoringDoc; ClusterStatsMonitoringDoc clusterStatsMonitoringDoc = (ClusterStatsMonitoringDoc) monitoringDoc;
assertThat(clusterStatsMarvelDoc.getMonitoringId(), equalTo(MonitoredSystem.ES.getSystem())); assertThat(clusterStatsMonitoringDoc.getMonitoringId(), equalTo(MonitoredSystem.ES.getSystem()));
assertThat(clusterStatsMarvelDoc.getMonitoringVersion(), equalTo(Version.CURRENT.toString())); assertThat(clusterStatsMonitoringDoc.getMonitoringVersion(), equalTo(Version.CURRENT.toString()));
assertThat(clusterStatsMarvelDoc.getClusterUUID(), assertThat(clusterStatsMonitoringDoc.getClusterUUID(),
equalTo(client().admin().cluster().prepareState().setMetaData(true).get().getState().metaData().clusterUUID())); equalTo(client().admin().cluster().prepareState().setMetaData(true).get().getState().metaData().clusterUUID()));
assertThat(clusterStatsMarvelDoc.getTimestamp(), greaterThan(0L)); assertThat(clusterStatsMonitoringDoc.getTimestamp(), greaterThan(0L));
assertThat(clusterStatsMarvelDoc.getSourceNode(), notNullValue()); assertThat(clusterStatsMonitoringDoc.getSourceNode(), notNullValue());
assertNotNull(clusterStatsMarvelDoc.getClusterStats()); assertNotNull(clusterStatsMonitoringDoc.getClusterStats());
assertThat(clusterStatsMarvelDoc.getClusterStats().getNodesStats().getCounts().getTotal(), assertThat(clusterStatsMonitoringDoc.getClusterStats().getNodesStats().getCounts().getTotal(),
equalTo(internalCluster().getNodeNames().length)); equalTo(internalCluster().getNodeNames().length));
} }

View File

@ -3,22 +3,23 @@
* or more contributor license agreements. Licensed under the Elastic License; * or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with 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.Version;
import org.elasticsearch.action.admin.indices.recovery.RecoveryResponse; import org.elasticsearch.action.admin.indices.recovery.RecoveryResponse;
import org.elasticsearch.cluster.service.ClusterService;
import org.elasticsearch.cluster.metadata.MetaData; import org.elasticsearch.cluster.metadata.MetaData;
import org.elasticsearch.cluster.service.ClusterService;
import org.elasticsearch.common.Strings; import org.elasticsearch.common.Strings;
import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.index.IndexNotFoundException; import org.elasticsearch.index.IndexNotFoundException;
import org.elasticsearch.indices.recovery.RecoveryState; 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.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.Collection;
import java.util.List; 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_REPLICAS;
import static org.elasticsearch.cluster.metadata.IndexMetaData.SETTING_NUMBER_OF_SHARDS; 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.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertHitCount;
import static org.hamcrest.Matchers.anyOf; import static org.hamcrest.Matchers.anyOf;
import static org.hamcrest.Matchers.empty; import static org.hamcrest.Matchers.empty;
@ -65,7 +65,8 @@ public class IndexRecoveryCollectorTests extends AbstractCollectorTestCase {
assertThat(results, is(empty())); assertThat(results, is(empty()));
logger.info("--> create index [{}] on node [{}]", indexName, node1); 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"); logger.info("--> indexing sample data");
final int numDocs = between(50, 150); final int numDocs = between(50, 150);
@ -100,15 +101,15 @@ public class IndexRecoveryCollectorTests extends AbstractCollectorTestCase {
assertNotNull(monitoringDoc); assertNotNull(monitoringDoc);
assertThat(monitoringDoc, instanceOf(IndexRecoveryMonitoringDoc.class)); assertThat(monitoringDoc, instanceOf(IndexRecoveryMonitoringDoc.class));
IndexRecoveryMonitoringDoc indexRecoveryMarvelDoc = (IndexRecoveryMonitoringDoc) monitoringDoc; IndexRecoveryMonitoringDoc indexRecoveryMonitoringDoc = (IndexRecoveryMonitoringDoc) monitoringDoc;
assertThat(indexRecoveryMarvelDoc.getMonitoringId(), equalTo(MonitoredSystem.ES.getSystem())); assertThat(indexRecoveryMonitoringDoc.getMonitoringId(), equalTo(MonitoredSystem.ES.getSystem()));
assertThat(indexRecoveryMarvelDoc.getMonitoringVersion(), equalTo(Version.CURRENT.toString())); assertThat(indexRecoveryMonitoringDoc.getMonitoringVersion(), equalTo(Version.CURRENT.toString()));
assertThat(indexRecoveryMarvelDoc.getClusterUUID(), assertThat(indexRecoveryMonitoringDoc.getClusterUUID(),
equalTo(client().admin().cluster().prepareState().setMetaData(true).get().getState().metaData().clusterUUID())); equalTo(client().admin().cluster().prepareState().setMetaData(true).get().getState().metaData().clusterUUID()));
assertThat(indexRecoveryMarvelDoc.getTimestamp(), greaterThan(0L)); assertThat(indexRecoveryMonitoringDoc.getTimestamp(), greaterThan(0L));
assertThat(indexRecoveryMarvelDoc.getSourceNode(), notNullValue()); assertThat(indexRecoveryMonitoringDoc.getSourceNode(), notNullValue());
RecoveryResponse recovery = indexRecoveryMarvelDoc.getRecoveryResponse(); RecoveryResponse recovery = indexRecoveryMonitoringDoc.getRecoveryResponse();
assertNotNull(recovery); assertNotNull(recovery);
Map<String, List<RecoveryState>> shards = recovery.shardRecoveryStates(); Map<String, List<RecoveryState>> shards = recovery.shardRecoveryStates();
@ -121,8 +122,10 @@ public class IndexRecoveryCollectorTests extends AbstractCollectorTestCase {
for (RecoveryState shardRecovery : shardRecoveries) { for (RecoveryState shardRecovery : shardRecoveries) {
assertThat(shard.getKey(), equalTo(indexName)); assertThat(shard.getKey(), equalTo(indexName));
assertThat(shardRecovery.getType(), anyOf(equalTo(RecoveryState.Type.PRIMARY_RELOCATION), equalTo(RecoveryState.Type.STORE), assertThat(shardRecovery.getType(), anyOf(equalTo(RecoveryState.Type.PRIMARY_RELOCATION),
equalTo(RecoveryState.Type.REPLICA), equalTo(RecoveryState.Type.SNAPSHOT))); equalTo(RecoveryState.Type.STORE),
equalTo(RecoveryState.Type.REPLICA),
equalTo(RecoveryState.Type.SNAPSHOT)));
} }
} }
} }

View File

@ -3,26 +3,25 @@
* or more contributor license agreements. Licensed under the Elastic License; * or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with 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.Version;
import org.elasticsearch.action.admin.indices.stats.IndexStats; import org.elasticsearch.action.admin.indices.stats.IndexStats;
import org.elasticsearch.cluster.service.ClusterService;
import org.elasticsearch.cluster.metadata.MetaData; import org.elasticsearch.cluster.metadata.MetaData;
import org.elasticsearch.cluster.service.ClusterService;
import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.index.IndexNotFoundException; 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.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.Collection;
import java.util.Iterator; import java.util.Iterator;
import java.util.List; import java.util.List;
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertHitCount; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertHitCount;
import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.greaterThan; import static org.hamcrest.Matchers.greaterThan;
@ -98,15 +97,15 @@ public class IndexStatsCollectorTests extends AbstractCollectorTestCase {
assertNotNull(monitoringDoc); assertNotNull(monitoringDoc);
assertThat(monitoringDoc, instanceOf(IndexStatsMonitoringDoc.class)); assertThat(monitoringDoc, instanceOf(IndexStatsMonitoringDoc.class));
IndexStatsMonitoringDoc indexStatsMarvelDoc = (IndexStatsMonitoringDoc) monitoringDoc; IndexStatsMonitoringDoc indexStatsMonitoringDoc = (IndexStatsMonitoringDoc) monitoringDoc;
assertThat(indexStatsMarvelDoc.getMonitoringId(), equalTo(MonitoredSystem.ES.getSystem())); assertThat(indexStatsMonitoringDoc.getMonitoringId(), equalTo(MonitoredSystem.ES.getSystem()));
assertThat(indexStatsMarvelDoc.getMonitoringVersion(), equalTo(Version.CURRENT.toString())); assertThat(indexStatsMonitoringDoc.getMonitoringVersion(), equalTo(Version.CURRENT.toString()));
assertThat(indexStatsMarvelDoc.getClusterUUID(), assertThat(indexStatsMonitoringDoc.getClusterUUID(),
equalTo(client().admin().cluster().prepareState().setMetaData(true).get().getState().metaData().clusterUUID())); equalTo(client().admin().cluster().prepareState().setMetaData(true).get().getState().metaData().clusterUUID()));
assertThat(indexStatsMarvelDoc.getTimestamp(), greaterThan(0L)); assertThat(indexStatsMonitoringDoc.getTimestamp(), greaterThan(0L));
assertThat(indexStatsMarvelDoc.getSourceNode(), notNullValue()); assertThat(indexStatsMonitoringDoc.getSourceNode(), notNullValue());
IndexStats indexStats = indexStatsMarvelDoc.getIndexStats(); IndexStats indexStats = indexStatsMonitoringDoc.getIndexStats();
assertNotNull(indexStats); assertNotNull(indexStats);
assertThat(indexStats.getIndex(), equalTo(indexName)); assertThat(indexStats.getIndex(), equalTo(indexName));
@ -158,14 +157,14 @@ public class IndexStatsCollectorTests extends AbstractCollectorTestCase {
MonitoringDoc monitoringDoc = it.next(); MonitoringDoc monitoringDoc = it.next();
assertThat(monitoringDoc, instanceOf(IndexStatsMonitoringDoc.class)); assertThat(monitoringDoc, instanceOf(IndexStatsMonitoringDoc.class));
IndexStatsMonitoringDoc indexStatsMarvelDoc = (IndexStatsMonitoringDoc) monitoringDoc; IndexStatsMonitoringDoc indexStatsMonitoringDoc = (IndexStatsMonitoringDoc) monitoringDoc;
IndexStats indexStats = indexStatsMarvelDoc.getIndexStats(); IndexStats indexStats = indexStatsMonitoringDoc.getIndexStats();
assertNotNull(indexStats); assertNotNull(indexStats);
if (indexStats.getIndex().equals(indexPrefix + i)) { if (indexStats.getIndex().equals(indexPrefix + i)) {
assertThat(indexStatsMarvelDoc.getClusterUUID(), equalTo(clusterUUID)); assertThat(indexStatsMonitoringDoc.getClusterUUID(), equalTo(clusterUUID));
assertThat(indexStatsMarvelDoc.getTimestamp(), greaterThan(0L)); assertThat(indexStatsMonitoringDoc.getTimestamp(), greaterThan(0L));
assertThat(indexStatsMarvelDoc.getSourceNode(), notNullValue()); assertThat(indexStatsMonitoringDoc.getSourceNode(), notNullValue());
assertThat(indexStats.getIndex(), equalTo(indexName)); assertThat(indexStats.getIndex(), equalTo(indexName));
assertNotNull(indexStats.getTotal().getDocs()); assertNotNull(indexStats.getTotal().getDocs());

View File

@ -3,29 +3,28 @@
* or more contributor license agreements. Licensed under the Elastic License; * or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with 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.Version;
import org.elasticsearch.action.admin.indices.stats.IndexStats; import org.elasticsearch.action.admin.indices.stats.IndexStats;
import org.elasticsearch.action.admin.indices.stats.IndicesStatsResponse; import org.elasticsearch.action.admin.indices.stats.IndicesStatsResponse;
import org.elasticsearch.cluster.service.ClusterService;
import org.elasticsearch.cluster.metadata.MetaData; import org.elasticsearch.cluster.metadata.MetaData;
import org.elasticsearch.cluster.service.ClusterService;
import org.elasticsearch.common.Strings; import org.elasticsearch.common.Strings;
import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.index.IndexNotFoundException; 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.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.Collection;
import java.util.List; import java.util.List;
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertHitCount; 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.equalTo;
import static org.hamcrest.Matchers.greaterThan; import static org.hamcrest.Matchers.greaterThan;
import static org.hamcrest.Matchers.hasSize; import static org.hamcrest.Matchers.hasSize;
@ -81,6 +80,7 @@ public class IndicesStatsCollectorTests extends AbstractCollectorTestCase {
createIndex(indexName); createIndex(indexName);
securedEnsureGreen(indexName); securedEnsureGreen(indexName);
final int nbDocs = randomIntBetween(1, 20); final int nbDocs = randomIntBetween(1, 20);
for (int i = 0; i < nbDocs; i++) { for (int i = 0; i < nbDocs; i++) {
client().prepareIndex(indexName, "test").setSource("num", i).get(); client().prepareIndex(indexName, "test").setSource("num", i).get();
@ -97,18 +97,18 @@ public class IndicesStatsCollectorTests extends AbstractCollectorTestCase {
MonitoringDoc monitoringDoc = results.iterator().next(); MonitoringDoc monitoringDoc = results.iterator().next();
assertThat(monitoringDoc, instanceOf(IndicesStatsMonitoringDoc.class)); assertThat(monitoringDoc, instanceOf(IndicesStatsMonitoringDoc.class));
IndicesStatsMonitoringDoc indicesStatsMarvelDoc = (IndicesStatsMonitoringDoc) monitoringDoc; IndicesStatsMonitoringDoc indicesStatsMonitoringDoc = (IndicesStatsMonitoringDoc) monitoringDoc;
assertThat(indicesStatsMarvelDoc.getClusterUUID(), equalTo(client().admin().cluster(). assertThat(indicesStatsMonitoringDoc.getClusterUUID(), equalTo(client().admin().cluster().
prepareState().setMetaData(true).get().getState().metaData().clusterUUID())); prepareState().setMetaData(true).get().getState().metaData().clusterUUID()));
assertThat(indicesStatsMarvelDoc.getTimestamp(), greaterThan(0L)); assertThat(indicesStatsMonitoringDoc.getTimestamp(), greaterThan(0L));
assertThat(indicesStatsMarvelDoc.getSourceNode(), notNullValue()); assertThat(indicesStatsMonitoringDoc.getSourceNode(), notNullValue());
IndicesStatsResponse indicesStats = indicesStatsMarvelDoc.getIndicesStats(); IndicesStatsResponse indicesStats = indicesStatsMonitoringDoc.getIndicesStats();
assertNotNull(indicesStats); assertNotNull(indicesStats);
assertThat(indicesStats.getIndices().keySet(), hasSize(1)); assertThat(indicesStats.getIndices().keySet(), hasSize(1));
IndexStats indexStats = indicesStats.getIndex(indexName); 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 { public void testIndicesStatsCollectorMultipleIndices() throws Exception {
@ -143,14 +143,14 @@ public class IndicesStatsCollectorTests extends AbstractCollectorTestCase {
MonitoringDoc monitoringDoc = results.iterator().next(); MonitoringDoc monitoringDoc = results.iterator().next();
assertThat(monitoringDoc, instanceOf(IndicesStatsMonitoringDoc.class)); assertThat(monitoringDoc, instanceOf(IndicesStatsMonitoringDoc.class));
IndicesStatsMonitoringDoc indicesStatsMarvelDoc = (IndicesStatsMonitoringDoc) monitoringDoc; IndicesStatsMonitoringDoc indicesStatsMonitoringDoc = (IndicesStatsMonitoringDoc) monitoringDoc;
assertThat(indicesStatsMarvelDoc.getMonitoringId(), equalTo(MonitoredSystem.ES.getSystem())); assertThat(indicesStatsMonitoringDoc.getMonitoringId(), equalTo(MonitoredSystem.ES.getSystem()));
assertThat(indicesStatsMarvelDoc.getMonitoringVersion(), equalTo(Version.CURRENT.toString())); assertThat(indicesStatsMonitoringDoc.getMonitoringVersion(), equalTo(Version.CURRENT.toString()));
assertThat(indicesStatsMarvelDoc.getClusterUUID(), assertThat(indicesStatsMonitoringDoc.getClusterUUID(),
equalTo(client().admin().cluster().prepareState().setMetaData(true).get().getState().metaData().clusterUUID())); 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); assertNotNull(indicesStats);
assertThat(indicesStats.getIndices().keySet(), hasSize(nbIndices)); assertThat(indicesStats.getIndices().keySet(), hasSize(nbIndices));
} }

View File

@ -3,21 +3,21 @@
* or more contributor license agreements. Licensed under the Elastic License; * or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with 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.Version;
import org.elasticsearch.bootstrap.BootstrapInfo; import org.elasticsearch.bootstrap.BootstrapInfo;
import org.elasticsearch.cluster.service.ClusterService;
import org.elasticsearch.cluster.routing.allocation.decider.DiskThresholdDecider; import org.elasticsearch.cluster.routing.allocation.decider.DiskThresholdDecider;
import org.elasticsearch.cluster.service.ClusterService;
import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.env.NodeEnvironment; 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.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; import java.util.Collection;
@ -44,22 +44,22 @@ public class NodeStatsCollectorTests extends AbstractCollectorTestCase {
assertNotNull(monitoringDoc); assertNotNull(monitoringDoc);
assertThat(monitoringDoc, instanceOf(NodeStatsMonitoringDoc.class)); assertThat(monitoringDoc, instanceOf(NodeStatsMonitoringDoc.class));
NodeStatsMonitoringDoc nodeStatsMarvelDoc = (NodeStatsMonitoringDoc) monitoringDoc; NodeStatsMonitoringDoc nodeStatsMonitoringDoc = (NodeStatsMonitoringDoc) monitoringDoc;
assertThat(nodeStatsMarvelDoc.getMonitoringId(), equalTo(MonitoredSystem.ES.getSystem())); assertThat(nodeStatsMonitoringDoc.getMonitoringId(), equalTo(MonitoredSystem.ES.getSystem()));
assertThat(nodeStatsMarvelDoc.getMonitoringVersion(), equalTo(Version.CURRENT.toString())); assertThat(nodeStatsMonitoringDoc.getMonitoringVersion(), equalTo(Version.CURRENT.toString()));
assertThat(nodeStatsMarvelDoc.getClusterUUID(), assertThat(nodeStatsMonitoringDoc.getClusterUUID(),
equalTo(client().admin().cluster().prepareState().setMetaData(true).get().getState().metaData().clusterUUID())); equalTo(client().admin().cluster().prepareState().setMetaData(true).get().getState().metaData().clusterUUID()));
assertThat(nodeStatsMarvelDoc.getTimestamp(), greaterThan(0L)); assertThat(nodeStatsMonitoringDoc.getTimestamp(), greaterThan(0L));
assertThat(nodeStatsMarvelDoc.getSourceNode(), notNullValue()); assertThat(nodeStatsMonitoringDoc.getSourceNode(), notNullValue());
assertThat(nodeStatsMarvelDoc.getNodeId(), assertThat(nodeStatsMonitoringDoc.getNodeId(),
equalTo(internalCluster().getInstance(ClusterService.class, node).localNode().getId())); equalTo(internalCluster().getInstance(ClusterService.class, node).localNode().getId()));
assertThat(nodeStatsMarvelDoc.isNodeMaster(), equalTo(node.equals(internalCluster().getMasterName()))); assertThat(nodeStatsMonitoringDoc.isNodeMaster(), equalTo(node.equals(internalCluster().getMasterName())));
assertThat(nodeStatsMarvelDoc.isMlockall(), equalTo(BootstrapInfo.isMemoryLocked())); assertThat(nodeStatsMonitoringDoc.isMlockall(), equalTo(BootstrapInfo.isMemoryLocked()));
assertNotNull(nodeStatsMarvelDoc.isDiskThresholdDeciderEnabled()); assertNotNull(nodeStatsMonitoringDoc.isDiskThresholdDeciderEnabled());
assertNotNull(nodeStatsMarvelDoc.getDiskThresholdWaterMarkHigh()); assertNotNull(nodeStatsMonitoringDoc.getDiskThresholdWaterMarkHigh());
assertNotNull(nodeStatsMarvelDoc.getNodeStats()); assertNotNull(nodeStatsMonitoringDoc.getNodeStats());
} }
} }

View File

@ -3,18 +3,18 @@
* or more contributor license agreements. Licensed under the Elastic License; * or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with 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.Version;
import org.elasticsearch.cluster.service.ClusterService;
import org.elasticsearch.cluster.ClusterState; import org.elasticsearch.cluster.ClusterState;
import org.elasticsearch.cluster.routing.ShardRouting; import org.elasticsearch.cluster.routing.ShardRouting;
import org.elasticsearch.cluster.service.ClusterService;
import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.marvel.MonitoringSettings; import org.elasticsearch.xpack.monitoring.MonitoredSystem;
import org.elasticsearch.marvel.MonitoredSystem; import org.elasticsearch.xpack.monitoring.MonitoringLicensee;
import org.elasticsearch.marvel.agent.collector.AbstractCollectorTestCase; import org.elasticsearch.xpack.monitoring.MonitoringSettings;
import org.elasticsearch.marvel.agent.exporter.MonitoringDoc; import org.elasticsearch.xpack.monitoring.agent.collector.AbstractCollectorTestCase;
import org.elasticsearch.marvel.MonitoringLicensee; import org.elasticsearch.xpack.monitoring.agent.exporter.MonitoringDoc;
import java.util.Collection; import java.util.Collection;
@ -67,17 +67,17 @@ public class ShardsCollectorTests extends AbstractCollectorTestCase {
assertNotNull(monitoringDoc); assertNotNull(monitoringDoc);
assertThat(monitoringDoc, instanceOf(ShardMonitoringDoc.class)); assertThat(monitoringDoc, instanceOf(ShardMonitoringDoc.class));
ShardMonitoringDoc shardMarvelDoc = (ShardMonitoringDoc) monitoringDoc; ShardMonitoringDoc shardMonitoringDoc = (ShardMonitoringDoc) monitoringDoc;
assertThat(shardMarvelDoc.getMonitoringId(), equalTo(MonitoredSystem.ES.getSystem())); assertThat(shardMonitoringDoc.getMonitoringId(), equalTo(MonitoredSystem.ES.getSystem()));
assertThat(shardMarvelDoc.getMonitoringVersion(), equalTo(Version.CURRENT.toString())); assertThat(shardMonitoringDoc.getMonitoringVersion(), equalTo(Version.CURRENT.toString()));
assertThat(shardMarvelDoc.getClusterUUID(), equalTo(clusterState.metaData().clusterUUID())); assertThat(shardMonitoringDoc.getClusterUUID(), equalTo(clusterState.metaData().clusterUUID()));
assertThat(shardMarvelDoc.getTimestamp(), greaterThan(0L)); assertThat(shardMonitoringDoc.getTimestamp(), greaterThan(0L));
assertThat(shardMarvelDoc.getSourceNode(), notNullValue()); assertThat(shardMonitoringDoc.getSourceNode(), notNullValue());
assertThat(shardMarvelDoc.getClusterStateUUID(), equalTo(clusterState.stateUUID())); assertThat(shardMonitoringDoc.getClusterStateUUID(), equalTo(clusterState.stateUUID()));
ShardRouting shardRouting = shardMarvelDoc.getShardRouting(); ShardRouting shardRouting = shardMonitoringDoc.getShardRouting();
assertNotNull(shardRouting); assertNotNull(shardRouting);
assertThat(shardMarvelDoc.getShardRouting().assignedToNode(), is(true)); assertThat(shardMonitoringDoc.getShardRouting().assignedToNode(), is(true));
if (shardRouting.primary()) { if (shardRouting.primary()) {
primaries++; 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]; int[] shards = new int[nbIndices];
for (MonitoringDoc monitoringDoc : results) { for (MonitoringDoc monitoringDoc : results) {
ShardRouting routing = ((ShardMonitoringDoc) monitoringDoc).getShardRouting(); ShardRouting routing = ((ShardMonitoringDoc) monitoringDoc).getShardRouting();

View File

@ -3,17 +3,17 @@
* or more contributor license agreements. Licensed under the Elastic License; * or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with 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.Version;
import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.bytes.BytesReference;
import org.elasticsearch.common.settings.Settings; 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.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.io.IOException;
import java.util.Map; import java.util.Map;
@ -23,7 +23,7 @@ import static org.elasticsearch.test.ESIntegTestCase.Scope.TEST;
import static org.hamcrest.Matchers.notNullValue; import static org.hamcrest.Matchers.notNullValue;
@ClusterScope(scope = TEST, numDataNodes = 0, numClientNodes = 0, transportClientRatio = 0.0) @ClusterScope(scope = TEST, numDataNodes = 0, numClientNodes = 0, transportClientRatio = 0.0)
public abstract class AbstractExporterTemplateTestCase extends MarvelIntegTestCase { public abstract class AbstractExporterTemplateTestCase extends MonitoringIntegTestCase {
@Override @Override
protected Settings nodeSettings(int nodeOrdinal) { protected Settings nodeSettings(int nodeOrdinal) {
@ -127,18 +127,18 @@ public abstract class AbstractExporterTemplateTestCase extends MarvelIntegTestCa
} }
private String dataTemplateName() { private String dataTemplateName() {
MockDataIndexNameResolver resolver = new MockDataIndexNameResolver(MarvelTemplateUtils.TEMPLATE_VERSION); MockDataIndexNameResolver resolver = new MockDataIndexNameResolver(MonitoringTemplateUtils.TEMPLATE_VERSION);
return resolver.templateName(); return resolver.templateName();
} }
private String indexTemplateName() { private String indexTemplateName() {
MockTimestampedIndexNameResolver resolver = MockTimestampedIndexNameResolver resolver =
new MockTimestampedIndexNameResolver(MonitoredSystem.ES, exporterSettings(), MarvelTemplateUtils.TEMPLATE_VERSION); new MockTimestampedIndexNameResolver(MonitoredSystem.ES, exporterSettings(), MonitoringTemplateUtils.TEMPLATE_VERSION);
return resolver.templateName(); return resolver.templateName();
} }
private String currentDataIndexName() { private String currentDataIndexName() {
MockDataIndexNameResolver resolver = new MockDataIndexNameResolver(MarvelTemplateUtils.TEMPLATE_VERSION); MockDataIndexNameResolver resolver = new MockDataIndexNameResolver(MonitoringTemplateUtils.TEMPLATE_VERSION);
return resolver.index(null); return resolver.index(null);
} }
@ -147,7 +147,7 @@ public abstract class AbstractExporterTemplateTestCase extends MarvelIntegTestCa
doc.setTimestamp(System.currentTimeMillis()); doc.setTimestamp(System.currentTimeMillis());
MockTimestampedIndexNameResolver resolver = MockTimestampedIndexNameResolver resolver =
new MockTimestampedIndexNameResolver(MonitoredSystem.ES, exporterSettings(), MarvelTemplateUtils.TEMPLATE_VERSION); new MockTimestampedIndexNameResolver(MonitoredSystem.ES, exporterSettings(), MonitoringTemplateUtils.TEMPLATE_VERSION);
return resolver.index(doc); return resolver.index(doc);
} }

View File

@ -3,7 +3,7 @@
* or more contributor license agreements. Licensed under the Elastic License; * or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with 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.Version;
import org.elasticsearch.client.Client; 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.Settings;
import org.elasticsearch.common.settings.SettingsException; import org.elasticsearch.common.settings.SettingsException;
import org.elasticsearch.common.util.concurrent.AbstractRunnable; 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.test.ESTestCase;
import org.elasticsearch.xpack.common.init.proxy.ClientProxy; 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 org.junit.Before;
import java.util.ArrayList; import java.util.ArrayList;

View File

@ -3,7 +3,7 @@
* or more contributor license agreements. Licensed under the Elastic License; * or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with 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.Version;
import org.elasticsearch.cluster.node.DiscoveryNode; import org.elasticsearch.cluster.node.DiscoveryNode;

Some files were not shown because too many files have changed in this diff Show More