aboutsummaryrefslogtreecommitdiffstats
path: root/src/net/java/sip/communicator/impl/packetlogging/PacketLoggingServiceImpl.java
diff options
context:
space:
mode:
authorGeorge Politis <gp@jitsi.org>2016-02-29 22:09:48 +0000
committerGeorge Politis <gp@jitsi.org>2016-02-29 22:12:46 +0000
commitf96b2ef870cdcb17938e1f6484743b6a230ec5ef (patch)
treed683856bf5f73c20c0c0ec6a133d4ac8d7043081 /src/net/java/sip/communicator/impl/packetlogging/PacketLoggingServiceImpl.java
parent6f50b84df3d6a9536413ca3d51ccf812bbb0cb6c (diff)
downloadjitsi-f96b2ef870cdcb17938e1f6484743b6a230ec5ef.zip
jitsi-f96b2ef870cdcb17938e1f6484743b6a230ec5ef.tar.gz
jitsi-f96b2ef870cdcb17938e1f6484743b6a230ec5ef.tar.bz2
Increases the queue size for the PacketLoggingServiceImpl.
Diffstat (limited to 'src/net/java/sip/communicator/impl/packetlogging/PacketLoggingServiceImpl.java')
-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();
}