本文整理汇总了Java中com.appdynamics.extensions.conf.MonitorConfiguration类的典型用法代码示例。如果您正苦于以下问题:Java MonitorConfiguration类的具体用法?Java MonitorConfiguration怎么用?Java MonitorConfiguration使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
MonitorConfiguration类属于com.appdynamics.extensions.conf包,在下文中一共展示了MonitorConfiguration类的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: createTask
import com.appdynamics.extensions.conf.MonitorConfiguration; //导入依赖的package包/类
private ResourceMgrMetricsFetcherTask createTask(MonitorConfiguration configuration, List<Map<String, ?>> servers) {
Map<String, ?> server = servers.get(0);
ResourceMgrMetricsFetcherTask task = new ResourceMgrMetricsFetcherTask(configuration, server);
task = Mockito.spy(task);
Mockito.doAnswer(new Answer() {
public Object answer(InvocationOnMock invocation) throws Throwable {
String url = (String) invocation.getArguments()[0];
if (url.endsWith("cluster/metrics")) {
return getResourceAsJson("/data/resourcemanager/cluster-metrics.json");
} else if (url.endsWith("cluster/nodes")) {
return getResourceAsJson("/data/resourcemanager/nodes.json");
} else if (url.endsWith("cluster/scheduler")) {
return getResourceAsJson("/data/resourcemanager/scheduler-fair.json");
}else if (url.contains("cluster/apps?")) {
return getResourceAsJson("/data/resourcemanager/apps.json");
}
System.out.println(url);
return null;
}
}).when(task).getResponseAsJson(Mockito.anyString());
return task;
}
开发者ID:Appdynamics,项目名称:hadoop-monitoring-extension,代码行数:23,代码来源:ResourceMgrMetricsFetcherTaskTest.java
示例6: 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;
}
示例7: setup
import com.appdynamics.extensions.conf.MonitorConfiguration; //导入依赖的package包/类
@Before
public void setup() throws IOException {
configuration = mock(MonitorConfiguration.class);
server = new HashMap<String, String>();
server.put("uri", "http://testuri.com/status");
nGinXMonitorTask = new NGinXMonitorTask(configuration, server);
client = mock(CloseableHttpClient.class);
response = mock(CloseableHttpResponse.class);
entity = mock(HttpEntity.class);
header = mock(Header.class);
metricWriter = mock(MetricWriteHelper.class);
when(configuration.getHttpClient()).thenReturn(client);
when(client.execute(Mockito.any(HttpGet.class))).thenReturn(response);
when(response.getEntity()).thenReturn(entity);
when(response.getFirstHeader(Mockito.anyString())).thenReturn(header);
when(configuration.getMetricPrefix()).thenReturn("prefix");
PowerMockito.mockStatic(EntityUtils.class);
when(configuration.getMetricWriter()).thenReturn(metricWriter);
}
示例8: 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;
}
}
示例9: 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;
}
}
示例10: 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;
}
}
示例11: 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;
}
}
示例12: 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;
}
}
示例13: 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;
}
}
示例14: 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;
}
}
示例15: initAmbariConfigCorrectArgs
import com.appdynamics.extensions.conf.MonitorConfiguration; //导入依赖的package包/类
@Test
public void initAmbariConfigCorrectArgs() throws Exception {
Map<String, String> taskArgs = Maps.newHashMap();
taskArgs.put(HadoopMonitor.CONFIG_ARG, "src/main/resources/conf/config.yml");
taskArgs.put(HadoopMonitor.AMBARI_METRICS_XML_ARG, "src/main/resources/conf/metrics-ambari.xml");
MonitorConfiguration config = new HadoopMonitor().initAmbariConfig(taskArgs);
Assert.assertNotNull(config.getConfigYml());
Assert.assertNotNull(config.getMetricsXmlConfiguration());
Assert.assertEquals("Custom Metrics|HadoopMonitor|Ambari",config.getMetricPrefix());
Assert.assertTrue(config.isEnabled());
}