use of com.googlecode.jmxtrans.cli.JmxTransConfiguration 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);
}
use of com.googlecode.jmxtrans.cli.JmxTransConfiguration in project jmxtrans by jmxtrans.
the class Hibernate method main.
public static void main(String[] args) throws Exception {
JmxProcess process = new JmxProcess(Server.builder().setHost("w2").setPort("1099").setAlias("w2_hibernate_1099").addQuery(Query.builder().setObj("org.hibernate.jmx:name=*,type=StatisticsService").addAttr("EntityDeleteCount").addAttr("EntityInsertCount").addAttr("EntityLoadCount").addAttr("EntityFetchCount").addAttr("EntityUpdateCount").addAttr("QueryExecutionCount").addAttr("QueryCacheHitCount").addAttr("QueryExecutionMaxTime").addAttr("QueryCacheMissCount").addAttr("QueryCachePutCount").addAttr("FlushCount").addAttr("ConnectCount").addAttr("SecondLevelCacheHitCount").addAttr("SecondLevelCacheMissCount").addAttr("SecondLevelCachePutCount").addAttr("SessionCloseCount").addAttr("SessionOpenCount").addAttr("CollectionLoadCount").addAttr("CollectionFetchCount").addAttr("CollectionUpdateCount").addAttr("CollectionRemoveCount").addAttr("CollectionRecreateCount").addAttr("SuccessfulTransactionCount").addAttr("TransactionCount").addAttr("CloseStatementCount").addAttr("PrepareStatementCount").addAttr("OptimisticFailureCount").addOutputWriterFactory(GraphiteWriter.builder().addTypeName("name").setDebugEnabled(true).setHost(GW_HOST).setPort(2003).build()).build()).build());
printer.prettyPrint(process);
Injector injector = JmxTransModule.createInjector(new JmxTransConfiguration());
JmxTransformer transformer = injector.getInstance(JmxTransformer.class);
transformer.executeStandalone(process);
}
use of com.googlecode.jmxtrans.cli.JmxTransConfiguration in project jmxtrans by jmxtrans.
the class JmxTransformerTest method startDateIsSpreadAccordingToRunPeriod.
@Test
public void startDateIsSpreadAccordingToRunPeriod() {
JmxTransformer jmxTransformer = new JmxTransformer(null, new JmxTransConfiguration(), null, null, null, null);
Date now = new Date();
assertThat(jmxTransformer.computeSpreadStartDate(60)).isBetween(now, new Date(now.getTime() + MILLISECONDS.convert(60, SECONDS)));
}
use of com.googlecode.jmxtrans.cli.JmxTransConfiguration 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");
}
use of com.googlecode.jmxtrans.cli.JmxTransConfiguration 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");
}
Aggregations