aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ClientStack
diff options
context:
space:
mode:
authorMic Bowman2011-04-12 15:55:21 -0700
committerMic Bowman2011-04-13 15:37:25 -0700
commitbf91d1b07784f3c03744efd2d6dea1b621620cce (patch)
treeb58a873db3a01e8044e0fc21f689faffb43d73e9 /OpenSim/Region/ClientStack
parentFixed the update of items in the priority queue to enable both (diff)
downloadopensim-SC_OLD-bf91d1b07784f3c03744efd2d6dea1b621620cce.zip
opensim-SC_OLD-bf91d1b07784f3c03744efd2d6dea1b621620cce.tar.gz
opensim-SC_OLD-bf91d1b07784f3c03744efd2d6dea1b621620cce.tar.bz2
opensim-SC_OLD-bf91d1b07784f3c03744efd2d6dea1b621620cce.tar.xz
remove packet monitoring debugging code
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs118
1 files changed, 2 insertions, 116 deletions
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
index a6f2d09..613a921 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
@@ -300,77 +300,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
300 /// <summary>Used to adjust Sun Orbit values so Linden based viewers properly position sun</summary> 300 /// <summary>Used to adjust Sun Orbit values so Linden based viewers properly position sun</summary>
301 private const float m_sunPainDaHalfOrbitalCutoff = 4.712388980384689858f; 301 private const float m_sunPainDaHalfOrbitalCutoff = 4.712388980384689858f;
302 302
303 // First log file or time has expired, start writing to a new log file
304//<MIC>
305// -----------------------------------------------------------------
306// -----------------------------------------------------------------
307// THIS IS DEBUGGING CODE & SHOULD BE REMOVED
308// -----------------------------------------------------------------
309// -----------------------------------------------------------------
310 public class QueueLogger
311 {
312 public Int32 start = 0;
313 public StreamWriter Log = null;
314 private Dictionary<UUID,int> m_idMap = new Dictionary<UUID,int>();
315
316 public QueueLogger()
317 {
318 DateTime now = DateTime.Now;
319 String fname = String.Format("queue-{0}.log", now.ToString("yyyyMMddHHmmss"));
320 Log = new StreamWriter(fname);
321
322 start = Util.EnvironmentTickCount();
323 }
324
325 public int LookupID(UUID uuid)
326 {
327 int localid;
328 if (! m_idMap.TryGetValue(uuid,out localid))
329 {
330 localid = m_idMap.Count + 1;
331 m_idMap[uuid] = localid;
332 }
333
334 return localid;
335 }
336 }
337
338 public static QueueLogger QueueLog = null;
339
340 // -----------------------------------------------------------------
341 public void LogAvatarUpdateEvent(UUID client, UUID avatar, Int32 timeinqueue)
342 {
343 if (QueueLog == null)
344 QueueLog = new QueueLogger();
345
346 Int32 ticks = Util.EnvironmentTickCountSubtract(QueueLog.start);
347 lock(QueueLog)
348 {
349 int cid = QueueLog.LookupID(client);
350 int aid = QueueLog.LookupID(avatar);
351 QueueLog.Log.WriteLine("{0},AU,AV{1:D4},AV{2:D4},{3}",ticks,cid,aid,timeinqueue);
352 }
353 }
354
355 // -----------------------------------------------------------------
356 public void LogQueueProcessEvent(UUID client, PriorityQueue queue, uint maxup)
357 {
358 if (QueueLog == null)
359 QueueLog = new QueueLogger();
360
361 Int32 ticks = Util.EnvironmentTickCountSubtract(QueueLog.start);
362 lock(QueueLog)
363 {
364 int cid = QueueLog.LookupID(client);
365 QueueLog.Log.WriteLine("{0},PQ,AV{1:D4},{2},{3}",ticks,cid,maxup,queue.ToString());
366 }
367 }
368// -----------------------------------------------------------------
369// -----------------------------------------------------------------
370// -----------------------------------------------------------------
371// -----------------------------------------------------------------
372//</MIC>
373
374 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 303 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
375 protected static Dictionary<PacketType, PacketMethod> PacketHandlers = new Dictionary<PacketType, PacketMethod>(); //Global/static handlers for all clients 304 protected static Dictionary<PacketType, PacketMethod> PacketHandlers = new Dictionary<PacketType, PacketMethod>(); //Global/static handlers for all clients
376 305
@@ -4025,10 +3954,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
4025 OutPacket(pack, ThrottleOutPacketType.Task); 3954 OutPacket(pack, ThrottleOutPacketType.Task);
4026 } 3955 }
4027 3956
4028/// -----------------------------------------------------------------
4029/// <mic>
4030/// -----------------------------------------------------------------
4031
4032 private class ObjectPropertyUpdate : IEntityUpdate 3957 private class ObjectPropertyUpdate : IEntityUpdate
4033 { 3958 {
4034 internal bool SendFamilyProps; 3959 internal bool SendFamilyProps;
@@ -4157,8 +4082,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
4157 4082
4158 } 4083 }
4159 4084
4160 m_log.WarnFormat("[PACKETCOUNTS] queued {0} property packets with {1} blocks",ppcnt,pbcnt); 4085 // m_log.WarnFormat("[PACKETCOUNTS] queued {0} property packets with {1} blocks",ppcnt,pbcnt);
4161 m_log.WarnFormat("[PACKETCOUNTS] queued {0} family property packets with {1} blocks",fpcnt,fbcnt); 4086 // m_log.WarnFormat("[PACKETCOUNTS] queued {0} family property packets with {1} blocks",fpcnt,fbcnt);
4162 } 4087 }
4163 4088
4164 private ObjectPropertiesFamilyPacket.ObjectDataBlock CreateObjectPropertiesFamilyBlock(SceneObjectPart sop, uint requestFlags) 4089 private ObjectPropertiesFamilyPacket.ObjectDataBlock CreateObjectPropertiesFamilyBlock(SceneObjectPart sop, uint requestFlags)
@@ -4232,10 +4157,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
4232 return block; 4157 return block;
4233 } 4158 }
4234 4159
4235/// -----------------------------------------------------------------
4236/// </mic>
4237/// -----------------------------------------------------------------
4238
4239 #region Estate Data Sending Methods 4160 #region Estate Data Sending Methods
4240 4161
4241 private static bool convertParamStringToBool(byte[] field) 4162 private static bool convertParamStringToBool(byte[] field)
@@ -11433,11 +11354,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
11433 OutPacket(packet, throttlePacketType, true); 11354 OutPacket(packet, throttlePacketType, true);
11434 } 11355 }
11435 11356
11436/// <MIC>
11437 Dictionary<string,uint> pktsrc = new Dictionary<string,uint>();
11438 uint pktcnt = 0;
11439/// </MIC>
11440
11441 /// <summary> 11357 /// <summary>
11442 /// This is the starting point for sending a simulator packet out to the client 11358 /// This is the starting point for sending a simulator packet out to the client
11443 /// </summary> 11359 /// </summary>
@@ -11472,36 +11388,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
11472 if (logPacket) 11388 if (logPacket)
11473 m_log.DebugFormat("[CLIENT]: Packet OUT {0}", packet.Type); 11389 m_log.DebugFormat("[CLIENT]: Packet OUT {0}", packet.Type);
11474 } 11390 }
11475
11476 if (throttlePacketType == ThrottleOutPacketType.Task)
11477 {
11478 System.Diagnostics.StackTrace stackTrace = new System.Diagnostics.StackTrace(); // get call stack
11479 System.Diagnostics.StackFrame[] stackFrames = stackTrace.GetFrames(); // get method calls (frames)
11480
11481 string stack = "";
11482 for (int count = 1; count < stackFrames.Length; count++)
11483 {
11484 stack += (stack == "" ? "" : ",") + stackFrames[count].GetMethod().Name;
11485 if (count > 5) break;
11486 }
11487
11488 lock(pktsrc)
11489 {
11490 if (! pktsrc.ContainsKey(stack))
11491 pktsrc.Add(stack,0);
11492 pktsrc[stack]++;
11493
11494 if (++pktcnt > 500)
11495 {
11496 pktcnt = 0;
11497 m_log.WarnFormat("[PACKETCOUNTS] START");
11498 foreach (KeyValuePair<string,uint> pkt in pktsrc)
11499 m_log.WarnFormat("[PACKETCOUNTS] {0,8}, {1}", pkt.Value, pkt.Key);
11500 pktsrc.Clear();
11501 m_log.WarnFormat("[PACKETCOUNTS] END");
11502 }
11503 }
11504 }
11505 11391
11506 m_udpServer.SendPacket(m_udpClient, packet, throttlePacketType, doAutomaticSplitting); 11392 m_udpServer.SendPacket(m_udpClient, packet, throttlePacketType, doAutomaticSplitting);
11507 } 11393 }