net.openhft.chronicle.core.jlbh.JLBH Java Examples

The following examples show how to use net.openhft.chronicle.core.jlbh.JLBH. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: MapJLBHTest.java    From Chronicle-Map with Apache License 2.0 6 votes vote down vote up
@Override
public void init(JLBH jlbh) {
    IOTools.deleteDirWithFiles("perfmap", 10);
    mapFile.getParentFile().mkdirs();
    readSampler = jlbh.addProbe("Read");
    writeSampler = jlbh.addProbe("Write");
    e2eSampler = jlbh;

    Byteable byteable = (Byteable) datum;
    long capacity = byteable.maxSize();
    byteable.bytesStore(NativeBytesStore.nativeStore(capacity), 0, capacity);

    try {
        write = ChronicleMapBuilder.of(Long.class, IFacade.class).constantValueSizeBySample(datum).entries(1_100_000).createOrRecoverPersistedTo(mapFile);
        read = ChronicleMapBuilder.of(Long.class, IFacade.class).constantValueSizeBySample(datum).entries(1_100_000).createOrRecoverPersistedTo(mapFile);
    } catch (IOException ex) {
        Jvm.rethrow(ex);
    }
}
 
Example #2
Source File: QueueMultiThreadedJLBHBenchmark.java    From Chronicle-Queue with Apache License 2.0 6 votes vote down vote up
@Override
public void init(JLBH jlbh) {
    IOTools.deleteDirWithFiles("replica", 10);

    sourceQueue = single("replica").build();
    sinkQueue = single("replica").build();
    appender = sourceQueue.acquireAppender();
    tailer = sinkQueue.createTailer();
    new Thread(() -> {
        Datum datum2 = new Datum();
        while (true) {
            try (DocumentContext dc = tailer.readingDocument()) {
                if (dc.wire() == null)
                    continue;
                datum2.readMarshallable(dc.wire().bytes());
                jlbh.sample(System.nanoTime() - datum2.ts);
            }
        }
    }).start();
}
 
Example #3
Source File: QueueSingleThreadedJLBHBenchmark.java    From Chronicle-Queue with Apache License 2.0 6 votes vote down vote up
@Override
public void init(JLBH jlbh) {
    IOTools.deleteDirWithFiles("replica", 10);

    Byteable byteable = (Byteable) datum;
    long capacity = byteable.maxSize();
    byteable.bytesStore(NativeBytesStore.nativeStore(capacity), 0, capacity);
    datumBytes = ((Byteable) datum).bytesStore();
    datumWrite = datumBytes.bytesForWrite();

    sourceQueue = single("replica").build();
    sinkQueue = single("replica").build();
    appender = sourceQueue.acquireAppender();
    tailer = sinkQueue.createTailer();
    this.jlbh = jlbh;
}
 
Example #4
Source File: QueueLargeMessageJLBHBenchmark.java    From Chronicle-Queue with Apache License 2.0 5 votes vote down vote up
@Override
public void init(JLBH jlbh) {
    IOTools.deleteDirWithFiles("large", 3);

    sourceQueue = single("large").blockSize(1L << 30).build();
    sinkQueue = single("large").blockSize(1L << 30).build();
    appender = sourceQueue.acquireAppender();
    tailer = sinkQueue.createTailer();
    this.jlbh = jlbh;
}
 
Example #5
Source File: OMSBenchmarkMain.java    From Chronicle-Queue-Demo with Apache License 2.0 4 votes vote down vote up
@Override
public void init(JLBH jlbh) {
    this.jlbh = jlbh;
}
 
Example #6
Source File: ByteArrayJLBHBenchmark.java    From Chronicle-Queue with Apache License 2.0 4 votes vote down vote up
@Override
public void init(JLBH jlbh) {
    this.jlbh = jlbh;
}