Skip to content
This repository has been archived by the owner on Mar 31, 2024. It is now read-only.

Commit

Permalink
Rename package name from marvel.collector to marvel.agent. Also r…
Browse files Browse the repository at this point in the history
…enamed `CollectorService` to `AgentService`

Closes elastic#37
  • Loading branch information
bleskes committed Jan 22, 2014
1 parent 5ecff51 commit 524f407
Show file tree
Hide file tree
Showing 18 changed files with 137 additions and 97 deletions.
16 changes: 8 additions & 8 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -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
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -53,9 +53,9 @@
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;
Expand All @@ -65,7 +65,7 @@

import static org.elasticsearch.common.collect.Lists.newArrayList;

public class CollectorService extends AbstractLifecycleComponent<CollectorService> {
public class AgentService extends AbstractLifecycleComponent<AgentService> {

private final InternalIndicesService indicesService;
private final NodeService nodeService;
Expand All @@ -87,10 +87,10 @@ public class CollectorService extends AbstractLifecycleComponent<CollectorServic
private final BlockingQueue<Event> 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;
Expand Down Expand Up @@ -122,7 +122,7 @@ protected void doStart() {
e.start();

this.exp = new ExportingWorker();
this.thread = new Thread(exp, EsExecutors.threadName(settings, "collector"));
this.thread = new Thread(exp, EsExecutors.threadName(settings, "marvel.exporters"));
this.thread.setDaemon(true);
this.thread.start();

Expand Down Expand Up @@ -213,13 +213,13 @@ private void exportClusterStats() {
try {
e.exportClusterStats(stats);
} catch (Throwable t) {
logger.error("Exporter [{}] has thrown an exception:", t, e.name());
logger.error("exporter [{}] has thrown an exception:", t, e.name());
}
}
}

private void exportEvents() {
logger.debug("Exporting events");
logger.debug("exporting events");
ArrayList<Event> eventList = new ArrayList<Event>(pendingEventsQueue.size());
pendingEventsQueue.drainTo(eventList);
Event[] events = new Event[eventList.size()];
Expand All @@ -229,7 +229,7 @@ private void exportEvents() {
try {
e.exportEvents(events);
} catch (Throwable t) {
logger.error("Exporter [{}] has thrown an exception:", t, e.name());
logger.error("exporter [{}] has thrown an exception:", t, e.name());
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* under the License.
*/

package org.elasticsearch.marvel.collector;
package org.elasticsearch.marvel.agent;

import org.elasticsearch.Version;
import org.elasticsearch.common.collect.ImmutableList;
Expand Down Expand Up @@ -69,7 +69,7 @@ public Collection<Module> modules(Settings settings) {

@Override
protected void configure() {
bind(CollectorService.class).asEagerSingleton();
bind(AgentService.class).asEagerSingleton();
}
};
return ImmutableList.of(m);
Expand All @@ -79,7 +79,7 @@ protected void configure() {
public Collection<Class<? extends LifecycleComponent>> services() {
Collection<Class<? extends LifecycleComponent>> l = new ArrayList<Class<? extends LifecycleComponent>>();
if (enabled) {
l.add(CollectorService.class);
l.add(AgentService.class);
}
return l;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -22,7 +22,7 @@
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;

Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -23,7 +23,7 @@
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;

Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -25,7 +25,7 @@
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;
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -41,9 +41,9 @@
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;
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -24,7 +24,7 @@
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<T> extends LifecycleComponent<T> {

Expand Down
1 change: 1 addition & 0 deletions agent/src/main/resources/es-plugin.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
plugin=org.elasticsearch.marvel.agent.Plugin
96 changes: 96 additions & 0 deletions agent/src/main/resources/marvel_index_template.json
Original file line number Diff line number Diff line change
@@ -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"
}
}
}

}
}
1 change: 0 additions & 1 deletion exporter/src/main/resources/es-plugin.properties

This file was deleted.

56 changes: 0 additions & 56 deletions exporter/src/main/resources/marvel_index_template.json

This file was deleted.

0 comments on commit 524f407

Please sign in to comment.