private void assertAllTimeSpentInQueueing(QueryState expectedState, Consumer<QueryStateMachine> stateTransition) { TestingTicker ticker = new TestingTicker(); QueryStateMachine stateMachine = createQueryStateMachineWithTicker(ticker); ticker.increment(7, MILLISECONDS); stateTransition.accept(stateMachine); assertEquals(stateMachine.getQueryState(), expectedState); QueryStats queryStats = stateMachine.getQueryInfo(Optional.empty()).getQueryStats(); assertEquals(queryStats.getQueuedTime(), new Duration(7, MILLISECONDS)); assertEquals(queryStats.getResourceWaitingTime(), new Duration(0, MILLISECONDS)); assertEquals(queryStats.getTotalPlanningTime(), new Duration(0, MILLISECONDS)); assertEquals(queryStats.getExecutionTime(), new Duration(0, MILLISECONDS)); assertEquals(queryStats.getFinishingTime(), new Duration(0, MILLISECONDS)); }
assertNotNull(queryStats.getExecutionTime()); assertNotNull(queryStats.getTotalPlanningTime()); assertNotNull(queryStats.getFinishingTime());
assertEquals(actual.getFinishingTime(), new Duration(200, NANOSECONDS));
assertEquals(queryStats.getTotalPlanningTime().toMillis(), 200); assertEquals(queryStats.getFinishingTime().toMillis(), 0);
queryStats.getDistributedPlanningTime(), queryStats.getTotalPlanningTime(), queryStats.getFinishingTime(), queryStats.getTotalTasks(), queryStats.getRunningTasks(),
assertEquals(actual.getFinishingTime(), new Duration(200, NANOSECONDS));
assertNull(queryStats.getTotalPlanningTime()); assertNull(queryStats.getExecutionStartTime()); assertNull(queryStats.getFinishingTime()); assertNull(queryStats.getEndTime()); assertNull(queryStats.getTotalPlanningTime()); assertNull(queryStats.getExecutionStartTime()); assertNull(queryStats.getFinishingTime()); assertNull(queryStats.getEndTime()); assertNotNull(queryStats.getTotalPlanningTime()); assertNull(queryStats.getExecutionStartTime()); assertNull(queryStats.getFinishingTime()); assertNull(queryStats.getEndTime()); assertNotNull(queryStats.getTotalPlanningTime()); assertNotNull(queryStats.getExecutionStartTime()); assertNull(queryStats.getFinishingTime()); assertNull(queryStats.getEndTime()); assertNotNull(queryStats.getTotalPlanningTime()); assertNotNull(queryStats.getExecutionStartTime()); assertNull(queryStats.getFinishingTime()); assertNull(queryStats.getEndTime()); assertNotNull(queryStats.getTotalPlanningTime()); assertNotNull(queryStats.getExecutionStartTime()); assertNotNull(queryStats.getFinishingTime()); assertNotNull(queryStats.getEndTime());