Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
import java.lang.management.ManagementFactory; | |
import java.lang.management.ThreadInfo; | |
import java.lang.management.ThreadMXBean; | |
import java.util.concurrent.TimeUnit; | |
import java.util.concurrent.atomic.AtomicLong; | |
import java.util.concurrent.locks.Lock; | |
import java.util.concurrent.locks.LockSupport; | |
import java.util.concurrent.locks.ReentrantLock; | |
public final class SynchronisationThroughputTest |
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
import net.bytebuddy.agent.ByteBuddyAgent; | |
import net.bytebuddy.agent.builder.AgentBuilder; | |
import net.bytebuddy.description.method.MethodDescription; | |
import net.bytebuddy.description.method.MethodList; | |
import net.bytebuddy.description.type.TypeDescription; | |
import net.bytebuddy.dynamic.DynamicType; | |
import net.bytebuddy.dynamic.scaffold.InstrumentedType; | |
import net.bytebuddy.implementation.Implementation; | |
import net.bytebuddy.implementation.MethodDelegation; | |
import net.bytebuddy.implementation.bind.annotation.Origin; |
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
/** | |
* Callback for UDP-specific statistics in /proc/net/snmp. | |
*/ | |
@FunctionalInterface | |
public interface SnmpUdpStatisticsHandler | |
{ | |
/** | |
* Callback method. | |
* @param inErrors InErrors count | |
* @param receiveBufferErrors RecvbufErrors count |
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
/** | |
* Callback for statistics from /proc/net/softnet_stat. | |
*/ | |
@FunctionalInterface | |
public interface SoftnetStatsHandler | |
{ | |
/** | |
* Callback method. | |
* @param cpuId zero-based CPU that these statistics refer to | |
* @param processed softIRQ events processed |
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
udpSocketMonitor.beginMonitoringOf(InetAddress.getByName("239.193.50.102")); |
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
/** | |
* Handler for socket statistics from /proc/net/udp. | |
*/ | |
@FunctionalInterface | |
public interface UdpSocketStatisticsHandler | |
{ | |
/** | |
* Callback method. | |
* @param inetAddress the ip address | |
* @param port the socket port |
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
public void performMatching(final Order order) { | |
transactionReporter.startOfTransaction() | |
order.executeAggressively(orderBook); | |
tradeReporter.reportTrades(order.getTrades()); | |
engine.updateAggregateOrderStatistics(); | |
transactionReporter.endOfTransaction(); |
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
public class BigDecimalBenchmark extends SimpleBenchmark | |
{ | |
private static final BigDecimal QUANTITY_DIVISOR = new BigDecimal(100); | |
private static final BigDecimal PRICE_DIVISOR = new BigDecimal(1000000); | |
private static final BigDecimal QUANTITY_INCREMENT = new BigDecimal("0.001"); | |
private static final BigDecimal PRICE_INCREMENT = new BigDecimal("0.00001"); | |
@Override | |
protected void setUp() throws Exception | |
{ |
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
static final class Unicorn | |
{ | |
private static int mainMethodLineOfLastPatInvocation = 0; | |
private static boolean pat() | |
{ | |
boolean result = false; | |
final StackTraceElement[] stackTrace = Thread.currentThread().getStackTrace(); | |
final StackTraceElement mainMethodInvocationPoint = stackTrace[3]; | |
if(mainMethodInvocationPoint.getLineNumber() != mainMethodLineOfLastPatInvocation) |