@Test public void targetedSweepDoesNotRegisterExcludedOutcomes() { targetedSweepMetrics.registerOccurrenceOf(CONSERVATIVE, SweepOutcome.SUCCESS); targetedSweepMetrics.registerOccurrenceOf(THOROUGH, SweepOutcome.SUCCESS); Arrays.stream(SweepOutcome.values()) .filter(outcome -> !SweepOutcomeMetrics.TARGETED_OUTCOMES.contains(outcome)) .forEach(outcome -> assertThat(metricsManager).hasNotRegisteredTargetedOutcome(CONSERVATIVE, outcome)); Arrays.stream(SweepOutcome.values()) .filter(outcome -> !SweepOutcomeMetrics.TARGETED_OUTCOMES.contains(outcome)) .forEach(outcome -> assertThat(metricsManager).hasNotRegisteredTargetedOutcome(THOROUGH, outcome)); }
public void registerOccurrenceOf(SweepOutcome outcome) { if (outcome == SweepOutcome.FATAL) { metrics.get().fatal().set(true); return; } metrics.get().reservoir().update(outcome.ordinal()); }
SweepOutcomeMetrics { public void registerOccurrenceOf(SweepOutcome outcome) { if (outcome == SweepOutcome.FATAL) { metrics.get().fatal().set(true); return; } metrics.get().reservoir().update(outcome.ordinal()); } }
SweepOutcomeMetrics { public void registerOccurrenceOf(SweepOutcome outcome) { if (outcome == SweepOutcome.FATAL) { metrics.get().fatal().set(true); return; } metrics.get().reservoir().update(outcome.ordinal()); } private  SweepOutcomeMetrics(Supplier<Metrics> metrics); }
SweepOutcomeMetrics { public void registerOccurrenceOf(SweepOutcome outcome) { if (outcome == SweepOutcome.FATAL) { metrics.get().fatal().set(true); return; } metrics.get().reservoir().update(outcome.ordinal()); } private  SweepOutcomeMetrics(Supplier<Metrics> metrics); static SweepOutcomeMetrics registerLegacy(MetricsManager metricsManager); static SweepOutcomeMetrics registerTargeted(
            MetricsManager metricsManager,
            Map<String, String> strategyTag,
            MetricPublicationFilter filter); void registerOccurrenceOf(SweepOutcome outcome); }
SweepOutcomeMetrics { public void registerOccurrenceOf(SweepOutcome outcome) { if (outcome == SweepOutcome.FATAL) { metrics.get().fatal().set(true); return; } metrics.get().reservoir().update(outcome.ordinal()); } private  SweepOutcomeMetrics(Supplier<Metrics> metrics); static SweepOutcomeMetrics registerLegacy(MetricsManager metricsManager); static SweepOutcomeMetrics registerTargeted(
            MetricsManager metricsManager,
            Map<String, String> strategyTag,
            MetricPublicationFilter filter); void registerOccurrenceOf(SweepOutcome outcome); static final List<SweepOutcome> LEGACY_OUTCOMES; static final List<SweepOutcome> TARGETED_OUTCOMES; }