本文整理汇总了Java中com.appdynamics.extensions.conf.MonitorConfiguration.setConfigYml方法的典型用法代码示例。如果您正苦于以下问题:Java MonitorConfiguration.setConfigYml方法的具体用法?Java MonitorConfiguration.setConfigYml怎么用?Java MonitorConfiguration.setConfigYml使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.appdynamics.extensions.conf.MonitorConfiguration
的用法示例。
在下文中一共展示了MonitorConfiguration.setConfigYml方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initialize
import com.appdynamics.extensions.conf.MonitorConfiguration; //导入方法依赖的package包/类
private void initialize(Map<String, String> argsMap) {
if (!initialized) {
final String configFilePath = argsMap.get(CONFIG_ARG);
MetricWriteHelper metricWriteHelper = MetricWriteHelperFactory.create(this);
MonitorConfiguration conf = new MonitorConfiguration(METRIC_PREFIX, new TaskRunnable(), metricWriteHelper);
conf.setConfigYml(configFilePath);
conf.checkIfInitialized(MonitorConfiguration.ConfItem.CONFIG_YML, MonitorConfiguration.ConfItem.METRIC_PREFIX,
MonitorConfiguration.ConfItem.METRIC_WRITE_HELPER, MonitorConfiguration.ConfItem.EXECUTOR_SERVICE);
this.configuration = conf;
initXstream();
initialized = true;
}
}
开发者ID:Appdynamics,项目名称:azure-servicebus-monitoring-extension,代码行数:18,代码来源:AzureServiceBusMonitor.java
示例2: initialize
import com.appdynamics.extensions.conf.MonitorConfiguration; //导入方法依赖的package包/类
private void initialize(String configFile, String metricFile) {
if (!initialized) {
MetricWriteHelper metricWriteHelper = MetricWriteHelperFactory.create(this);
MonitorConfiguration conf = new MonitorConfiguration(METRIC_PREFIX, new TaskRunnable(), metricWriteHelper);
conf.setConfigYml(configFile);
conf.setMetricsXml(metricFile, Stat.Stats.class);
conf.checkIfInitialized(MonitorConfiguration.ConfItem.CONFIG_YML, MonitorConfiguration.ConfItem.METRICS_XML, MonitorConfiguration.ConfItem.EXECUTOR_SERVICE,
MonitorConfiguration.ConfItem.METRIC_PREFIX, MonitorConfiguration.ConfItem.METRIC_WRITE_HELPER);
this.configuration = conf;
initialized = true;
}
}
示例3: initAmbariConfig
import com.appdynamics.extensions.conf.MonitorConfiguration; //导入方法依赖的package包/类
protected MonitorConfiguration initAmbariConfig(Map<String, String> taskArgs) {
logger.info("Initializing the Ambari Monitor Configuration");
String configFilename = getConfigFilename(taskArgs.get(CONFIG_ARG));
MetricWriteHelper metricWriteHelper = MetricWriteHelperFactory.create(this);
MonitorConfiguration conf = new MonitorConfiguration("Custom Metrics|HadoopMonitor|Ambari",
new AmbariMonitorExecutor(), metricWriteHelper);
String xmlPath = getPath(taskArgs, AMBARI_METRICS_XML_ARG, "monitors/HadoopMonitor/metrics-ambari.xml");
conf.setMetricsXml(xmlPath, MetricConfig.class);
conf.setConfigYml(configFilename, "ambariMonitor");
if (conf.isEnabled()) {
conf.checkIfInitialized(ConfItem.CONFIG_YML, ConfItem.METRIC_PREFIX,
ConfItem.METRIC_WRITE_HELPER, ConfItem.METRICS_XML);
} else {
logger.info("The Ambari Monitor is not enabled");
}
return conf;
}
示例4: initResourceManagerConfig
import com.appdynamics.extensions.conf.MonitorConfiguration; //导入方法依赖的package包/类
protected MonitorConfiguration initResourceManagerConfig(Map<String, String> taskArgs) {
logger.info("Initializing the Resource Manager Monitor Configuration");
String configFilename = getConfigFilename(taskArgs.get(CONFIG_ARG));
MetricWriteHelper metricWriteHelper = MetricWriteHelperFactory.create(this);
MonitorConfiguration conf = new MonitorConfiguration("Custom Metrics|HadoopMonitor|ResourceManager",
new RMMonitorExecutor(), metricWriteHelper);
String xmlPath = getPath(taskArgs, RM_METRICS_XML_ARG, "monitors/HadoopMonitor/metrics-resource-manager.xml");
conf.setMetricsXml(xmlPath, MetricConfig.class);
conf.setConfigYml(configFilename, new ConfigReloader(), "resourceManagerMonitor");
if (conf.isEnabled()) {
conf.checkIfInitialized(ConfItem.CONFIG_YML, ConfItem.METRIC_PREFIX, ConfItem.METRIC_WRITE_HELPER);
} else{
logger.info("The Resource Manager Monitor is not enabled");
}
return conf;
}
示例5: configure
import com.appdynamics.extensions.conf.MonitorConfiguration; //导入方法依赖的package包/类
private void configure(Map<String, String> argsMap) {
logger.info("Initializing the Linux Configuration");
MetricWriteHelper metricWriteHelper = MetricWriteHelperFactory.create(this);
MonitorConfiguration conf = new MonitorConfiguration(metricPrefix, new TaskRunnable(), metricWriteHelper);
configFileName = argsMap.get("config-file");
if(Strings.isNullOrEmpty(configFileName)){
configFileName = "monitors/LinuxMonitor/config.yml";
}
conf.setConfigYml(configFileName);
conf.checkIfInitialized(MonitorConfiguration.ConfItem.CONFIG_YML, MonitorConfiguration.ConfItem.EXECUTOR_SERVICE,
MonitorConfiguration.ConfItem.METRIC_PREFIX, MonitorConfiguration.ConfItem.METRIC_WRITE_HELPER);
this.configuration = conf;
String prefix = (String)this.configuration.getConfigYml().get("metricPrefix");
if(!Strings.isNullOrEmpty(prefix)){
metricPrefix = prefix;
}
initialized = true;
}
示例6: initialize
import com.appdynamics.extensions.conf.MonitorConfiguration; //导入方法依赖的package包/类
private void initialize(String configFile) {
if (!initialized) {
MetricWriteHelper metricWriteHelper = MetricWriteHelperFactory.create(this);
MonitorConfiguration conf = new MonitorConfiguration(METRIC_PREFIX, new TaskRunnable(), metricWriteHelper);
conf.setConfigYml(configFile, new MonitorConfiguration.FileWatchListener() {
public void onFileChange(File file) {
connect();
}
});
conf.checkIfInitialized(MonitorConfiguration.ConfItem.CONFIG_YML, MonitorConfiguration.ConfItem.METRIC_PREFIX, MonitorConfiguration.ConfItem.METRIC_WRITE_HELPER);
this.configuration = conf;
connect();
initialized = true;
}
}
示例7: initialize
import com.appdynamics.extensions.conf.MonitorConfiguration; //导入方法依赖的package包/类
private void initialize(Map<String, String> taskArgs) {
if(!initialized) {
final String configFilePath = taskArgs.get(CONFIG_ARG);
MetricWriteHelper metricWriteHelper = MetricWriteHelperFactory.create(this);
MonitorConfiguration conf = new MonitorConfiguration(METRIC_PREFIX, new TaskRunnable(), metricWriteHelper);
String metricXMLFilePath = getPath(taskArgs, METRIC_XML_ARG, "monitors/MarkLogicMonitor/metrics.xml");
conf.setMetricsXml(metricXMLFilePath, MetricConfig.class);
conf.setConfigYml(configFilePath);
conf.checkIfInitialized(ConfItem.CONFIG_YML, ConfItem.METRICS_XML, ConfItem.EXECUTOR_SERVICE, ConfItem.HTTP_CLIENT, ConfItem.METRIC_PREFIX, ConfItem.METRIC_WRITE_HELPER);
this.configuration = conf;
initialized = true;
}
}
示例8: initialize
import com.appdynamics.extensions.conf.MonitorConfiguration; //导入方法依赖的package包/类
private void initialize(Map<String, String> taskArgs) {
if (!initialized) {
//read the config.
final String configFilePath = taskArgs.get(CONFIG_ARG);
MetricWriteHelper metricWriteHelper = MetricWriteHelperFactory.create(this);
MonitorConfiguration conf = new MonitorConfiguration(METRIC_PREFIX, new TaskRunnable(), metricWriteHelper);
conf.setConfigYml(configFilePath);
conf.checkIfInitialized(MonitorConfiguration.ConfItem.CONFIG_YML, MonitorConfiguration.ConfItem.EXECUTOR_SERVICE,
MonitorConfiguration.ConfItem.METRIC_PREFIX, MonitorConfiguration.ConfItem.METRIC_WRITE_HELPER);
this.configuration = conf;
initialized = true;
}
}
示例9: initialize
import com.appdynamics.extensions.conf.MonitorConfiguration; //导入方法依赖的package包/类
protected void initialize(Map<String, String> argsMap) {
if (configuration == null) {
MetricWriteHelper metricWriter = MetricWriteHelperFactory.create(this);
MonitorConfiguration conf = new MonitorConfiguration("Custom Metrics|Solr|", new TaskRunner(), metricWriter);
final String configFilePath = argsMap.get("config-file");
conf.setConfigYml(configFilePath);
conf.checkIfInitialized(MonitorConfiguration.ConfItem.METRIC_PREFIX, MonitorConfiguration.ConfItem.CONFIG_YML, MonitorConfiguration.ConfItem.HTTP_CLIENT
, MonitorConfiguration.ConfItem.EXECUTOR_SERVICE);
this.configuration = conf;
}
}
示例10: initialize
import com.appdynamics.extensions.conf.MonitorConfiguration; //导入方法依赖的package包/类
private void initialize(Map<String, String> taskArgs) {
if(!initialized) {
logger.debug("Initializing Elastic Search Monitor configuration");
final String configFilePath = taskArgs.get(CONFIG_ARG);
MetricWriteHelper metricWriteHelper = MetricWriteHelperFactory.create(this);
MonitorConfiguration conf = new MonitorConfiguration(METRIC_PREFIX, new TaskRunnable(), metricWriteHelper);
conf.setConfigYml(configFilePath);
conf.checkIfInitialized(MonitorConfiguration.ConfItem.CONFIG_YML, MonitorConfiguration.ConfItem.EXECUTOR_SERVICE, MonitorConfiguration.ConfItem.HTTP_CLIENT, MonitorConfiguration.ConfItem.METRIC_PREFIX, MonitorConfiguration.ConfItem.METRIC_WRITE_HELPER);
this.configuration = conf;
initialized = true;
}
}
示例11: initialize
import com.appdynamics.extensions.conf.MonitorConfiguration; //导入方法依赖的package包/类
private void initialize(Map<String, String> argsMap) {
if (!initialized) {
final String configFilePath = argsMap.get(CONFIG_ARG);
MetricWriteHelper metricWriteHelper = MetricWriteHelperFactory.create(this);
MonitorConfiguration conf = new MonitorConfiguration(METRIC_PREFIX, new TaskRunnable(), metricWriteHelper);
conf.setConfigYml(configFilePath);
conf.checkIfInitialized(MonitorConfiguration.ConfItem.CONFIG_YML, MonitorConfiguration.ConfItem.METRIC_PREFIX,
MonitorConfiguration.ConfItem.METRIC_WRITE_HELPER, MonitorConfiguration.ConfItem.HTTP_CLIENT, MonitorConfiguration.ConfItem.EXECUTOR_SERVICE);
this.configuration = conf;
initialized = true;
}
}
示例12: initialize
import com.appdynamics.extensions.conf.MonitorConfiguration; //导入方法依赖的package包/类
protected void initialize (Map<String, String> argsMap) {
if (configuration == null) {
MetricWriteHelper metricWriter = MetricWriteHelperFactory.create(this);
MonitorConfiguration conf = new MonitorConfiguration("Custom Metrics|Cassandra|", new TaskRunner(),
metricWriter);
final String configFilePath = argsMap.get("config-file");
conf.setConfigYml(configFilePath);
conf.checkIfInitialized(MonitorConfiguration.ConfItem.METRIC_PREFIX, MonitorConfiguration.ConfItem
.CONFIG_YML, MonitorConfiguration.ConfItem.HTTP_CLIENT, MonitorConfiguration.ConfItem
.EXECUTOR_SERVICE);
this.configuration = conf;
}
}
示例13: readClustersStat
import com.appdynamics.extensions.conf.MonitorConfiguration; //导入方法依赖的package包/类
@Test
public void readClustersStat() throws JAXBException, InterruptedException, IOException {
Runnable runnable = Mockito.mock(Runnable.class);
MetricWriteHelper writer = MetricWriteHelperFactory.create(this);
writer = Mockito.spy(writer);
final List<MetricOutput> expected = MetricOutput.from("/data/ambari-expected-output.txt");
Mockito.doAnswer(new Answer() {
public Object answer(InvocationOnMock invocationOnMock) throws Throwable {
Object[] arguments = invocationOnMock.getArguments();
MetricOutput output = new MetricOutput((String) arguments[0], (BigDecimal) arguments[1], (String) arguments[2]);
boolean remove = expected.remove(output);
if (!remove) {
logger.error("Cannot find the value in the expected values {}", output);
} else{
logger.debug("Received an expected metric "+output);
}
return null;
}
}).when(writer).printMetric(Mockito.anyString(), Mockito.any(BigDecimal.class), Mockito.anyString());
MonitorConfiguration configuration = new MonitorConfiguration("Test", runnable, writer);
configuration = Mockito.spy(configuration);
Mockito.doReturn(new SynchronousExecutorService()).when(configuration).getExecutorService();
configuration.setMetricsXml("src/main/resources/conf/metrics-ambari.xml", MetricConfig.class);
configuration.setConfigYml("src/main/resources/conf/config.yml", "ambariMonitor");
List<Map<String, ?>> servers = (List<Map<String, ?>>) configuration.getConfigYml().get("servers");
AmbariMetricsFetcherTask fetcher = createTask(configuration, servers);
fetcher.run();
Assert.assertTrue("It seems that these metrics are not reported " + expected, expected.isEmpty());
}
示例14: resourceMgrStatsReaderTest
import com.appdynamics.extensions.conf.MonitorConfiguration; //导入方法依赖的package包/类
@Test
public void resourceMgrStatsReaderTest() throws IOException {
Runnable runnable = Mockito.mock(Runnable.class);
MetricWriteHelper writer = MetricWriteHelperFactory.create(this);
writer = Mockito.spy(writer);
final List<MetricOutput> expected = MetricOutput.from("/data/resource-manager-expected-output.txt");
Mockito.doAnswer(new Answer() {
public Object answer(InvocationOnMock invocationOnMock) throws Throwable {
Object[] arguments = invocationOnMock.getArguments();
System.out.println(arguments[0] + "," + arguments[1] + "," + arguments[2]);
MetricOutput output = new MetricOutput((String) arguments[0], (BigDecimal) arguments[1], (String) arguments[2]);
boolean remove = expected.remove(output);
if (!remove) {
logger.error("Cannot find the value in the expected values {}", output);
} else {
logger.debug("Received an expected metric " + output);
}
return null;
}
}).when(writer).printMetric(Mockito.anyString(), Mockito.any(BigDecimal.class), Mockito.anyString());
MonitorConfiguration configuration = new MonitorConfiguration("Test", runnable, writer);
configuration = Mockito.spy(configuration);
Mockito.doReturn(new SynchronousExecutorService()).when(configuration).getExecutorService();
configuration.setMetricsXml("src/main/resources/conf/metrics-resource-manager.xml", MetricConfig.class);
configuration.setConfigYml("src/main/resources/conf/config.yml", "resourceManagerMonitor");
List<Map<String, ?>> servers = (List<Map<String, ?>>) configuration.getConfigYml().get("servers");
Runnable fetcher = createTask(configuration, servers);
fetcher.run();
Assert.assertTrue("It seems that these metrics are not reported " + expected, expected.isEmpty());
}
开发者ID:Appdynamics,项目名称:hadoop-monitoring-extension,代码行数:31,代码来源:ResourceMgrMetricsFetcherTaskTest.java
示例15: initialize
import com.appdynamics.extensions.conf.MonitorConfiguration; //导入方法依赖的package包/类
private void initialize(Map<String, String> taskArgs) {
if (configuration == null) {
MetricWriteHelper metricWriter = MetricWriteHelperFactory.create(this);
MonitorConfiguration conf = new MonitorConfiguration("Custom Metrics|ActiveMQ|", new TaskRunner(), metricWriter);
final String configFilePath = taskArgs.get("config-file");
conf.setConfigYml(configFilePath);
conf.checkIfInitialized(MonitorConfiguration.ConfItem.METRIC_PREFIX, MonitorConfiguration.ConfItem
.CONFIG_YML, MonitorConfiguration.ConfItem.HTTP_CLIENT, MonitorConfiguration.ConfItem
.EXECUTOR_SERVICE);
this.configuration = conf;
}
}