This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package nanotime; | |
import java.util.Arrays; | |
import java.util.concurrent.TimeUnit; | |
/** | |
* Created by daniel on 28/10/2015. | |
*/ | |
public class NanoTimer { | |
public static void main(String[] args) throws InterruptedException { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package nanotime; | |
public class NanoTimer { | |
public static void main(String[] args) throws InterruptedException { | |
long[] samples = new long[1_000_000]; | |
for (int i = 0; i < samples.length; i++) { | |
long firstTime = System.nanoTime(); | |
long timeForNano = System.nanoTime() - firstTime; | |
samples[i] = timeForNano; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package nanotime; | |
import java.util.Arrays; | |
/** | |
* Created by daniel on 28/10/2015. | |
*/ | |
public class NanoTimer { | |
public static void main(String[] args) throws InterruptedException { | |
long[] samples = new long[100_000]; | |
int pauseInMicros = 1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package util; | |
import java.util.Random; | |
import java.util.stream.IntStream; | |
public class RandomString { | |
public static void main(String[] args) { | |
Random random = new Random(); | |
IntStream.range(0,10). | |
forEach(i->System.out.println(generateRandomString(random, 9))); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package test; | |
import org.slf4j.Logger; | |
import org.slf4j.LoggerFactory; | |
import java.util.List; | |
import java.util.stream.Collectors; | |
import java.util.stream.IntStream; | |
public class GCLogger { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package example; | |
import java.util.concurrent.atomic.AtomicLong; | |
import java.util.logging.Logger; | |
import java.util.stream.Stream; | |
/** | |
* Class to demonstrate the use of Monitor | |
*/ | |
public class FindSlowCode { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package comp; | |
import org.openjdk.jmh.annotations.Benchmark; | |
import org.openjdk.jmh.annotations.Fork; | |
import org.openjdk.jmh.annotations.Measurement; | |
import org.openjdk.jmh.annotations.Scope; | |
import org.openjdk.jmh.annotations.Setup; | |
import org.openjdk.jmh.annotations.State; | |
import org.openjdk.jmh.annotations.Warmup; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package comp; | |
import org.openjdk.jmh.annotations.Benchmark; | |
import org.openjdk.jmh.annotations.Scope; | |
import org.openjdk.jmh.annotations.Setup; | |
import org.openjdk.jmh.annotations.State; | |
import org.openjdk.jmh.runner.Runner; | |
import org.openjdk.jmh.runner.RunnerException; | |
import org.openjdk.jmh.runner.options.Options; | |
import org.openjdk.jmh.runner.options.OptionsBuilder; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package org.latency.quickfix; | |
import net.openhft.chronicle.core.Jvm; | |
import net.openhft.chronicle.core.jlbh.JLBHOptions; | |
import net.openhft.chronicle.core.jlbh.JLBHTask; | |
import net.openhft.chronicle.core.jlbh.JLBH; | |
import quickfix.*; | |
import quickfix.field.*; | |
import quickfix.fix42.ExecutionReport; | |
import quickfix.fix42.NewOrderSingle; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package org.latency.tcp; | |
import net.openhft.affinity.Affinity; | |
import net.openhft.chronicle.core.Jvm; | |
import net.openhft.chronicle.core.jlbh.JLBHOptions; | |
import net.openhft.chronicle.core.jlbh.JLBHTask; | |
import net.openhft.chronicle.core.jlbh.JLBH; | |
import net.openhft.chronicle.core.util.NanoSampler; | |
import java.io.EOFException; |
NewerOlder