public SystemWorkloadManagerLogEntry(SystemWorkloadManagerLogEntryType type, ResourceKey resource, WorkloadClassification classification, SystemWorkloadManagerEvent currentEvent, SystemWorkloadManagerEvent previousEvent) { this.Type = type; this.Resource = resource; this.Classification = classification; this.CurrentEvent = currentEvent; this.PreviousEvent = previousEvent; }
private static void Record(ref SystemWorkloadManagerLogEntry lastEntry, SystemWorkloadManagerLogEntryType type, ResourceKey resource, WorkloadClassification classification, ResourceLoad load, int slots, bool delayed) { if ((SystemWorkloadManagerBlackBox.active == null || SystemWorkloadManagerBlackBox.active.Contains(classification)) && (lastEntry == null || lastEntry.CurrentEvent.Load.State != load.State || lastEntry.CurrentEvent.Slots != slots || lastEntry.CurrentEvent.Delayed != delayed)) { SystemWorkloadManagerEvent currentEvent = new SystemWorkloadManagerEvent(load, slots, delayed); lock (SystemWorkloadManagerBlackBox.history) { while (SystemWorkloadManagerBlackBox.history.Count >= SystemWorkloadManagerBlackBox.maxHistoryDepth) { SystemWorkloadManagerBlackBox.history.Dequeue(); } if (lastEntry == null) { lastEntry = new SystemWorkloadManagerLogEntry(type, resource, classification, currentEvent, null); SystemWorkloadManagerBlackBox.history.Enqueue(lastEntry); } else { lastEntry = new SystemWorkloadManagerLogEntry(type, resource, classification, currentEvent, lastEntry.CurrentEvent); SystemWorkloadManagerBlackBox.history.Enqueue(lastEntry); } } } }