class MetricCollectors {

  public static String getStatsFor(final String topic, boolean isError) {

    ArrayList<TopicSensors.Stat> allStats = new ArrayList<>();
    collectorMap.values().forEach(c -> allStats.addAll(c.stats(topic.toLowerCase(), isError)));

    Map<String, TopicSensors.Stat> aggregateStats = getAggregateMetrics(allStats);

    return format(aggregateStats.values(), isError ? "last-failed" : "last-message");
  }

}