Skip to content

Commit

Permalink
removing main block
Browse files Browse the repository at this point in the history
  • Loading branch information
VishakaSekar committed Jan 23, 2019
1 parent 0279aa4 commit a1d6999
Showing 1 changed file with 0 additions and 37 deletions.
37 changes: 0 additions & 37 deletions src/main/java/com/appdynamics/extensions/kafka/KafkaMonitor.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,11 @@
import com.appdynamics.extensions.kafka.utils.Constants;
import com.appdynamics.extensions.kafka.utils.SslUtils;
import com.appdynamics.extensions.util.AssertUtils;
import com.google.common.collect.Maps;
import com.singularity.ee.agent.systemagent.api.exception.TaskExecutionException;
import org.apache.log4j.ConsoleAppender;
import org.apache.log4j.Level;
import org.apache.log4j.PatternLayout;
import org.slf4j.LoggerFactory;

import java.io.File;
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.util.List;
import java.util.Map;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;

import static com.appdynamics.extensions.kafka.utils.Constants.DEFAULT_METRIC_PREFIX;

Expand Down Expand Up @@ -70,31 +60,4 @@ protected int getTaskCount () {
return servers.size();
}

public static void main(String[] args) throws TaskExecutionException, IOException {

ConsoleAppender ca = new ConsoleAppender();
ca.setWriter(new OutputStreamWriter(System.out));
ca.setLayout(new PatternLayout("%-5p [%t]: %m%n"));
ca.setThreshold(Level.DEBUG);
org.apache.log4j.Logger.getRootLogger().addAppender(ca);


KafkaMonitor monitor = new KafkaMonitor();
final Map<String, String> taskArgs = Maps.newHashMap();
taskArgs.put("config-file", "/Users/vishaka.sekar/AppDynamics/kafka-monitoring-extension/src/main/resources/conf/config.yml");
ScheduledExecutorService scheduler = Executors.newScheduledThreadPool(1);
scheduler.scheduleAtFixedRate(new Runnable() {
public void run() {
try {
monitor.execute(taskArgs, null);
} catch (Exception e) {
logger.error("Error while running the task", e);
}
}
}, 2, 60, TimeUnit.SECONDS);

}



}

0 comments on commit a1d6999

Please sign in to comment.