Skip to content

Commit

Permalink
Added statistics on events sent
Browse files Browse the repository at this point in the history
  • Loading branch information
delas committed Apr 28, 2015
1 parent 3fe16f1 commit d00955f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion libPlgStream/src/plg/stream/model/Streamer.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ public class Streamer extends Thread {

private BroadcastService broadcaster;
private StreamBuffer buffer;
private long streamedEvents = 0;
private long generatedInstances = 0;
private long timeLastEvent = -1;

Expand Down Expand Up @@ -75,7 +76,7 @@ public synchronized void startStream() {
infoTimer = new Timer(2500, new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
Logger.instance().debug("Stream buffer size: " + buffer.eventsInQueue() + ", traces generated: " + generatedInstances);
Logger.instance().debug("Stream buffer size: " + buffer.eventsInQueue() + ", traces generated: " + generatedInstances + ", events sent: " + streamedEvents);
}
});
infoTimer.start();
Expand Down Expand Up @@ -195,6 +196,7 @@ protected synchronized void streamEvent() {
// update the event time to use the current time
toStream.setDate(new Date());
broadcaster.send(toStream);
streamedEvents++;

// if necessary, update the buffer
if (buffer.needsTraces()) {
Expand Down

0 comments on commit d00955f

Please sign in to comment.