Search in sources :

Example 16 with JmxTransConfiguration

use of com.googlecode.jmxtrans.cli.JmxTransConfiguration in project jmxtrans by jmxtrans.

the class ConfigurationParserTest method configureParser.

@Before
public void configureParser() {
    JsonUtils jsonUtils = createInjector(new JmxTransConfiguration()).getInstance(JsonUtils.class);
    configurationParser = new ConfigurationParser(jsonUtils);
}
Also used : JmxTransConfiguration(com.googlecode.jmxtrans.cli.JmxTransConfiguration) JsonUtils(com.googlecode.jmxtrans.util.JsonUtils) Before(org.junit.Before)

Example 17 with JmxTransConfiguration

use of com.googlecode.jmxtrans.cli.JmxTransConfiguration in project jmxtrans by jmxtrans.

the class JmxTransformerIT method startJmxTrans.

@Before
public void startJmxTrans() throws LifecycleException, URISyntaxException {
    JmxTransConfiguration configuration = new JmxTransConfiguration();
    configuration.setRunPeriod(1);
    configuration.setJsonFile(file("integration-test.json"));
    Injector injector = JmxTransModule.createInjector(configuration);
    jmxTransformer = injector.getInstance(JmxTransformer.class);
    jmxTransformer.start();
}
Also used : JmxTransConfiguration(com.googlecode.jmxtrans.cli.JmxTransConfiguration) Injector(com.google.inject.Injector) Before(org.junit.Before)

Example 18 with JmxTransConfiguration

use of com.googlecode.jmxtrans.cli.JmxTransConfiguration in project jmxtrans by jmxtrans.

the class JmxTransformer method main.

public static void main(String[] args) throws Exception {
    JmxTransConfiguration configuration = new JCommanderArgumentParser().parseOptions(args);
    if (configuration.isHelp()) {
        return;
    }
    ClassLoaderEnricher enricher = new ClassLoaderEnricher();
    for (File jar : configuration.getAdditionalJars()) {
        enricher.add(jar);
    }
    Injector injector = JmxTransModule.createInjector(configuration);
    JmxTransformer transformer = injector.getInstance(JmxTransformer.class);
    // Start the process
    transformer.doMain();
}
Also used : JmxTransConfiguration(com.googlecode.jmxtrans.cli.JmxTransConfiguration) JCommanderArgumentParser(com.googlecode.jmxtrans.cli.JCommanderArgumentParser) Injector(com.google.inject.Injector) ClassLoaderEnricher(com.googlecode.jmxtrans.classloader.ClassLoaderEnricher) File(java.io.File)

Aggregations

JmxTransConfiguration (com.googlecode.jmxtrans.cli.JmxTransConfiguration)18 Injector (com.google.inject.Injector)15 JmxProcess (com.googlecode.jmxtrans.model.JmxProcess)12 JmxTransformer (com.googlecode.jmxtrans.JmxTransformer)10 File (java.io.File)7 JsonUtils (com.googlecode.jmxtrans.util.JsonUtils)6 Before (org.junit.Before)4 Server (com.googlecode.jmxtrans.model.Server)3 Test (org.junit.Test)3 Query (com.googlecode.jmxtrans.model.Query)2 GraphiteWriter (com.googlecode.jmxtrans.model.output.GraphiteWriter)2 StdOutWriter (com.googlecode.jmxtrans.model.output.StdOutWriter)2 ConfigurationParser (com.googlecode.jmxtrans.ConfigurationParser)1 ClassLoaderEnricher (com.googlecode.jmxtrans.classloader.ClassLoaderEnricher)1 JCommanderArgumentParser (com.googlecode.jmxtrans.cli.JCommanderArgumentParser)1 RRDToolWriter (com.googlecode.jmxtrans.model.output.RRDToolWriter)1 IntegrationTest (com.googlecode.jmxtrans.test.IntegrationTest)1 SuppressFBWarnings (edu.umd.cs.findbugs.annotations.SuppressFBWarnings)1 IOException (java.io.IOException)1 Date (java.util.Date)1