Search in sources :

Example 1 with Stat

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));
}
Also used : NodeRecord(org.neo4j.kernel.impl.store.record.NodeRecord) BatchSender(org.neo4j.unsafe.impl.batchimport.staging.BatchSender) StageControl(org.neo4j.unsafe.impl.batchimport.staging.StageControl) Stat(org.neo4j.unsafe.impl.batchimport.stats.Stat) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)1 NodeRecord (org.neo4j.kernel.impl.store.record.NodeRecord)1 BatchSender (org.neo4j.unsafe.impl.batchimport.staging.BatchSender)1 StageControl (org.neo4j.unsafe.impl.batchimport.staging.StageControl)1 Stat (org.neo4j.unsafe.impl.batchimport.stats.Stat)1