Commit 23dff78b authored by Florian Fittkau's avatar Florian Fittkau

WiP

parent f60995be
......@@ -16,7 +16,7 @@ explorviz.live_trace_processing.sending_buffer_size=65536
explorviz.live_trace_processing.system_name=
explorviz.live_trace_processing.ip_address=
explorviz.live_trace_processing.host_name=
explorviz.live_trace_processing.application_name=
explorviz.live_trace_processing.application_name=EPrints
explorviz.live_trace_processing.programming_language=Java
explorviz.live_trace_processing.debug=false
......
......@@ -13,7 +13,6 @@ import org.aspectj.lang.Signature;
import com.lmax.disruptor.EventHandler;
import com.lmax.disruptor.RingBuffer;
import com.lmax.disruptor.SleepingWaitStrategy;
import com.lmax.disruptor.dsl.Disruptor;
import com.lmax.disruptor.dsl.ProducerType;
......@@ -55,7 +54,7 @@ public class MonitoringController {
final ExecutorService exec = Executors.newSingleThreadExecutor();
final Disruptor<ByteBufferEvent> disruptor = new Disruptor<ByteBufferEvent>(
ByteBufferEvent.EVENT_FACTORY, Constants.MONITORING_CONTROLLER_DISRUPTOR_SIZE,
exec, ProducerType.MULTI, new SleepingWaitStrategy(0));
exec, ProducerType.MULTI, new ThreadSleepWaitingStrategy());
final boolean androidMonitoring = configuration
.getBooleanProperty(ConfigurationFactory.ANDROID_MONITORING);
......@@ -90,9 +89,9 @@ public class MonitoringController {
configuration.getIntProperty(ConfigurationFactory.LOAD_BALANCER_PORT, 9999),
configuration.getIntProperty(ConfigurationFactory.LOAD_BALANCER_WAIT_TIME,
20000),
configuration
configuration
.getStringProperty(ConfigurationFactory.LOAD_BALANCER_SCALING_GROUP),
tcpWriter);
tcpWriter);
} else {
try {
tcpWriter.connect();
......
package explorviz.live_trace_processing.main;
import com.lmax.disruptor.AlertException;
import com.lmax.disruptor.Sequence;
import com.lmax.disruptor.SequenceBarrier;
import com.lmax.disruptor.WaitStrategy;
public final class ThreadSleepWaitingStrategy implements WaitStrategy {
@Override
public long waitFor(final long sequence, final Sequence cursor,
final Sequence dependentSequence, final SequenceBarrier barrier) throws AlertException,
InterruptedException {
long availableSequence;
while ((availableSequence = dependentSequence.get()) < sequence) {
applyWaitMethod(barrier);
}
return availableSequence;
}
@Override
public void signalAllWhenBlocking() {
}
private void applyWaitMethod(final SequenceBarrier barrier) throws AlertException {
barrier.checkAlert();
try {
Thread.sleep(1);
} catch (final InterruptedException e) {
}
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment