diff --git a/.gitignore b/.gitignore index bd1eae1f3de7..1dbf51c85a4f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,15 +1,15 @@ /work -/exporter/logs .idea -/exporter/data -/exporter/target +/agent/logs +/agent/data +/agent/target +/agent/.project +/agent/.classpath +/agent/.settings +/agent/config +/agent/lib .DS_Store *.iml -/exporter/.project -/exporter/.classpath -/exporter/.settings -/exporter/config -/exporter/lib /kibana/vendor/kibana /node_modules /build diff --git a/exporter/pom.xml b/agent/pom.xml similarity index 100% rename from exporter/pom.xml rename to agent/pom.xml diff --git a/exporter/src/main/assemblies/plugin.xml b/agent/src/main/assemblies/plugin.xml similarity index 100% rename from exporter/src/main/assemblies/plugin.xml rename to agent/src/main/assemblies/plugin.xml diff --git a/exporter/src/main/java/org/elasticsearch/marvel/collector/CollectorService.java b/agent/src/main/java/org/elasticsearch/marvel/agent/AgentService.java similarity index 95% rename from exporter/src/main/java/org/elasticsearch/marvel/collector/CollectorService.java rename to agent/src/main/java/org/elasticsearch/marvel/agent/AgentService.java index 7e2c5a971a67..9d7a1b764501 100644 --- a/exporter/src/main/java/org/elasticsearch/marvel/collector/CollectorService.java +++ b/agent/src/main/java/org/elasticsearch/marvel/agent/AgentService.java @@ -1,4 +1,4 @@ -package org.elasticsearch.marvel.collector; +package org.elasticsearch.marvel.agent; /* * Licensed to ElasticSearch under one * or more contributor license agreements. See the NOTICE file @@ -53,9 +53,9 @@ import org.elasticsearch.index.shard.service.IndexShard; import org.elasticsearch.indices.IndicesLifecycle; import org.elasticsearch.indices.IndicesService; import org.elasticsearch.indices.InternalIndicesService; -import org.elasticsearch.marvel.collector.event.*; -import org.elasticsearch.marvel.collector.exporter.ESExporter; -import org.elasticsearch.marvel.collector.exporter.Exporter; +import org.elasticsearch.marvel.agent.event.*; +import org.elasticsearch.marvel.agent.exporter.ESExporter; +import org.elasticsearch.marvel.agent.exporter.Exporter; import org.elasticsearch.node.service.NodeService; import java.util.ArrayList; @@ -65,7 +65,7 @@ import java.util.concurrent.BlockingQueue; import static org.elasticsearch.common.collect.Lists.newArrayList; -public class CollectorService extends AbstractLifecycleComponent { +public class AgentService extends AbstractLifecycleComponent { private final InternalIndicesService indicesService; private final NodeService nodeService; @@ -87,10 +87,10 @@ public class CollectorService extends AbstractLifecycleComponent pendingEventsQueue; @Inject - public CollectorService(Settings settings, IndicesService indicesService, - NodeService nodeService, ClusterService clusterService, - Client client, Discovery discovery, ClusterName clusterName, - Environment environment, Plugin marvelPlugin) { + public AgentService(Settings settings, IndicesService indicesService, + NodeService nodeService, ClusterService clusterService, + Client client, Discovery discovery, ClusterName clusterName, + Environment environment, Plugin marvelPlugin) { super(settings); this.indicesService = (InternalIndicesService) indicesService; this.clusterService = clusterService; @@ -122,7 +122,7 @@ public class CollectorService extends AbstractLifecycleComponent eventList = new ArrayList(pendingEventsQueue.size()); pendingEventsQueue.drainTo(eventList); Event[] events = new Event[eventList.size()]; @@ -229,7 +229,7 @@ public class CollectorService extends AbstractLifecycleComponent> services() { Collection> l = new ArrayList>(); if (enabled) { - l.add(CollectorService.class); + l.add(AgentService.class); } return l; } diff --git a/exporter/src/main/java/org/elasticsearch/marvel/collector/Utils.java b/agent/src/main/java/org/elasticsearch/marvel/agent/Utils.java similarity index 98% rename from exporter/src/main/java/org/elasticsearch/marvel/collector/Utils.java rename to agent/src/main/java/org/elasticsearch/marvel/agent/Utils.java index 5f9ee8cf8ae7..4356385d5303 100644 --- a/exporter/src/main/java/org/elasticsearch/marvel/collector/Utils.java +++ b/agent/src/main/java/org/elasticsearch/marvel/agent/Utils.java @@ -1,4 +1,4 @@ -package org.elasticsearch.marvel.collector; +package org.elasticsearch.marvel.agent; /* * Licensed to ElasticSearch under one * or more contributor license agreements. See the NOTICE file diff --git a/exporter/src/main/java/org/elasticsearch/marvel/collector/event/ClusterEvent.java b/agent/src/main/java/org/elasticsearch/marvel/agent/event/ClusterEvent.java similarity index 98% rename from exporter/src/main/java/org/elasticsearch/marvel/collector/event/ClusterEvent.java rename to agent/src/main/java/org/elasticsearch/marvel/agent/event/ClusterEvent.java index 296c2ec25b74..52149951ea97 100644 --- a/exporter/src/main/java/org/elasticsearch/marvel/collector/event/ClusterEvent.java +++ b/agent/src/main/java/org/elasticsearch/marvel/agent/event/ClusterEvent.java @@ -1,4 +1,4 @@ -package org.elasticsearch.marvel.collector.event; +package org.elasticsearch.marvel.agent.event; /* * Licensed to ElasticSearch under one * or more contributor license agreements. See the NOTICE file diff --git a/exporter/src/main/java/org/elasticsearch/marvel/collector/event/Event.java b/agent/src/main/java/org/elasticsearch/marvel/agent/event/Event.java similarity index 97% rename from exporter/src/main/java/org/elasticsearch/marvel/collector/event/Event.java rename to agent/src/main/java/org/elasticsearch/marvel/agent/event/Event.java index 07a39a95e045..44f4636f0212 100644 --- a/exporter/src/main/java/org/elasticsearch/marvel/collector/event/Event.java +++ b/agent/src/main/java/org/elasticsearch/marvel/agent/event/Event.java @@ -1,4 +1,4 @@ -package org.elasticsearch.marvel.collector.event; +package org.elasticsearch.marvel.agent.event; /* * Licensed to ElasticSearch under one * or more contributor license agreements. See the NOTICE file diff --git a/exporter/src/main/java/org/elasticsearch/marvel/collector/event/IndexEvent.java b/agent/src/main/java/org/elasticsearch/marvel/agent/event/IndexEvent.java similarity index 98% rename from exporter/src/main/java/org/elasticsearch/marvel/collector/event/IndexEvent.java rename to agent/src/main/java/org/elasticsearch/marvel/agent/event/IndexEvent.java index 48ae40e164fc..71851df24201 100644 --- a/exporter/src/main/java/org/elasticsearch/marvel/collector/event/IndexEvent.java +++ b/agent/src/main/java/org/elasticsearch/marvel/agent/event/IndexEvent.java @@ -1,4 +1,4 @@ -package org.elasticsearch.marvel.collector.event; +package org.elasticsearch.marvel.agent.event; /* * Licensed to ElasticSearch under one * or more contributor license agreements. See the NOTICE file diff --git a/exporter/src/main/java/org/elasticsearch/marvel/collector/event/NodeEvent.java b/agent/src/main/java/org/elasticsearch/marvel/agent/event/NodeEvent.java similarity index 97% rename from exporter/src/main/java/org/elasticsearch/marvel/collector/event/NodeEvent.java rename to agent/src/main/java/org/elasticsearch/marvel/agent/event/NodeEvent.java index a2ba00c1d355..3e15804af81b 100644 --- a/exporter/src/main/java/org/elasticsearch/marvel/collector/event/NodeEvent.java +++ b/agent/src/main/java/org/elasticsearch/marvel/agent/event/NodeEvent.java @@ -1,4 +1,4 @@ -package org.elasticsearch.marvel.collector.event; +package org.elasticsearch.marvel.agent.event; /* * Licensed to ElasticSearch under one * or more contributor license agreements. See the NOTICE file @@ -22,7 +22,7 @@ package org.elasticsearch.marvel.collector.event; import org.elasticsearch.cluster.node.DiscoveryNode; import org.elasticsearch.common.xcontent.ToXContent; import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.marvel.collector.Utils; +import org.elasticsearch.marvel.agent.Utils; import java.io.IOException; diff --git a/exporter/src/main/java/org/elasticsearch/marvel/collector/event/RoutingEvent.java b/agent/src/main/java/org/elasticsearch/marvel/agent/event/RoutingEvent.java similarity index 98% rename from exporter/src/main/java/org/elasticsearch/marvel/collector/event/RoutingEvent.java rename to agent/src/main/java/org/elasticsearch/marvel/agent/event/RoutingEvent.java index 4017676fcc3b..8bbbd107be4f 100644 --- a/exporter/src/main/java/org/elasticsearch/marvel/collector/event/RoutingEvent.java +++ b/agent/src/main/java/org/elasticsearch/marvel/agent/event/RoutingEvent.java @@ -1,4 +1,4 @@ -package org.elasticsearch.marvel.collector.event; +package org.elasticsearch.marvel.agent.event; /* * Licensed to ElasticSearch under one * or more contributor license agreements. See the NOTICE file @@ -23,7 +23,7 @@ import org.elasticsearch.cluster.node.DiscoveryNode; import org.elasticsearch.cluster.routing.ShardRouting; import org.elasticsearch.common.xcontent.ToXContent; import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.marvel.collector.Utils; +import org.elasticsearch.marvel.agent.Utils; import java.io.IOException; diff --git a/exporter/src/main/java/org/elasticsearch/marvel/collector/event/ShardEvent.java b/agent/src/main/java/org/elasticsearch/marvel/agent/event/ShardEvent.java similarity index 98% rename from exporter/src/main/java/org/elasticsearch/marvel/collector/event/ShardEvent.java rename to agent/src/main/java/org/elasticsearch/marvel/agent/event/ShardEvent.java index af71d8b92da6..ca7ff44ccf52 100644 --- a/exporter/src/main/java/org/elasticsearch/marvel/collector/event/ShardEvent.java +++ b/agent/src/main/java/org/elasticsearch/marvel/agent/event/ShardEvent.java @@ -1,4 +1,4 @@ -package org.elasticsearch.marvel.collector.event; +package org.elasticsearch.marvel.agent.event; /* * Licensed to ElasticSearch under one * or more contributor license agreements. See the NOTICE file @@ -25,7 +25,7 @@ import org.elasticsearch.common.xcontent.ToXContent; import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.index.shard.IndexShardState; import org.elasticsearch.index.shard.ShardId; -import org.elasticsearch.marvel.collector.Utils; +import org.elasticsearch.marvel.agent.Utils; import java.io.IOException; import java.util.Locale; diff --git a/exporter/src/main/java/org/elasticsearch/marvel/collector/exporter/ESExporter.java b/agent/src/main/java/org/elasticsearch/marvel/agent/exporter/ESExporter.java similarity index 99% rename from exporter/src/main/java/org/elasticsearch/marvel/collector/exporter/ESExporter.java rename to agent/src/main/java/org/elasticsearch/marvel/agent/exporter/ESExporter.java index 153ef1228673..4224c607ec86 100644 --- a/exporter/src/main/java/org/elasticsearch/marvel/collector/exporter/ESExporter.java +++ b/agent/src/main/java/org/elasticsearch/marvel/agent/exporter/ESExporter.java @@ -1,4 +1,4 @@ -package org.elasticsearch.marvel.collector.exporter; +package org.elasticsearch.marvel.agent.exporter; /* * Licensed to ElasticSearch under one * or more contributor license agreements. See the NOTICE file @@ -41,9 +41,9 @@ import org.elasticsearch.common.xcontent.json.JsonXContent; import org.elasticsearch.common.xcontent.smile.SmileXContent; import org.elasticsearch.discovery.Discovery; import org.elasticsearch.env.Environment; -import org.elasticsearch.marvel.collector.Plugin; -import org.elasticsearch.marvel.collector.Utils; -import org.elasticsearch.marvel.collector.event.Event; +import org.elasticsearch.marvel.agent.Plugin; +import org.elasticsearch.marvel.agent.Utils; +import org.elasticsearch.marvel.agent.event.Event; import java.io.*; import java.net.HttpURLConnection; diff --git a/exporter/src/main/java/org/elasticsearch/marvel/collector/exporter/Exporter.java b/agent/src/main/java/org/elasticsearch/marvel/agent/exporter/Exporter.java similarity index 93% rename from exporter/src/main/java/org/elasticsearch/marvel/collector/exporter/Exporter.java rename to agent/src/main/java/org/elasticsearch/marvel/agent/exporter/Exporter.java index edaebc202f6e..2275e12f7ca4 100644 --- a/exporter/src/main/java/org/elasticsearch/marvel/collector/exporter/Exporter.java +++ b/agent/src/main/java/org/elasticsearch/marvel/agent/exporter/Exporter.java @@ -1,4 +1,4 @@ -package org.elasticsearch.marvel.collector.exporter; +package org.elasticsearch.marvel.agent.exporter; /* * Licensed to ElasticSearch under one * or more contributor license agreements. See the NOTICE file @@ -24,7 +24,7 @@ import org.elasticsearch.action.admin.cluster.stats.ClusterStatsResponse; import org.elasticsearch.action.admin.indices.stats.IndicesStatsResponse; import org.elasticsearch.action.admin.indices.stats.ShardStats; import org.elasticsearch.common.component.LifecycleComponent; -import org.elasticsearch.marvel.collector.event.Event; +import org.elasticsearch.marvel.agent.event.Event; public interface Exporter extends LifecycleComponent { diff --git a/agent/src/main/resources/es-plugin.properties b/agent/src/main/resources/es-plugin.properties new file mode 100644 index 000000000000..4b1e43f7343c --- /dev/null +++ b/agent/src/main/resources/es-plugin.properties @@ -0,0 +1 @@ +plugin=org.elasticsearch.marvel.agent.Plugin \ No newline at end of file diff --git a/agent/src/main/resources/marvel_index_template.json b/agent/src/main/resources/marvel_index_template.json new file mode 100644 index 000000000000..32b55dd0a802 --- /dev/null +++ b/agent/src/main/resources/marvel_index_template.json @@ -0,0 +1,96 @@ +{ + "template": ".marvel*", + "settings": { + "number_of_shards": 1, + "number_of_replicas": 1, + "analysis": { + "analyzer": { + "default": { + "type": "standard", + "stopwords": "_none_" + } + } + } + }, + "mappings": { + "_default_": { + "dynamic_templates": [ + { + "string_fields": { + "match": "*", + "match_mapping_type": "string", + "mapping": { + "type": "multi_field", + "fields": { + "{name}": { + "type": "string", + "index": "analyzed", + "omit_norms": true + }, + "raw": { + "type": "string", + "index": "not_analyzed", + "ignore_above": 256 + } + } + } + } + } + ] + }, + "node_stats": { + "properties": { + "indices.percolate.size_in_bytes": { + "type": "long" + }, + "jvm.buffer_pools.direct.used_in_bytes": { + "type": "long" + }, + "jvm.buffer_pools.mapped.used_in_bytes": { + "type": "long" + }, + "jvm.gc.collectors.young.collection_count": { + "type": "long" + }, + "jvm.gc.collectors.young.collection_time_in_millis": { + "type": "long" + }, + "jvm.gc.collectors.old.collection_count": { + "type": "long" + }, + "jvm.gc.collectors.old.collection_time_in_millis": { + "type": "long" + }, + "indices.percolate.total": { + "type": "long" + }, + "indices.percolate.time_in_millis": { + "type": "long" + }, + "indices.percolate.queries": { + "type": "long" + }, + "indices.percolate.memory_size_in_bytes": { + "type": "long" + } + } + }, + "index_stats": { + "properties": { + "total.percolate.memory_size_in_bytes": { + "type": "long" + }, + "total.percolate.time_in_millis": { + "type": "long" + }, + "total.percolate.queries": { + "type": "long" + }, + "total.percolate.total": { + "type": "long" + } + } + } + + } +} \ No newline at end of file diff --git a/exporter/src/main/resources/es-plugin.properties b/exporter/src/main/resources/es-plugin.properties deleted file mode 100644 index 057da05b8a09..000000000000 --- a/exporter/src/main/resources/es-plugin.properties +++ /dev/null @@ -1 +0,0 @@ -plugin=org.elasticsearch.marvel.collector.Plugin \ No newline at end of file diff --git a/exporter/src/main/resources/marvel_index_template.json b/exporter/src/main/resources/marvel_index_template.json deleted file mode 100644 index c91f5cbe8b92..000000000000 --- a/exporter/src/main/resources/marvel_index_template.json +++ /dev/null @@ -1,56 +0,0 @@ -{ - "template": ".marvel*", - "settings" : { - "number_of_shards": 1, - "number_of_replicas": 1, - "analysis" : { - "analyzer" : { - "default" : { - "type" : "standard", - "stopwords" : "_none_" - } - } - } - }, - "mappings" : { - "_default_" : { - "dynamic_templates" : [ { - "string_fields" : { - "match" : "*", - "match_mapping_type" : "string", - "mapping" : { - "type" : "multi_field", - "fields" : { - "{name}" : {"type": "string", "index" : "analyzed", "omit_norms" : true }, - "raw" : {"type": "string", "index" : "not_analyzed", "ignore_above" : 256} - } - } - } - } ] - }, - "node_stats": { - "properties": { - "indices.percolate.size_in_bytes": { "type": "long"}, - "jvm.buffer_pools.direct.used_in_bytes": { "type": "long" }, - "jvm.buffer_pools.mapped.used_in_bytes": { "type": "long" }, - "jvm.gc.collectors.young.collection_count": { "type": "long" }, - "jvm.gc.collectors.young.collection_time_in_millis": { "type": "long" }, - "jvm.gc.collectors.old.collection_count": { "type": "long" }, - "jvm.gc.collectors.old.collection_time_in_millis": { "type": "long" }, - "indices.percolate.total": { "type": "long" }, - "indices.percolate.time_in_millis": { "type": "long" }, - "indices.percolate.queries": { "type": "long" }, - "indices.percolate.memory_size_in_bytes": { "type": "long"} - } - }, - "index_stats": { - "properties": { - "total.percolate.memory_size_in_bytes": { "type": "long" }, - "total.percolate.time_in_millis": { "type": "long" }, - "total.percolate.queries": { "type": "long" }, - "total.percolate.total": { "type": "long" } - } - } - - } -} \ No newline at end of file