use of org.neo4j.unsafe.impl.batchimport.Configuration in project neo4j by neo4j.
the class DynamicProcessorAssignerTest method shouldAssignAdditionalCPUToBottleNeckStep.
@Test
public void shouldAssignAdditionalCPUToBottleNeckStep() throws Exception {
// GIVEN
Configuration config = movingAverageConfig(10);
DynamicProcessorAssigner assigner = new DynamicProcessorAssigner(config, 5);
ControlledStep<?> slowStep = stepWithStats("slow", 0, avg_processing_time, 10L, done_batches, 10L);
ControlledStep<?> fastStep = stepWithStats("fast", 0, avg_processing_time, 2L, done_batches, 10L);
StageExecution execution = executionOf(config, slowStep, fastStep);
assigner.start(execution);
// WHEN
assigner.check(execution);
// THEN
assertEquals(5, slowStep.processors(0));
assertEquals(1, fastStep.processors(0));
}
use of org.neo4j.unsafe.impl.batchimport.Configuration in project neo4j by neo4j.
the class DynamicProcessorAssignerTest method shouldHandleZeroAverage.
@Test
public void shouldHandleZeroAverage() throws Exception {
// GIVEN
Configuration config = movingAverageConfig(10);
DynamicProcessorAssigner assigner = new DynamicProcessorAssigner(config, 5);
ControlledStep<?> aStep = stepWithStats("slow", 0, avg_processing_time, 0L, done_batches, 0L);
ControlledStep<?> anotherStep = stepWithStats("fast", 0, avg_processing_time, 0L, done_batches, 0L);
StageExecution execution = executionOf(config, aStep, anotherStep);
assigner.start(execution);
// WHEN
assigner.check(execution);
// THEN
assertEquals(1, aStep.processors(0));
assertEquals(1, anotherStep.processors(0));
}
Aggregations