Ejemplo n.º 1
0
 /// <summary>
 ///     刷新资源检测
 /// </summary>
 public string End()
 {
     InMonitor = false;
     try
     {
         MonitorData pre = null;
         while (Stack.StackCount > 0)
         {
             Stack.Current.Coll(pre);
             Stack.Current.EndMessage();
             Write(Stack.Current.Title, ItemType.End);
             pre = Stack.Current;
             Stack.Pop();
         }
         Stack.Current.Coll(pre);
         Stack.FixValue.EndMessage();
         Write(Stack.FixValue.Title ?? "Monitor", ItemType.End);
         return(Texter.ToString());
     }
     catch (Exception ex)
     {
         LogRecorder.SystemTrace(LogLevel.Error, "EndMonitor", ex);
         return(null);
     }
     finally
     {
         Texter.Clear();
     }
 }
Ejemplo n.º 2
0
        /// <summary>
        ///     收集信息
        /// </summary>
        /// <returns></returns>
        internal void Coll(MonitorData item)
        {
            if (item == null)
            {
                Coll();
                return;
            }
            TotalTime += item.TotalTime;
#if !NETCOREAPP
            TotalProcessorTime       += item.TotalProcessorTime;
            TotalSurvivedMemorySize  += item.TotalSurvivedMemorySize;
            TotalAllocatedMemorySize += item.TotalAllocatedMemorySize;
#endif
        }