private void Dynamic_All(TraceEvent traceEvent) { if (Filter != null && !Filter(traceEvent)) { return; } OnEvent(traceEvent, traceEvent.GetPayload()); }
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}"); // } //} }
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}"); } } }
private void Dynamic_All(TraceEvent traceEvent) { OnEvent(traceEvent, traceEvent.GetPayload()); }