Search in sources :

Example 1 with JsonUtils

use of com.googlecode.jmxtrans.util.JsonUtils in project jmxtrans by jmxtrans.

the class HeapMemory method main.

public static void main(String[] args) throws Exception {
    Injector injector = JmxTransModule.createInjector(new JmxTransConfiguration());
    JsonUtils jsonUtils = injector.getInstance(JsonUtils.class);
    JmxProcess process = jsonUtils.parseProcess(new File("heapmemory.json"));
    new JsonPrinter(System.out).print(process);
    JmxTransformer transformer = injector.getInstance(JmxTransformer.class);
    transformer.executeStandalone(process);
}
Also used : JmxTransConfiguration(com.googlecode.jmxtrans.cli.JmxTransConfiguration) JmxTransformer(com.googlecode.jmxtrans.JmxTransformer) JsonUtils(com.googlecode.jmxtrans.util.JsonUtils) Injector(com.google.inject.Injector) JmxProcess(com.googlecode.jmxtrans.model.JmxProcess) File(java.io.File)

Example 2 with JsonUtils

use of com.googlecode.jmxtrans.util.JsonUtils in project jmxtrans by jmxtrans.

the class CloudWatchWriterIT method loadingFromFile.

@Test
public void loadingFromFile() throws URISyntaxException, IOException {
    JsonUtils jsonUtils = createInjector(new JmxTransConfiguration()).getInstance(JsonUtils.class);
    File input = new File(CloudWatchWriterIT.class.getResource("/cloud-watch.json").toURI());
    JmxProcess process = jsonUtils.parseProcess(input);
    assertThat(process.getName()).isEqualTo("cloud-watch.json");
}
Also used : JmxTransConfiguration(com.googlecode.jmxtrans.cli.JmxTransConfiguration) JsonUtils(com.googlecode.jmxtrans.util.JsonUtils) JmxProcess(com.googlecode.jmxtrans.model.JmxProcess) File(java.io.File) PrepareForTest(org.powermock.core.classloader.annotations.PrepareForTest) IntegrationTest(com.googlecode.jmxtrans.test.IntegrationTest) Test(org.junit.Test)

Example 3 with JsonUtils

use of com.googlecode.jmxtrans.util.JsonUtils in project jmxtrans by jmxtrans.

the class InfluxDbWriterTests method loadingFromFile.

@Test
public void loadingFromFile() throws URISyntaxException, IOException {
    File input = new File(InfluxDbWriterTests.class.getResource("/influxDB.json").toURI());
    Injector injector = JmxTransModule.createInjector(new JmxTransConfiguration());
    JsonUtils jsonUtils = injector.getInstance(JsonUtils.class);
    JmxProcess process = jsonUtils.parseProcess(input);
    assertThat(process.getName()).isEqualTo("influxDB.json");
}
Also used : JmxTransConfiguration(com.googlecode.jmxtrans.cli.JmxTransConfiguration) JsonUtils(com.googlecode.jmxtrans.util.JsonUtils) Injector(com.google.inject.Injector) JmxProcess(com.googlecode.jmxtrans.model.JmxProcess) File(java.io.File) Test(org.junit.Test)

Example 4 with JsonUtils

use of com.googlecode.jmxtrans.util.JsonUtils in project jmxtrans by jmxtrans.

the class Local method main.

public static void main(String[] args) throws Exception {
    Injector injector = JmxTransModule.createInjector(new JmxTransConfiguration());
    JsonUtils jsonUtils = injector.getInstance(JsonUtils.class);
    JmxProcess process = jsonUtils.parseProcess(new File("local.json"));
    new JsonPrinter(System.out).print(process);
    JmxTransformer transformer = injector.getInstance(JmxTransformer.class);
    transformer.executeStandalone(process);
}
Also used : JmxTransConfiguration(com.googlecode.jmxtrans.cli.JmxTransConfiguration) JmxTransformer(com.googlecode.jmxtrans.JmxTransformer) JsonUtils(com.googlecode.jmxtrans.util.JsonUtils) Injector(com.google.inject.Injector) JmxProcess(com.googlecode.jmxtrans.model.JmxProcess) File(java.io.File)

Example 5 with JsonUtils

use of com.googlecode.jmxtrans.util.JsonUtils in project jmxtrans by jmxtrans.

the class MemoryPool method main.

public static void main(String[] args) throws Exception {
    Injector injector = JmxTransModule.createInjector(new JmxTransConfiguration());
    JsonUtils jsonUtils = injector.getInstance(JsonUtils.class);
    JmxProcess process = jsonUtils.parseProcess(new File("memorypool.json"));
    new JsonPrinter(System.out).print(process);
    JmxTransformer transformer = injector.getInstance(JmxTransformer.class);
    transformer.executeStandalone(process);
}
Also used : JmxTransConfiguration(com.googlecode.jmxtrans.cli.JmxTransConfiguration) JmxTransformer(com.googlecode.jmxtrans.JmxTransformer) JsonUtils(com.googlecode.jmxtrans.util.JsonUtils) Injector(com.google.inject.Injector) JmxProcess(com.googlecode.jmxtrans.model.JmxProcess) File(java.io.File)

Aggregations

JmxTransConfiguration (com.googlecode.jmxtrans.cli.JmxTransConfiguration)6 JsonUtils (com.googlecode.jmxtrans.util.JsonUtils)6 JmxProcess (com.googlecode.jmxtrans.model.JmxProcess)5 File (java.io.File)5 Injector (com.google.inject.Injector)4 JmxTransformer (com.googlecode.jmxtrans.JmxTransformer)3 Test (org.junit.Test)2 IntegrationTest (com.googlecode.jmxtrans.test.IntegrationTest)1 Before (org.junit.Before)1 PrepareForTest (org.powermock.core.classloader.annotations.PrepareForTest)1