class TracezDataAggregator {

  Map<String, Integer> getErrorSpanCounts() {
    Map<String, TracezSpanBuckets> completedSpanCache = spanProcessor.getCompletedSpanCache();
    Map<String, Integer> numErrorsPerName = new HashMap<>();
    for (Map.Entry<String, TracezSpanBuckets> cacheEntry : completedSpanCache.entrySet()) {
      numErrorsPerName.put(cacheEntry.getKey(), cacheEntry.getValue().getErrorSpans().size());
    }
    return numErrorsPerName;
  }

    TracezDataAggregator(TracezSpanProcessor spanProcessor);

}