diff options
author | Mic Bowman | 2011-04-12 15:55:21 -0700 |
---|---|---|
committer | Mic Bowman | 2011-04-12 15:55:21 -0700 |
commit | 317617cfda5356e9d375d00c93cd0d23a489107e (patch) | |
tree | be9bf263d2e40fe27776ea32738af2c2f9754697 /OpenSim | |
parent | Fixed the update of items in the priority queue to enable both (diff) | |
download | opensim-SC-317617cfda5356e9d375d00c93cd0d23a489107e.zip opensim-SC-317617cfda5356e9d375d00c93cd0d23a489107e.tar.gz opensim-SC-317617cfda5356e9d375d00c93cd0d23a489107e.tar.bz2 opensim-SC-317617cfda5356e9d375d00c93cd0d23a489107e.tar.xz |
remove packet monitoring debugging code
Diffstat (limited to 'OpenSim')
-rw-r--r-- | OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs | 118 |
1 files changed, 2 insertions, 116 deletions
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs index 92a76ac..cf04f0d 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) |
@@ -11426,11 +11347,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
11426 | OutPacket(packet, throttlePacketType, true); | 11347 | OutPacket(packet, throttlePacketType, true); |
11427 | } | 11348 | } |
11428 | 11349 | ||
11429 | /// <MIC> | ||
11430 | Dictionary<string,uint> pktsrc = new Dictionary<string,uint>(); | ||
11431 | uint pktcnt = 0; | ||
11432 | /// </MIC> | ||
11433 | |||
11434 | /// <summary> | 11350 | /// <summary> |
11435 | /// This is the starting point for sending a simulator packet out to the client | 11351 | /// This is the starting point for sending a simulator packet out to the client |
11436 | /// </summary> | 11352 | /// </summary> |
@@ -11465,36 +11381,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
11465 | if (logPacket) | 11381 | if (logPacket) |
11466 | m_log.DebugFormat("[CLIENT]: Packet OUT {0}", packet.Type); | 11382 | m_log.DebugFormat("[CLIENT]: Packet OUT {0}", packet.Type); |
11467 | } | 11383 | } |
11468 | |||
11469 | if (throttlePacketType == ThrottleOutPacketType.Task) | ||
11470 | { | ||
11471 | System.Diagnostics.StackTrace stackTrace = new System.Diagnostics.StackTrace(); // get call stack | ||
11472 | System.Diagnostics.StackFrame[] stackFrames = stackTrace.GetFrames(); // get method calls (frames) | ||
11473 | |||
11474 | string stack = ""; | ||
11475 | for (int count = 1; count < stackFrames.Length; count++) | ||
11476 | { | ||
11477 | stack += (stack == "" ? "" : ",") + stackFrames[count].GetMethod().Name; | ||
11478 | if (count > 5) break; | ||
11479 | } | ||
11480 | |||
11481 | lock(pktsrc) | ||
11482 | { | ||
11483 | if (! pktsrc.ContainsKey(stack)) | ||
11484 | pktsrc.Add(stack,0); | ||
11485 | pktsrc[stack]++; | ||
11486 | |||
11487 | if (++pktcnt > 500) | ||
11488 | { | ||
11489 | pktcnt = 0; | ||
11490 | m_log.WarnFormat("[PACKETCOUNTS] START"); | ||
11491 | foreach (KeyValuePair<string,uint> pkt in pktsrc) | ||
11492 | m_log.WarnFormat("[PACKETCOUNTS] {0,8}, {1}", pkt.Value, pkt.Key); | ||
11493 | pktsrc.Clear(); | ||
11494 | m_log.WarnFormat("[PACKETCOUNTS] END"); | ||
11495 | } | ||
11496 | } | ||
11497 | } | ||
11498 | 11384 | ||
11499 | m_udpServer.SendPacket(m_udpClient, packet, throttlePacketType, doAutomaticSplitting); | 11385 | m_udpServer.SendPacket(m_udpClient, packet, throttlePacketType, doAutomaticSplitting); |
11500 | } | 11386 | } |