use of com.newrelic.agent.ConnectionListener in project newrelic-java-agent by newrelic.
the class NormalizedTransactionTrace method setUrlRules.
private String setUrlRules(JSONArray rules) {
MockRPMServiceManager rpmServiceManager = (MockRPMServiceManager) ServiceFactory.getRPMServiceManager();
List<ConnectionListener> connectionListeners = rpmServiceManager.getConnectionListeners();
ConnectionListener connectionListener = connectionListeners.get(0);
MockRPMService rpmService = (MockRPMService) rpmServiceManager.getRPMService();
String appName = rpmService.getApplicationName();
Map<String, Object> data = new HashMap<>();
data.put(NormalizationRuleConfig.METRIC_NAME_RULES_KEY, rules);
connectionListener.connected(rpmService, AgentConfigImpl.createAgentConfig(data));
return appName;
}
use of com.newrelic.agent.ConnectionListener in project newrelic-java-agent by newrelic.
the class MetricNormalizerTest method setUrlRules.
private String setUrlRules(JSONArray rules) {
MockRPMServiceManager rpmServiceManager = (MockRPMServiceManager) ServiceFactory.getRPMServiceManager();
List<ConnectionListener> connectionListeners = rpmServiceManager.getConnectionListeners();
ConnectionListener connectionListener = connectionListeners.get(0);
MockRPMService rpmService = (MockRPMService) rpmServiceManager.getRPMService();
String appName = rpmService.getApplicationName();
Map<String, Object> data = new HashMap<>();
data.put(NormalizationRuleConfig.URL_RULES_KEY, rules);
// add a bogus segment term rule to make sure that has no side-effect of breaking stuff
data.put("transaction_segment_terms", Arrays.asList(ImmutableMap.of("prefix", "This/Wont/Match/Anything", "terms", Arrays.asList("of", "endearment"))));
connectionListener.connected(rpmService, AgentConfigImpl.createAgentConfig(data));
return appName;
}
use of com.newrelic.agent.ConnectionListener in project newrelic-java-agent by newrelic.
the class TransactionNamingTest method setUrlRules.
private String setUrlRules(JSONArray urlRules) {
MockRPMServiceManager rpmServiceManager = (MockRPMServiceManager) ServiceFactory.getRPMServiceManager();
List<ConnectionListener> connectionListeners = rpmServiceManager.getConnectionListeners();
ConnectionListener connectionListener = connectionListeners.get(0);
MockRPMService rpmService = (MockRPMService) rpmServiceManager.getRPMService();
String appName = rpmService.getApplicationName();
Map<String, Object> data = new HashMap<>();
data.put(NormalizationRuleConfig.URL_RULES_KEY, urlRules);
connectionListener.connected(rpmService, AgentConfigImpl.createAgentConfig(data));
return appName;
}
use of com.newrelic.agent.ConnectionListener in project newrelic-java-agent by newrelic.
the class TransactionNamingTest method setTransactionRules.
private String setTransactionRules(JSONArray metricRules) {
MockRPMServiceManager rpmServiceManager = (MockRPMServiceManager) ServiceFactory.getRPMServiceManager();
List<ConnectionListener> connectionListeners = rpmServiceManager.getConnectionListeners();
ConnectionListener connectionListener = connectionListeners.get(0);
MockRPMService rpmService = (MockRPMService) rpmServiceManager.getRPMService();
String appName = rpmService.getApplicationName();
Map<String, Object> data = new HashMap<>();
data.put(NormalizationRuleConfig.TRANSACTION_NAME_RULES_KEY, metricRules);
connectionListener.connected(rpmService, AgentConfigImpl.createAgentConfig(data));
return appName;
}
Aggregations