@Test public void getMetricIdsByProtocolTest() { Map<String, String> rrdGraphAttributesMetaData = new HashMap<String, String>(); rrdGraphAttributesMetaData.put("icmpInRedirects", "SNMP_.1.3.6.1.2.1.5.7.0=icmpInRedirects"); rrdGraphAttributesMetaData.put("ifOutOctets", "SNMP_.1.3.6.1.2.1.2.2.1.16.3=ifOutOctets"); rrdGraphAttributesMetaData.put("ifInOctets", "SNMP_.1.3.6.1.2.1.2.2.1.10.3=ifInOctets"); rrdGraphAttributesMetaData.put("inboundJitter", "TCA_.1.3.6.1.4.1.27091.3.1.6.1.2.171.19.37.60_inboundJitter=inboundJitter"); Map<String, List<MetricTuple>> metricIdsByProtocol = nrtController.getMetricIdsByProtocol(rrdGraphAttributesMetaData); assertNotNull(metricIdsByProtocol.get("SNMP")); List<MetricTuple> snmpMetrics = metricIdsByProtocol.get("SNMP"); assertEquals(".1.3.6.1.2.1.2.2.1.16.3", snmpMetrics.get(0).getMetricId()); assertNotNull(metricIdsByProtocol.get("TCA")); List<MetricTuple> tcaMetrics = metricIdsByProtocol.get("TCA"); assertEquals(".1.3.6.1.4.1.27091.3.1.6.1.2.171.19.37.60_inboundJitter", tcaMetrics.get(0).getMetricId()); }
protected Map<String, List<MetricTuple>> getMetricIdsByProtocol(Map<String, String> rrdGraphAttributesMetaData) { Map<String, List<MetricTuple>> metricIdsByProtocol = new HashMap<String, List<MetricTuple>>(); for (Map.Entry<String, String> entry : rrdGraphAttributesMetaData.entrySet()) { String protocol = getProtocolFromMetaDataLine(entry.getValue()); String metricId = getMetricIdFromMetaDataLine(entry.getValue()); if (!metricIdsByProtocol.containsKey(protocol)) { metricIdsByProtocol.put(protocol, new ArrayList<MetricTuple>()); } metricIdsByProtocol.get(protocol).add(new MetricTuple(metricId, entry.getKey())); } return metricIdsByProtocol; }
NrtController { protected Map<String, List<MetricTuple>> getMetricIdsByProtocol(Map<String, String> rrdGraphAttributesMetaData) { Map<String, List<MetricTuple>> metricIdsByProtocol = new HashMap<String, List<MetricTuple>>(); for (Map.Entry<String, String> entry : rrdGraphAttributesMetaData.entrySet()) { String protocol = getProtocolFromMetaDataLine(entry.getValue()); String metricId = getMetricIdFromMetaDataLine(entry.getValue()); if (!metricIdsByProtocol.containsKey(protocol)) { metricIdsByProtocol.put(protocol, new ArrayList<MetricTuple>()); } metricIdsByProtocol.get(protocol).add(new MetricTuple(metricId, entry.getKey())); } return metricIdsByProtocol; } }
NrtController { protected Map<String, List<MetricTuple>> getMetricIdsByProtocol(Map<String, String> rrdGraphAttributesMetaData) { Map<String, List<MetricTuple>> metricIdsByProtocol = new HashMap<String, List<MetricTuple>>(); for (Map.Entry<String, String> entry : rrdGraphAttributesMetaData.entrySet()) { String protocol = getProtocolFromMetaDataLine(entry.getValue()); String metricId = getMetricIdFromMetaDataLine(entry.getValue()); if (!metricIdsByProtocol.containsKey(protocol)) { metricIdsByProtocol.put(protocol, new ArrayList<MetricTuple>()); } metricIdsByProtocol.get(protocol).add(new MetricTuple(metricId, entry.getKey())); } return metricIdsByProtocol; }  }
NrtController { protected Map<String, List<MetricTuple>> getMetricIdsByProtocol(Map<String, String> rrdGraphAttributesMetaData) { Map<String, List<MetricTuple>> metricIdsByProtocol = new HashMap<String, List<MetricTuple>>(); for (Map.Entry<String, String> entry : rrdGraphAttributesMetaData.entrySet()) { String protocol = getProtocolFromMetaDataLine(entry.getValue()); String metricId = getMetricIdFromMetaDataLine(entry.getValue()); if (!metricIdsByProtocol.containsKey(protocol)) { metricIdsByProtocol.put(protocol, new ArrayList<MetricTuple>()); } metricIdsByProtocol.get(protocol).add(new MetricTuple(metricId, entry.getKey())); } return metricIdsByProtocol; }  ModelAndView nrtStart(String resourceId, String report, HttpSession httpSession); void nrtCollectionJobTrigger(String nrtCollectionTaskId, HttpSession httpSession); String getMeasurementSetsForDestination(String nrtCollectionTaskId); Set<RrdGraphAttribute> getRequiredRrdGraphAttributes(OnmsResource reportResource, PrefabGraph prefabGraph); Map<String,String> getRequiredExternalPropertyAttributes(final OnmsResource reportResource, final PrefabGraph prefabGraph); Map<String,String> getRequiredStringPropertyAttributes(final OnmsResource reportResource, final PrefabGraph prefabGraph); void setNodeDao(NodeDao nodeDao); void setGraphDao(GraphDao graphDao); void setResourceDao(ResourceDao resourceDao); void setSnmpAgentConfigFactory(SnmpAgentConfigFactory snmpAgentConfigFactory); NrtBroker getNrtBroker(); void setNrtBroker(NrtBroker nrtBroker); }
NrtController { protected Map<String, List<MetricTuple>> getMetricIdsByProtocol(Map<String, String> rrdGraphAttributesMetaData) { Map<String, List<MetricTuple>> metricIdsByProtocol = new HashMap<String, List<MetricTuple>>(); for (Map.Entry<String, String> entry : rrdGraphAttributesMetaData.entrySet()) { String protocol = getProtocolFromMetaDataLine(entry.getValue()); String metricId = getMetricIdFromMetaDataLine(entry.getValue()); if (!metricIdsByProtocol.containsKey(protocol)) { metricIdsByProtocol.put(protocol, new ArrayList<MetricTuple>()); } metricIdsByProtocol.get(protocol).add(new MetricTuple(metricId, entry.getKey())); } return metricIdsByProtocol; }  ModelAndView nrtStart(String resourceId, String report, HttpSession httpSession); void nrtCollectionJobTrigger(String nrtCollectionTaskId, HttpSession httpSession); String getMeasurementSetsForDestination(String nrtCollectionTaskId); Set<RrdGraphAttribute> getRequiredRrdGraphAttributes(OnmsResource reportResource, PrefabGraph prefabGraph); Map<String,String> getRequiredExternalPropertyAttributes(final OnmsResource reportResource, final PrefabGraph prefabGraph); Map<String,String> getRequiredStringPropertyAttributes(final OnmsResource reportResource, final PrefabGraph prefabGraph); void setNodeDao(NodeDao nodeDao); void setGraphDao(GraphDao graphDao); void setResourceDao(ResourceDao resourceDao); void setSnmpAgentConfigFactory(SnmpAgentConfigFactory snmpAgentConfigFactory); NrtBroker getNrtBroker(); void setNrtBroker(NrtBroker nrtBroker);  }