public static RuntimeStatisticsAggregator computeRuntimeStatisticsForHost(Map<Domain, RuntimeStatisticsAggregator> runtimeStatistics) { return RuntimeStatisticsAggregator.combine(runtimeStatistics.values()); }
public static RuntimeStatisticsAggregator computeRuntimeStatisticsForRing(Map<Host, Map<Domain, RuntimeStatisticsAggregator>> runtimeStatistics) { List<RuntimeStatisticsAggregator> runtimeStatisticsAggregators = new ArrayList<RuntimeStatisticsAggregator>(); for (Map.Entry<Host, Map<Domain, RuntimeStatisticsAggregator>> entry1 : runtimeStatistics.entrySet()) { for (Map.Entry<Domain, RuntimeStatisticsAggregator> entry2 : entry1.getValue().entrySet()) { runtimeStatisticsAggregators.add(entry2.getValue()); } } return RuntimeStatisticsAggregator.combine(runtimeStatisticsAggregators); }
public static RuntimeStatisticsAggregator computeRuntimeStatisticsForRingGroup( Map<Ring, Map<Host, Map<Domain, RuntimeStatisticsAggregator>>> runtimeStatistics) { List<RuntimeStatisticsAggregator> runtimeStatisticsAggregators = new ArrayList<RuntimeStatisticsAggregator>(); for (Map.Entry<Ring, Map<Host, Map<Domain, RuntimeStatisticsAggregator>>> entry1 : runtimeStatistics.entrySet()) { for (Map.Entry<Host, Map<Domain, RuntimeStatisticsAggregator>> entry2 : entry1.getValue().entrySet()) { for (Map.Entry<Domain, RuntimeStatisticsAggregator> entry3 : entry2.getValue().entrySet()) { runtimeStatisticsAggregators.add(entry3.getValue()); } } } return RuntimeStatisticsAggregator.combine(runtimeStatisticsAggregators); }
public static SortedMap<Domain, RuntimeStatisticsAggregator> computeRuntimeStatisticsForDomains( Map<Ring, Map<Host, Map<Domain, RuntimeStatisticsAggregator>>> runtimeStatistics) { // Build lists of aggregators Map<Domain, List<RuntimeStatisticsAggregator>> runtimeStatisticsAggregators = new HashMap<Domain, List<RuntimeStatisticsAggregator>>(); for (Map.Entry<Ring, Map<Host, Map<Domain, RuntimeStatisticsAggregator>>> entry1 : runtimeStatistics.entrySet()) { for (Map.Entry<Host, Map<Domain, RuntimeStatisticsAggregator>> entry2 : entry1.getValue().entrySet()) { for (Map.Entry<Domain, RuntimeStatisticsAggregator> entry3 : entry2.getValue().entrySet()) { List<RuntimeStatisticsAggregator> aggregators = runtimeStatisticsAggregators.get(entry3.getKey()); if (aggregators == null) { aggregators = new ArrayList<RuntimeStatisticsAggregator>(); runtimeStatisticsAggregators.put(entry3.getKey(), aggregators); } aggregators.add(entry3.getValue()); } } } // Build result SortedMap<Domain, RuntimeStatisticsAggregator> result = new TreeMap<Domain, RuntimeStatisticsAggregator>(); for (Map.Entry<Domain, List<RuntimeStatisticsAggregator>> entry : runtimeStatisticsAggregators.entrySet()) { result.put(entry.getKey(), RuntimeStatisticsAggregator.combine(entry.getValue())); } return result; }
public static SortedMap<Domain, RuntimeStatisticsAggregator> computeRuntimeStatisticsForDomains( Map<Host, Map<Domain, RuntimeStatisticsAggregator>> runtimeStatistics) { // Build lists of aggregators Map<Domain, List<RuntimeStatisticsAggregator>> runtimeStatisticsAggregators = new HashMap<Domain, List<RuntimeStatisticsAggregator>>(); for (Map.Entry<Host, Map<Domain, RuntimeStatisticsAggregator>> entry1 : runtimeStatistics.entrySet()) { for (Map.Entry<Domain, RuntimeStatisticsAggregator> entry2 : entry1.getValue().entrySet()) { List<RuntimeStatisticsAggregator> aggregators = runtimeStatisticsAggregators.get(entry2.getKey()); if (aggregators == null) { aggregators = new ArrayList<RuntimeStatisticsAggregator>(); runtimeStatisticsAggregators.put(entry2.getKey(), aggregators); } aggregators.add(entry2.getValue()); } } // Build result SortedMap<Domain, RuntimeStatisticsAggregator> result = new TreeMap<Domain, RuntimeStatisticsAggregator>(); for (Map.Entry<Domain, List<RuntimeStatisticsAggregator>> entry : runtimeStatisticsAggregators.entrySet()) { result.put(entry.getKey(), RuntimeStatisticsAggregator.combine(entry.getValue())); } return result; }