Esempio n. 1
0
        private void OnGcStop(ETWEventClrGCEnd obj)
        {
            var result = gcEventsMerger.CompleteOrNull(obj);

            if (result != null)
            {
                observers.OnNext(result);
            }
        }
Esempio n. 2
0
 internal GCInfo(ETWEventClrGCStart start, ETWEventClrGCEnd end)
 {
     StartTimestamp = start.Timestamp;
     Duration       = end.Timestamp - start.Timestamp;
     Depth          = start.Depth;
     Count          = start.Count;
     // we use custom enums here because otherwise
     // users must reference TraceEvents directly
     Type      = (GCType)start.Type;
     Reason    = (GCReason)start.Reason;
     ProcessId = start.ProcessId;
 }
Esempio n. 3
0
        public GCInfo CompleteOrNull(ETWEventClrGCEnd end)
        {
            var curNode = startEvents.Last;

            while (curNode != null)
            {
                if (Corresponds(curNode.Value, end))
                {
                    var merged = new GCInfo(curNode.Value, end);
                    Remove(curNode);
                    return(merged);
                }
                curNode = curNode.Previous;
            }

            return(null);
        }
Esempio n. 4
0
 private static bool Corresponds(ETWEventClrGCStart start, ETWEventClrGCEnd end)
 {
     return(start.Count == end.Count && start.ProcessId == end.ProcessId && start.Depth == end.Depth);
 }