private void ApplyDescriptionFilterToEventTree(HashSet <Object> filter) { if (filter == null) { SummaryTable.FilterSummaryControl.Visibility = Visibility.Collapsed; } else { Application.Current.Dispatcher.BeginInvoke(new Action(() => { if (frame is EventFrame) { double time = (frame as EventFrame).CalculateFilteredTime(filter); SummaryTable.FilterSummaryText.Content = String.Format("Filter Coverage: {0:0.###}ms", time).Replace(',', '.'); } else if (frame is SamplingFrame) { SamplingFrame samplingFrame = frame as SamplingFrame; double count = samplingFrame.Root.CalculateFilteredTime(filter); SummaryTable.FilterSummaryText.Content = String.Format("Filter Coverage: {0:0.###}% ({1}/{2})", 100.0 * count / samplingFrame.Root.Duration, count, samplingFrame.Root.Duration).Replace(',', '.'); } SummaryTable.FilterSummaryControl.Visibility = Visibility.Visible; })); } }
protected override void Update(FrameGroup group, EventDescription desc) { SamplingFrame frame = (group != null && desc != null) ? group.CreateSamplingFrame(desc, Reason) : null; OnLoaded?.Invoke(frame); base.Update(group, desc); }
void Init() { if (DataContext is SamplingFrame) { SamplingFrame frame = DataContext as SamplingFrame; } }
private void SampleFunction(EventFrame eventFrame, CallStackReason callstackFilter, EventNode node) { List <Callstack> callstacks = new List <Callstack>(); FrameGroup group = eventFrame.Group; EventDescription desc = node.Entry.Description; callstacks = group.GetCallstacks(desc); if (callstacks.Count > 0) { SamplingFrame frame = new SamplingFrame(callstacks, group); FocusFrameEventArgs args = new FocusFrameEventArgs(GlobalEvents.FocusFrameEvent, frame); RaiseEvent(args); } }
public override void SetFrame(Data.Frame frame, IDurable node) { if (frame is EventFrame) { if (SourceFrame == frame) { return; } SourceFrame = frame; SamplingFrame samplingFrame = frame.Group.CreateSamplingFrame((frame as EventFrame).RootEntry.Description, CallstackType); base.SetFrame(samplingFrame, null); } else { base.SetFrame(frame, null); } }
private void SampleFunction(EventFrame eventFrame, EventNode node, bool single) { List <Callstack> callstacks = new List <Callstack>(); FrameGroup group = eventFrame.Group; if (single) { Utils.ForEachInsideIntervalStrict(group.Threads[eventFrame.Header.ThreadIndex].Callstacks, node.Entry, callstack => callstacks.Add(callstack)); } else { EventDescription desc = node.Entry.Description; foreach (ThreadData thread in group.Threads) { HashSet <Callstack> accumulator = new HashSet <Callstack>(); foreach (EventFrame currentFrame in thread.Events) { List <Entry> entries = null; if (currentFrame.ShortBoard.TryGetValue(desc, out entries)) { foreach (Entry entry in entries) { Utils.ForEachInsideIntervalStrict(thread.Callstacks, entry, c => accumulator.Add(c)); } } } callstacks.AddRange(accumulator); } } if (callstacks.Count > 0) { SamplingFrame frame = new SamplingFrame(callstacks); Profiler.TimeLine.FocusFrameEventArgs args = new Profiler.TimeLine.FocusFrameEventArgs(Profiler.TimeLine.FocusFrameEvent, frame); RaiseEvent(args); } }
void InitThreadList(SamplingFrame frame) { Frame = frame; List <ThreadRow> rows = new List <ThreadRow>(); if (frame != null) { List <Entry> entries = new List <Entry>(); SamplingNode root = frame.Root; BuildEntryList(entries, root, 0.0); EventFrame eventFrame = new EventFrame(new FrameHeader() { Start = 0, Finish = Durable.MsToTick(root.Duration) }, entries, frame.Group); ThreadData threadData = new ThreadData(null) { Events = new List <EventFrame> { eventFrame } }; EventsThreadRow row = new EventsThreadRow(frame.Group, new ThreadDescription() { Name = "Sampling Node" }, threadData, Settings); row.LimitMaxDepth = false; row.EventNodeHover += Row_EventNodeHover; rows.Add(row); ThreadViewControl.Scroll.ViewUnit.Width = 1.0; ThreadViewControl.InitRows(rows, eventFrame.Header); } else { ThreadViewControl.InitRows(rows, null); } }
private void VM_OnLoaded(SamplingFrame frame) { SetFrame(frame, null); }
private void VM_OnLoaded(SamplingFrame frame) { InitThreadList(frame); }