public void ProcessEvent(EventWrittenEventArgs e)
 {
     if (_eventPairTimer.TryGetEventPairDuration(e, out var duration))
     {
         ContentionTotal.TrackValue(1);
         ContentionSecondsTotal.TrackValue(duration.TotalSeconds);
     }
 }
Esempio n. 2
0
        public void ProcessEvent(EventWrittenEventArgs e)
        {
            if (e.EventId == EventIdThreadPoolEnqueueWork)
            {
                ScheduledCount.Inc();
            }

            if (_eventPairTimer.TryGetEventPairDuration(e, out var duration))
            {
                ScheduleDelay.Observe(duration.TotalSeconds);
            }
        }
Esempio n. 3
0
        public void ProcessEvent(EventWrittenEventArgs e)
        {
            if (_eventPairTimer.TryGetEventPairDuration(e, out var duration))
            {
                // dynamic methods are of special interest to us- only a certain number of JIT'd dynamic methods
                // will be cached. Frequent use of dynamic can cause methods to be evicted from the cache and re-JIT'd
                var methodFlags       = (uint)e.Payload[5];
                var dynamicLabelValue = (methodFlags & 0x1) == 0x1 ? LabelValueTrue : LabelValueFalse;

                MethodsJittedTotal.TrackValue(1, dynamicLabelValue);
                MethodsJittedSecondsTotal.TrackValue(duration.TotalSeconds, dynamicLabelValue);
            }
        }
Esempio n. 4
0
 public bool TestEvent()
 {
     return(timer.TryGetEventPairDuration(eventArgs, out var duration));
 }
        public void TryGetEventPairDuration_ignores_events_that_its_not_configured_to_look_for()
        {
            var nonMonitoredEvent = CreateEventWrittenEventArgs(3);

            Assert.That(_eventPairTimer.TryGetEventPairDuration(nonMonitoredEvent, out var duration), Is.False);
            Assert.That(duration, Is.EqualTo(TimeSpan.Zero));
        }