Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
Oleg Veramei committed Mar 14, 2017
2 parents 8e76d65 + 4064295 commit a7b975b
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 35 deletions.
1 change: 1 addition & 0 deletions _config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
theme: jekyll-theme-minimal
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public void userApplicationIsSubscribedToInstrumentStateChanges(int securityId,
final MdpChannel handler = mdpHandlerHolder.get(handlerId);
handler.registerListener(new VoidChannelListener() {
@Override
public void onInstrumentStateChanged(String channelId, int securityId, InstrumentState prevState, InstrumentState newState) {
public void onInstrumentStateChanged(String channelId, int securityId, String secDesc, InstrumentState prevState, InstrumentState newState) {
//System.out.println(String.format("%1$d %2$s %3$s ", securityId, prevState.toString(), newState.toString()));
stateChangeEvents.offer(new InstrumentStateChangeEvent(securityId, prevState, newState));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
import static com.epam.cme.mdp3.sbe.message.SbeConstants.MESSAGE_SEQ_NUM_OFFSET;

public class IncrementalRefreshPerfTest {
private static final int TEST_PACKET_ARRAY_SIZE = 7000000;
private static final int TEST_CHANNEL_ID = 311;
private static SbeDouble doubleVal = SbeDouble.instance();
private static MdpChannelBuilder mdpHandlerBuilder;
Expand Down Expand Up @@ -261,7 +262,7 @@ public void doSetup() throws Exception {
final MdpPacket samplePckt = findSample(testData, 12, 14, 5, 6);
System.out.println("The found MDP Packet sample:");
printPacket(samplePckt);
final Set<Integer> secIds = generateTestPackets(samplePckt, 5000000);
final Set<Integer> secIds = generateTestPackets(samplePckt, TEST_PACKET_ARRAY_SIZE);
System.out.println("Generating test MDP packets...Done");

System.out.println("Creating Data Handler instance...");
Expand Down Expand Up @@ -301,40 +302,9 @@ public void doShutdown() throws Exception {
@OutputTimeUnit(TimeUnit.MICROSECONDS)
@Fork(1)
@Warmup(iterations = 2, time = 3, timeUnit = TimeUnit.SECONDS)
@Measurement(iterations = 3, time = 4, timeUnit = TimeUnit.SECONDS)
@Measurement(iterations = 3, time = 3, timeUnit = TimeUnit.SECONDS)
public int testJitter(IncrementalRefreshTestState testState) {
testState.handleTestPacket(testState.testPkctSeqNum);
return testState.increaseTestSeqNum();
}

/*public static void main(String args[]) {
final IncrementalRefreshTestState testState = new IncrementalRefreshTestState();
final DoubleFunction<Double> df = (d) -> d / 1000;
try {
try {
testState.doSetup();
Histogram h = new Histogram(32, 4);
long prev = System.nanoTime();
for (int i = 0; i < 100000; i++) {
testState.handleTestPacket();
long now = System.nanoTime();
long time = now - prev;
prev = now;
}
for (int i = 0; i < 500000; i++) {
testState.handleTestPacket();
long now = System.nanoTime();
long time = now - prev;
h.sample(time);
prev = now;
}
System.out.println(h.toLongMicrosFormat(df));
} finally {
testState.doShutdown();
}
} catch (Exception e) {
e.printStackTrace();
}
}*/
}
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,9 @@ public boolean cancelShutdownIfStarted() {

public boolean shutdown() {
final boolean res = this.feedState.compareAndSet(ACTIVE, PENDING_SHUTDOWN);
selector.wakeup();
if (res && selector != null) {
selector.wakeup();
}
return res;
}

Expand Down

0 comments on commit a7b975b

Please sign in to comment.