Package com.higherfrequencytrading.chronicle

Examples of com.higherfrequencytrading.chronicle.Excerpt.readLong()


            try {
                for (int i = 0; i < WARMUP + RUNS; i++) {
                    do {
                        /* busy wait */
                    } while (!excerpt.index(i));
                    long next = excerpt.readLong();
                    long took = System.nanoTime() - next;
                    if (i >= WARMUP)
                        histo.sample(took);
                    else
                        warmup.sample(took);
View Full Code Here


        long[] times = new long[repeats];
        int[] nbcs = new int[repeats];
        int count = 0;
        final Excerpt excerpt2 = chronicle.createExcerpt();
        while (excerpt2.nextIndex()) {
            final long timestamp = excerpt2.readLong();
            long time = System.nanoTime() - timestamp;
            times[count] = time;
            final int nbConsolidates = excerpt2.readInt();
            nbcs[count] = nbConsolidates;
            for (int i = 0; i < nbConsolidates; i++) {
View Full Code Here

            while (!excerpt2.index(i)) {
                /* try again */
            }

            long time1 = nanoTime();
            long time0 = excerpt2.readLong();
            excerpt2.finish();
            if (i >= WARMUP) {
                final long latency = time1 - time0;
                if (latency < 0 || latency > 100000) {
                    longDelays++;
View Full Code Here

            do {
                busyWait();
            } while (!excerpt2.index(i));

            long time1 = nanoTime();
            long time0 = excerpt2.readLong();
            excerpt2.finish();
            if (i >= WARMUP) {
                final long latency = time1 - time0;
                if (latency < 0 || latency > 100000) {
                    longDelays++;
View Full Code Here

        int counter2 = 1;
        Excerpt excerpt2 = tsc.createExcerpt();
        while (excerpt2.nextIndex()) {
            for (int j = 0; j < 128; j += 8) {
                long actual = excerpt2.readLong();
                long expected = counter2++;
                if (expected != actual)
                    assertEquals(expected, actual);
            }
            assertEquals(-1, excerpt2.readByte());
View Full Code Here

                Excerpt excerpt = ic.createExcerpt();
                for (int i = 1; i <= records; i++) {
                    boolean found = excerpt.nextIndex();
                    if (!found)
                        assertTrue(found);
                    long l = excerpt.readLong();
                    double d = excerpt.readDouble();
                    if (l != i)
                        assertEquals(i, l);
                    if (d != i)
                        assertEquals((double) i, d);
View Full Code Here

                while (!excerpt.nextIndex()) {
                    // busy wait
                }
                for (int k = 0; k < batchSize; k++) {
                    char ch = (char) excerpt.readUnsignedByte();
                    long l = excerpt.readLong();
                    float d = excerpt.readFloat();
                    assert ch == 'M';
                    assert l == i;
                    assert d == (float) i;
                }
View Full Code Here

        int[] times = new int[repeats];
        for (int count = -warmup; count < repeats; count++) {
            do {
            /* busy wait */
            } while (!excerpt.nextIndex());
            final long timestamp = excerpt.readLong();
            long time = System.nanoTime() - timestamp;
            if (count >= 0)
                times[count] = (int) time;
            final int nbConsolidates = excerpt.readUnsignedShort();
            assert nbConsolidates == consolidates.length;
View Full Code Here

        Excerpt excerpt = sink.createExcerpt();
        int count = 0;
        for (int i = 1; i <= messages; i++) {
            while (!excerpt.nextIndex())
                count++;
            long n = excerpt.readLong();
            assertEquals(i, n);
            excerpt.finish();
        }
        sink.close();
        System.out.println("There were " + count + " misses");
View Full Code Here

        counter = 1;
        for (int i = 0; i < 1024; i++) {
            assertTrue(excerpt.index(i));
            for (int j = 0; j < 128; j += 8) {
                long actual = excerpt.readLong();
                long expected = counter++;
                if (expected != actual)
                    assertEquals(expected, actual);
            }
            assertEquals(-1, excerpt.readByte());
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.