use of com.github.nagyesta.abortmission.core.extractor.DependencyNameExtractor in project abort-mission by nagyesta.
the class MissionOutlineDefinition method defineOutline.
@Override
@SuppressWarnings("checkstyle:MagicNumber")
protected Map<String, Consumer<AbortMissionCommandOps>> defineOutline() {
final DependencyNameExtractor extractor = new TagDependencyNameExtractor();
final DataSource dataSource = H2DataSourceProvider.createDefaultDataSource(PORT_NUMBER);
final Map<String, Consumer<AbortMissionCommandOps>> plan = new HashMap<>();
plan.put(STATIC_FIRE, ops -> {
final StageStatisticsCollectorFactory factory = getCollectorFactory(STATIC_FIRE, dataSource);
final MissionHealthCheckMatcher sideBoosterMatcher = matcher().dependencyWith(SIDE_BOOSTER).extractor(extractor).build();
final MissionHealthCheckMatcher centerCoreMatcher = matcher().dependencyWith(CENTER_CORE).extractor(extractor).build();
ops.registerHealthCheck(percentageBasedEvaluator(sideBoosterMatcher, factory).abortThreshold(10).burnInTestCount(2).build());
ops.registerHealthCheck(percentageBasedEvaluator(centerCoreMatcher, factory).build());
});
plan.put(PARALLEL, ops -> {
final StageStatisticsCollectorFactory factory = getCollectorFactory(PARALLEL, dataSource);
final MissionHealthCheckMatcher anyClassMatcher = matcher().anyClass().build();
ops.registerHealthCheck(reportOnlyEvaluator(anyClassMatcher, factory).build());
});
return plan;
}
use of com.github.nagyesta.abortmission.core.extractor.DependencyNameExtractor in project abort-mission by nagyesta.
the class MissionOutlineDefinition method defineOutline.
@Override
@SuppressWarnings("checkstyle:MagicNumber")
protected Map<String, Consumer<AbortMissionCommandOps>> defineOutline() {
final DependencyNameExtractor extractor = new TagDependencyNameExtractor();
final Registry registry = RmiServiceProvider.lookupRegistry(RmiServerConstants.DEFAULT_RMI_PORT);
final Map<String, Consumer<AbortMissionCommandOps>> plan = new HashMap<>();
plan.put(STATIC_FIRE, ops -> {
final StageStatisticsCollectorFactory factory = getCollectorFactory(STATIC_FIRE, registry);
final MissionHealthCheckMatcher sideBoosterMatcher = matcher().dependencyWith(SIDE_BOOSTER).extractor(extractor).build();
final MissionHealthCheckMatcher centerCoreMatcher = matcher().dependencyWith(CENTER_CORE).extractor(extractor).build();
ops.registerHealthCheck(percentageBasedEvaluator(sideBoosterMatcher, factory).abortThreshold(10).burnInTestCount(2).build());
ops.registerHealthCheck(percentageBasedEvaluator(centerCoreMatcher, factory).build());
});
plan.put(PARALLEL, ops -> {
final StageStatisticsCollectorFactory factory = getCollectorFactory(PARALLEL, registry);
final MissionHealthCheckMatcher anyClassMatcher = matcher().anyClass().build();
ops.registerHealthCheck(reportOnlyEvaluator(anyClassMatcher, factory).build());
});
return plan;
}
Aggregations