Beispiel #1
0
        internal static void FrameTick()
        {
            // Collect more globally available data
            StatMemoryTotalUsage.Add((int)(GC.GetTotalMemory(false) / 1024L));
            StatMemoryGarbageCollect0.Add(GC.CollectionCount(0));
            StatMemoryGarbageCollect1.Add(GC.CollectionCount(1));
            StatMemoryGarbageCollect2.Add(GC.CollectionCount(2));

            // Run frametick counter operations
            foreach (ProfileCounter c in counterMap.Values.ToArray())
            {
                c.TickFrame();
            }
        }
        internal static void FrameTick()
        {
            // Collect more globally available data
            StatMemoryTotalUsage.Add((int)(GC.GetTotalMemory(false) / 1024L));
            StatMemoryGarbageCollect0.Add(GC.CollectionCount(0));
            StatMemoryGarbageCollect1.Add(GC.CollectionCount(1));
            StatMemoryGarbageCollect2.Add(GC.CollectionCount(2));

            // Run frametick counter operations
            foreach (ProfileCounter c in counterMap.Values.ToArray())
            {
                c.TickFrame();
            }

            if (NetworkMode)
            {
                NetworkProfileServer.EndFrame(counterMap.Values.Where(c => c is TimeCounter).Cast <TimeCounter>().ToList());
            }
        }
Beispiel #3
0
        internal static void FrameTick()
        {
            // Calculate unaccounted for frame time
            TimeUnaccounted.Add(TimeFrame.Value
                                - TimeUpdate.Value
                                - TimeRender.Value
                                - TimeLog.Value
                                - TimeVisualPicking.Value);

            // Collect more globally available data
            StatMemoryTotalUsage.Add((int)(GC.GetTotalMemory(false) / 1024L));
            StatMemoryGarbageCollect0.Add(GC.CollectionCount(0));
            StatMemoryGarbageCollect1.Add(GC.CollectionCount(1));
            StatMemoryGarbageCollect2.Add(GC.CollectionCount(2));

            // Run frametick counter operations
            foreach (ProfileCounter c in counterMap.Values.ToArray())
            {
                c.TickFrame();
            }
        }
Beispiel #4
0
        /// <summary>
        /// Accumulates a statistical information value to a new or existing <see cref="ProfileCounter"/> with the specified name.
        /// </summary>
        /// <param name="counter">The <see cref="ProfileCounter"/> name to use for this measurement. For nested measurements, use path strings, e.g. "ParentCounter\ChildCounter"</param>
        /// <param name="value"></param>
        public static void AddToStat(string counter, int value)
        {
            StatCounter sc = RequestCounter <StatCounter>(counter);

            sc.Add(value);
        }