use of com.netflix.titus.common.framework.scheduler.model.event.ScheduleUpdateEvent in project titus-control-plane by Netflix.
the class LocalSchedulerTransactionLoggerTest method testDoFormatNewAction.
@Test
public void testDoFormatNewAction() {
Schedule firstCompleted = updateStatus(REFERENCE_SCHEDULE, newSchedulingStatus(SchedulingState.Succeeded));
Schedule nextAction = firstCompleted.toBuilder().withCurrentAction(ScheduledAction.newBuilder().withId("reference").withStatus(newSchedulingStatus(SchedulingState.Waiting)).withIteration(ExecutionId.initial()).build()).withCompletedActions(Collections.singletonList(firstCompleted.getCurrentAction())).build();
verify(LocalSchedulerTransactionLogger.doFormat(new ScheduleUpdateEvent(nextAction)));
}
use of com.netflix.titus.common.framework.scheduler.model.event.ScheduleUpdateEvent in project titus-control-plane by Netflix.
the class DefaultLocalSchedulerPerf method observeEvents.
private void observeEvents(ScheduleReference reference) {
localScheduler.events().filter(e -> e.getSchedule().getId().equals(reference.getSchedule().getId())).subscribe(event -> {
if (event instanceof ScheduleUpdateEvent) {
ScheduleUpdateEvent updateEvent = (ScheduleUpdateEvent) event;
ScheduledAction action = updateEvent.getSchedule().getCurrentAction();
if (action.getStatus().getState() == SchedulingStatus.SchedulingState.Failed) {
eventFailures.incrementAndGet();
}
} else if (event instanceof ScheduleRemovedEvent) {
removedEvents.incrementAndGet();
}
});
}
Aggregations