Skip to content
Snippets Groups Projects
Commit 66099993 authored by Florian Fittkau's avatar Florian Fittkau
Browse files

working prototype

parent a0d209fe
No related branches found
No related tags found
No related merge requests found
......@@ -13,7 +13,7 @@ public final class CountingThroughputFilter {
public CountingThroughputFilter(final String beforeOut) {
this.beforeOut = beforeOut;
intervalSize = 1 * 1000 * 1000;
intervalSize = 1 * 1000 * 1000 * 1000;
}
private void processEvent(final Object event, final long currentTime) {
......@@ -35,7 +35,7 @@ public final class CountingThroughputFilter {
}
public final void inputObjects(final Object object) {
processEvent(object, System.currentTimeMillis() * 1000);
processEvent(object, System.currentTimeMillis() * 1000 * 1000);
}
private long computeFirstTimestampInInterval(final long timestamp) {
......
......@@ -40,12 +40,12 @@ public final class TraceReconstructionFilter implements
RecordEvent.EVENT_FACTORY, 16384, exec);
final EventHandler<RecordEvent>[] eventHandlers = new EventHandler[1];
eventHandlers[0] = new TracePatternSummarizationFilter(5 * 1000 * 1000,
endReceiver);
eventHandlers[0] = new TracePatternSummarizationFilter(
2 * 1000 * 1000 * 1000, endReceiver);
disruptor.handleEventsWith(eventHandlers);
ringBuffer = disruptor.start();
new TimeReader(1 * 1000 * 1000, this).start();
new TimeReader(2 * 1000, this).start();
}
@Override
......
......@@ -47,7 +47,7 @@ public class TracePatternSummarizationFilter implements
disruptor.handleEventsWith(eventHandlers);
}
ringBuffer = disruptor.start();
new TimeReader(1 * 1000 * 1000, this).start();
new TimeReader(1 * 1000, this).start();
}
@Override
......
......@@ -36,8 +36,8 @@ public class MessageDistributer implements EventHandler<ByteArrayEvent> {
RecordEvent.EVENT_FACTORY, 32768, exec);
final EventHandler<RecordEvent>[] eventHandlers = new EventHandler[1];
eventHandlers[0] = new TraceReconstructionFilter(5 * 1000 * 1000,
endReceiver);
eventHandlers[0] = new TraceReconstructionFilter(
1 * 1000 * 1000 * 1000, endReceiver);
disruptor.handleEventsWith(eventHandlers);
ringBuffer = disruptor.start();
}
......
......@@ -11,9 +11,9 @@ public final class TimeReader {
private final IPeriodicTimeSignalReceiver receiver;
public TimeReader(final long periodInNanoSec,
public TimeReader(final long periodInMilliSec,
final IPeriodicTimeSignalReceiver receiver) {
period = periodInNanoSec;
period = periodInMilliSec;
this.receiver = receiver;
executorService = new ScheduledThreadPoolExecutor(1);
}
......@@ -24,7 +24,7 @@ public final class TimeReader {
public void run() {
sendTimestampEvent();
}
}, 0, period, TimeUnit.NANOSECONDS);
}, 0, period, TimeUnit.MILLISECONDS);
}
protected void sendTimestampEvent() {
......
......@@ -30,7 +30,7 @@ public final class RuntimeStatisticInformation implements Serializable {
private static final long serialVersionUID = -1628273045707598143L;
private long count = 0;
private int count = 0;
private long min = Long.MAX_VALUE;
private long max = Long.MIN_VALUE;
......@@ -41,7 +41,7 @@ public final class RuntimeStatisticInformation implements Serializable {
set(runtime);
}
public long getCount() {
public int getCount() {
return count;
}
......@@ -56,8 +56,7 @@ public final class RuntimeStatisticInformation implements Serializable {
public long getAvg() {
if (count > 0) {
return (long) (sum / count);
}
else {
} else {
return -1;
}
......@@ -66,8 +65,7 @@ public final class RuntimeStatisticInformation implements Serializable {
public long getStandardDeviation() {
if (count <= 2) {
return -1;
}
else {
} else {
final double variance = (squareSum - ((sum * sum) / count))
/ (count - 1);
return (long) Math.sqrt(variance);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment