Example #1
0
 private void Dynamic_All(TraceEvent traceEvent)
 {
     if (Filter != null && !Filter(traceEvent))
     {
         return;
     }
     OnEvent(traceEvent, traceEvent.GetPayload());
 }
Example #2
0
        private void OnTrigger(TraceEvent traceEvent)
        {
            var    payload     = traceEvent.GetPayload();
            string counterName = (string)payload["Name"];

            if (counterName == "requests-per-second")
            {
                var increment = (double)payload["Increment"];
                if (increment > 0)
                {
                    Console.WriteLine($"{counterName} - {increment}");
                }
            }
            //if (counterName == "current-requests")
            //{
            //    var count = (int)payload["Count"];
            //    var mean = (double)payload["Mean"];
            //    if (count > 0)
            //    {
            //        Console.WriteLine($"{counterName} - {count} - {mean}");
            //    }
            //}
        }
Example #3
0
 private void OnTrigger(TraceEvent traceEvent)
 {
     if (traceEvent.EventName == "GC/AllocationTick")
     {
         var obj = traceEvent as GCAllocationTickTraceData;
         Console.WriteLine($"{obj.ClrInstanceID} - {obj.TypeName} - {obj.AllocationAmount} - {obj.AllocationKind}");
     }
     else
     {
         var payload = traceEvent.GetPayload();
         if (payload == null)
         {
             return;
         }
         var name = payload["Name"]?.ToString();
         if (name == "working-set")
         {
             var mean  = (double)payload["Mean"];
             var units = payload["DisplayUnits"].ToString();
             Console.WriteLine($"Working-set: {mean}{units}");
         }
     }
 }
Example #4
0
 private void Dynamic_All(TraceEvent traceEvent)
 {
     OnEvent(traceEvent, traceEvent.GetPayload());
 }