public double currentErrorRate() {
    return collectorMap.values().stream()
        .mapToDouble(MetricCollector::errorRate)
        .sum();
  }
@Test
  public void shouldAggregateDeserializationErrors() {
    final MetricCollectors metricCollectors = new MetricCollectors();
    final StreamsErrorCollector streamsErrorCollector = StreamsErrorCollector.create(
        "test-application",
        metricCollectors
    );
    for (int i = 0; i < 2000; i++) {
      streamsErrorCollector.recordError(TEST_TOPIC);
    }
    // we have 2000 errors in one sample out of a 100. So the effective error rate computed
    // should be 20 for this run.
    assertEquals(20.0, Math.floor(metricCollectors.currentErrorRate()), 0.1);
  }