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

            if (_eventPairTimer.TryGetEventPairDuration(e, out var duration))
            {
                ScheduleDelay.Observe(duration.TotalSeconds);
            }
        }
コード例 #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);
            }
        }
コード例 #4
0
 public bool TestEvent()
 {
     return(timer.TryGetEventPairDuration(eventArgs, out var duration));
 }
コード例 #5
0
        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));
        }