use of org.neo4j.unsafe.impl.batchimport.stats.Stat in project neo4j by neo4j.
the class UpdateRecordsStepTest method ioThroughputStatDoesNotOverflow.
@Test
public void ioThroughputStatDoesNotOverflow() throws Throwable {
// store with huge record size to force overflow and not create huge batch of records
RecordStore<NodeRecord> store = mock(RecordStore.class);
when(store.getRecordSize()).thenReturn(Integer.MAX_VALUE / 2);
Configuration configuration = mock(Configuration.class);
StageControl stageControl = mock(StageControl.class);
UpdateRecordsStep<NodeRecord> step = new UpdateRecordsStep<>(stageControl, configuration, store);
NodeRecord record = new NodeRecord(1);
record.setInUse(true);
NodeRecord[] batch = new NodeRecord[11];
Arrays.fill(batch, record);
step.process(batch, mock(BatchSender.class));
Stat stat = step.stat(Keys.io_throughput);
assertThat(stat.asLong(), greaterThan(0L));
}
Aggregations