aboutsummaryrefslogtreecommitdiffstats
path: root/src/net
diff options
context:
space:
mode:
authorGeorge Politis <gp@jitsi.org>2016-02-29 22:28:09 +0000
committerGeorge Politis <gp@jitsi.org>2016-02-29 22:28:09 +0000
commit86edf04583cd3642c3778d43f318702dc6ddf6d2 (patch)
treed683856bf5f73c20c0c0ec6a133d4ac8d7043081 /src/net
parent6f50b84df3d6a9536413ca3d51ccf812bbb0cb6c (diff)
parentf96b2ef870cdcb17938e1f6484743b6a230ec5ef (diff)
downloadjitsi-86edf04583cd3642c3778d43f318702dc6ddf6d2.zip
jitsi-86edf04583cd3642c3778d43f318702dc6ddf6d2.tar.gz
jitsi-86edf04583cd3642c3778d43f318702dc6ddf6d2.tar.bz2
Merge pull request #231 from jitsi/packetlogging-queue-size
Increases the queue size for the PacketLoggingServiceImpl.
Diffstat (limited to 'src/net')
-rw-r--r--src/net/java/sip/communicator/impl/packetlogging/PacketLoggingServiceImpl.java16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/net/java/sip/communicator/impl/packetlogging/PacketLoggingServiceImpl.java b/src/net/java/sip/communicator/impl/packetlogging/PacketLoggingServiceImpl.java
index 6486398..90e95c9 100644
--- a/src/net/java/sip/communicator/impl/packetlogging/PacketLoggingServiceImpl.java
+++ b/src/net/java/sip/communicator/impl/packetlogging/PacketLoggingServiceImpl.java
@@ -42,6 +42,14 @@ public class PacketLoggingServiceImpl
= Logger.getLogger(PacketLoggingServiceImpl.class);
/**
+ * The max size of the <tt>EvictingQueue</tt> that the saver thread
+ * is using.
+ *
+ * TODO this needs to be configurable eventually.
+ */
+ private static final int EVICTING_QUEUE_MAX_SIZE = 1000;
+
+ /**
* The OutputStream we are currently writing to.
*/
private FileOutputStream outputStream = null;
@@ -768,7 +776,8 @@ public class PacketLoggingServiceImpl
/**
* List of packets queued to be written in the file.
*/
- private final Queue<Packet> pktsToSave = EvictingQueue.create(10);
+ private final EvictingQueue<Packet> pktsToSave
+ = EvictingQueue.create(EVICTING_QUEUE_MAX_SIZE);
/**
* Initializes a new <tt>SaverThread</tt>.
@@ -843,6 +852,11 @@ public class PacketLoggingServiceImpl
*/
public synchronized void queuePacket(Packet packet)
{
+ if (pktsToSave.remainingCapacity() == 0)
+ {
+ logger.warn("Queue is full, packets are being evicted.");
+ }
+
pktsToSave.add(packet);
notifyAll();
}