Esempio n. 1
0
 /// <summary>
 /// 收集信息
 /// </summary>
 /// <returns></returns>
 public void Coll(MonitorItem item)
 {
     TotalTime                += item.TotalTime;
     TotalProcessorTime       += item.TotalProcessorTime;
     TotalSurvivedMemorySize  += item.TotalSurvivedMemorySize;
     TotalAllocatedMemorySize += item.TotalAllocatedMemorySize;
 }
Esempio n. 2
0
 static void EndAllStepMonitorInner()
 {
     using (ThreadLockScope.Scope(LockKey))
     {
         if (MonitorItem.MonitorStack.FixValue == MonitorItem.MonitorStack.Current)
         {
             MonitorItem.MonitorStack.FixValue.Coll();
             return;
         }
         MonitorItem.MonitorStack.Current.Coll();
         MonitorItem pre = MonitorItem.MonitorStack.Current;
         MonitorItem.MonitorStack.Current.EndMessage();
         ShowMinitor(MonitorItem.MonitorStack.Current.Title, 2);
         MonitorItem.MonitorStack.Pop();
         while (MonitorItem.MonitorStack.StackCount > 0)
         {
             MonitorItem.MonitorStack.Current.Coll(pre);
             pre = MonitorItem.MonitorStack.Current;
             MonitorItem.MonitorStack.Current.EndMessage();
             ShowMinitor(MonitorItem.MonitorStack.Current.Title, 2);
             MonitorItem.MonitorStack.Pop();
         }
         if (pre != null)
         {
             MonitorItem.MonitorStack.FixValue.Coll(pre);
         }
     }
 }
Esempio n. 3
0
 /// <summary>
 /// 刷新资源检测
 /// </summary>
 public static void EndStepMonitor()
 {
     if (!LogMonitor)
     {
         return;
     }
     using (ThreadLockScope.Scope(LockKey))
     {
         if (MonitorItem.MonitorStack == null || MonitorItem.MonitorStack.Current == null)
         {
             return;
         }
         MonitorItem.MonitorStack.Current.Coll();
         if (MonitorItem.MonitorStack.StackCount == 0)
         {
             EndMonitorInner();
             return;
         }
         MonitorItem.MonitorStack.Current.EndMessage();
         ShowMinitor(MonitorItem.MonitorStack.Current.Title, 2);
         MonitorItem pre = MonitorItem.MonitorStack.Current;
         MonitorItem.MonitorStack.Pop();
         MonitorItem.MonitorStack.Current.Coll(pre);
         MonitorItem.MonitorStack.Current.Flush();
     }
 }
Esempio n. 4
0
        /// <summary>
        /// 收集信息
        /// </summary>
        /// <returns></returns>
        public void Coll(MonitorItem item)
        {
            TotalTime += item.TotalTime;
#if !NETSTANDARD2_0
            TotalProcessorTime       += item.TotalProcessorTime;
            TotalSurvivedMemorySize  += item.TotalSurvivedMemorySize;
            TotalAllocatedMemorySize += item.TotalAllocatedMemorySize;
#endif
        }
Esempio n. 5
0
        /// <summary>
        /// 刷新资源检测
        /// </summary>
        public static void EndMonitor()
        {
            if (!LogMonitor)
            {
                return;
            }
            var log = Data.End();

            if (log != null)
            {
                RecordInner(LogLevel.Trace, "Monitor", log, LogType.Monitor);
            }
            _data           = null;
            DataLocal.Value = null;
        }
Esempio n. 6
0
        /// <summary>
        /// 刷新资源检测
        /// </summary>
        public static void EndMonitor()
        {
            if (!LogMonitor || !MonitorItem.InMonitor)
            {
                return;
            }
            var log = MonitorItem.End();

            if (log != null)
            {
                RecordInner(LogLevel.Trace, "Monitor", log, LogType.Monitor);
            }
            _monitorItem           = null;
            MonitorItemLocal.Value = null;
        }