public RuntimeStatisticsAggregator getRuntimeStatistics() { RuntimeStatisticsAggregator runtimeStatisticsAggregator = new RuntimeStatisticsAggregator(); for (PartitionAccessor partitionAccessor : partitionAccessors) { if (partitionAccessor != null) { runtimeStatisticsAggregator.add(partitionAccessor.getRuntimeStatistics()); } } runtimeStatisticsAggregator.setGetRequestsPopulationStatistics( getRequestsTimerAggregator.getAndResetPopulationStatistics()); return runtimeStatisticsAggregator; } }
public static RuntimeStatisticsAggregator computeRuntimeStatisticsForHost(Map<Domain, RuntimeStatisticsAggregator> runtimeStatistics) { return RuntimeStatisticsAggregator.combine(runtimeStatistics.values()); }
public static RuntimeStatisticsAggregator computeRuntimeStatisticsForDomain(Map<Domain, RuntimeStatisticsAggregator> runtimeStatistics, Domain domain) { if (runtimeStatistics.containsKey(domain)) { return runtimeStatistics.get(domain); } else { return new RuntimeStatisticsAggregator(); } }
public static String formatCacheHits(RuntimeStatisticsAggregator runtimeStatisticsAggregator) { double l1 = runtimeStatisticsAggregator.getL1CacheHitRate(); double l2 = runtimeStatisticsAggregator.getL2CacheHitRate(); if (l1 == 0 && l2 == 0) { return "-"; } else { String l1Str = "-"; String l2Str = "-"; if (l1 != 0) { l1Str = FormatUtils.formatDouble(l1 * 100.0) + "%"; } if (l2 != 0) { l2Str = FormatUtils.formatDouble(l2 * 100.0) + "%"; } return l1Str + " / " + l2Str; } }
public static void setRuntimeStatistics(Host host, Map<Domain, RuntimeStatisticsAggregator> runtimeStatisticsAggregators) throws IOException { RuntimeStatisticsSummary summary = new RuntimeStatisticsSummary(); StringBuilder statistics = new StringBuilder(); for (Map.Entry<Domain, RuntimeStatisticsAggregator> entry : runtimeStatisticsAggregators.entrySet()) { Domain domain = entry.getKey(); RuntimeStatisticsAggregator runtimeStatisticsAggregator = entry.getValue(); DomainStatisticsSummary domainSummary = new DomainStatisticsSummary(); runtimeStatisticsAggregator.putToStatistics(domainSummary); summary.put_to_domain_statistics(domain.getName(), domainSummary); statistics.append(domain.getId()); statistics.append('\t'); statistics.append(RuntimeStatisticsAggregator.toString(runtimeStatisticsAggregator)); statistics.append('\n'); } host.setEphemeralStatistic(RUNTIME_STATISTICS_KEY, statistics.toString()); host.setRuntimeStatisticsSummary(summary); }
public static Map<Domain, RuntimeStatisticsAggregator> computeRuntimeStatistics(Coordinator coordinator, Host host) throws IOException { String runtimeStatistics = host.getStatistic(RUNTIME_STATISTICS_KEY); if (runtimeStatistics == null) { return Collections.emptyMap(); } else { Map<Domain, RuntimeStatisticsAggregator> result = new HashMap<Domain, RuntimeStatisticsAggregator>(); String[] domainStatistics = runtimeStatistics.split("\n"); for (String statistics : domainStatistics) { if (statistics.length() == 0) { continue; } String[] tokens = statistics.split("\t"); int domainId = Integer.parseInt(tokens[0]); result.put(coordinator.getDomainById(domainId), RuntimeStatisticsAggregator.parse(tokens[1])); } return result; } }
public static RuntimeStatisticsAggregator computeRuntimeStatisticsForHost(Map<Host, Map<Domain, RuntimeStatisticsAggregator>> runtimeStatistics, Host host) { if (runtimeStatistics.containsKey(host)) { return Hosts.computeRuntimeStatisticsForHost(runtimeStatistics.get(host)); } else { return new RuntimeStatisticsAggregator(); } }
public static RuntimeStatisticsAggregator computeRuntimeStatisticsForRing( Map<Ring, Map<Host, Map<Domain, RuntimeStatisticsAggregator>>> runtimeStatistics, Ring ring) { if (runtimeStatistics.containsKey(ring)) { return Rings.computeRuntimeStatisticsForRing(runtimeStatistics.get(ring)); } else { return new RuntimeStatisticsAggregator(); } }
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 combine(Collection<RuntimeStatisticsAggregator> runtimeStatisticsAggregators) { RuntimeStatisticsAggregator result = new RuntimeStatisticsAggregator(); List<DoublePopulationStatisticsAggregator> doublePopulationStatisticsAggregators = new ArrayList<DoublePopulationStatisticsAggregator>(runtimeStatisticsAggregators.size()); for (RuntimeStatisticsAggregator runtimeStatisticsAggregator : runtimeStatisticsAggregators) { result.throughputTotal += runtimeStatisticsAggregator.throughputTotal; result.responseDataThroughputTotal += runtimeStatisticsAggregator.responseDataThroughputTotal; result.numRequestsTotal += runtimeStatisticsAggregator.numRequestsTotal; result.numHitsTotal += runtimeStatisticsAggregator.numHitsTotal; result.numL1CacheHitsTotal += runtimeStatisticsAggregator.numL1CacheHitsTotal; result.numL2CacheHitsTotal += runtimeStatisticsAggregator.numL2CacheHitsTotal; doublePopulationStatisticsAggregators.add(runtimeStatisticsAggregator.getRequestsPopulationStatistics); result.cacheStatisticsTotal.add(runtimeStatisticsAggregator.cacheStatisticsTotal); } result.getRequestsPopulationStatistics = DoublePopulationStatisticsAggregator.combine(doublePopulationStatisticsAggregators); return result; }
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); }
randomSample); return new RuntimeStatisticsAggregator( throughputTotal, responseDataThroughputTotal, } catch (Exception e) { LOG.error("Failed to parse runtime statistics aggregator with string: " + str, e); return new RuntimeStatisticsAggregator();
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; }
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; }