예제 #1
0
        public void ExitZone(String zoneName)
        {
            if (!GameSettings.Default.DrawDebugData || FirstFrameAfterShown)
            {
                return;
            }

            TrackerZone z;

            if (!zoneList.TryGetValue(zoneName, out z))
            {
                return; // Just give up if the zone doesn't exist.
            }
            TrackerZone cur = zone.Peek();

            if (z != zone.Peek())
            {
                throw new Exception("TrackerZone " + z.Name + " trying to exit but we are actually in " + cur.Name);
            }
            lock (internalTrackerLockObject)
            {
                foreach (KeyValuePair <string, Tracker> kvp in internalTrackers)
                {
                    kvp.Value.ExitZone();
                }
            }
            zone.Pop();
        }
예제 #2
0
 public ZoneData(TrackerZone zone, int historySize)
 {
     threadName = GamePerformance.threadName;
     if (threadName == null)
     {
         Debugger.Break();
     }
     name       = zone.Name;
     history    = new Queue <long>(historySize);
     maxHistory = historySize;
 }
예제 #3
0
        public void EnterZone(String zoneName)
        {
            int         id = ThreadID;
            TrackerZone z;

            if (!zoneList.TryGetValue(zoneName, out z))
            {
                z = new TrackerZone(zoneName);
                zoneList.TryAdd(zoneName, z);
            }
            zone.Push(z);
            lock (internalTrackerLockObject)
            {
                foreach (KeyValuePair <string, Tracker> kvp in internalTrackers)
                {
                    kvp.Value.EnterZone();
                }
            }
        }
예제 #4
0
            private ZoneData GetData(bool autoCreate = true)
            {
                ZoneData    data;
                TrackerZone z = zone.Peek();

                if (!zoneData.TryGetValue(z.ID, out data))
                {
                    if (!autoCreate)
                    {
                        return(null);
                    }
                    data = new ZoneData(z, maxHistory);
                    lock (zoneDataLockObject)
                    {
                        zoneData.Add(z.ID, data);
                    }
                    zonesUsed++;
                }
                return(data);
            }
예제 #5
0
        public void ExitZone(String zoneName)
        {
            TrackerZone z;

            if (!zoneList.TryGetValue(zoneName, out z))
            {
                throw new Exception("Unknown TrackerZone found.");
            }
            TrackerZone cur = zone.Peek();

            if (z != zone.Peek())
            {
                throw new Exception("TrackerZone " + z.Name + " trying to exit but we are actually in " + cur.Name);
            }
            lock (internalTrackerLockObject)
            {
                foreach (KeyValuePair <string, Tracker> kvp in internalTrackers)
                {
                    kvp.Value.ExitZone();
                }
            }
            zone.Pop();
        }
예제 #6
0
        public void EnterZone(String zoneName)
        {
            if (!GameSettings.Default.DrawDebugData || FirstFrameAfterShown)
            {
                return;
            }

            int         id = ThreadID;
            TrackerZone z;

            if (!zoneList.TryGetValue(zoneName, out z))
            {
                z = new TrackerZone(zoneName);
                zoneList.TryAdd(zoneName, z);
            }
            zone.Push(z);
            lock (internalTrackerLockObject)
            {
                foreach (KeyValuePair <string, Tracker> kvp in internalTrackers)
                {
                    kvp.Value.EnterZone();
                }
            }
        }