private void ReportCollectionInfo(GarbageCollectionStartEvent start, GarbageCollectionEndEvent end)
        {
            var info = new GarbageCollectionInfo(
                new DateTimeOffset(start.Timestamp.ToLocalTime()),
                end.Timestamp - start.Timestamp,
                start.Generation,
                start.Number,
                start.Type,
                start.Reason);

            Task.Run(() => observable.Push(info));
        }
        private void OnGCStart(EventWrittenEventArgs @event)
        {
            var timestamp = TimestampProvider(@event);

            if (timestamp == default)
            {
                return;
            }

            var startEvent = new GarbageCollectionStartEvent(
                timestamp,
                (int)GetFieldValue <uint>(@event, "Count"),
                (int)GetFieldValue <uint>(@event, "Depth"),
                (GarbageCollectionType)GetFieldValue <uint>(@event, "Type"),
                (GarbageCollectionReason)GetFieldValue <uint>(@event, "Reason"));

            lock (startEvents)
                startEvents.Add(startEvent);
        }
 private bool Correspond(GarbageCollectionStartEvent start, GarbageCollectionEndEvent end)
 => start.Generation == end.Generation && start.Number == end.Number;