public TimelinePanel(IActiveSession session) { _session = session; session.PropertyChanged += SessionOnPropertyChanged; CpuUtilizationSource = new AppCpuTimelineChartModel(); CpuUtilizationSource.SetContent(session.SessionModel.GetApplicationCpuUtilization(), session.SessionModel.CpuCoreCount); Threads = session.SessionModel.Threads .Select <ISessionThread, IThreadListItem>(thread => new ThreadListItem(thread, session, CpuUtilizationSource) { IsSelected = thread.InternalId == 0 }).ToList(); DataContext = this; InitializeComponent(); CpuChart.SelectionChanged += delegate(object sender, EventArgs e) { if (sender is AppCpuTimelineChart chart) { ulong from = 0; ulong to = ulong.MaxValue; if (chart.SelectionEndSeconds - chart.SelectionStartSeconds > 0) { from = (ulong)Math.Round(chart.SelectionStartSeconds * 1000); to = (ulong)Math.Round(chart.SelectionEndSeconds * 1000); } session.UpdateDataForTimeFrame(new SelectedTimeFrame { Start = from, End = to }); } }; }
public SummaryPanel(IActiveSession session) { _activeSession = session; InitializeComponent(); InitProcTimeline(); SetTopMethodsData(); }
public CallStackPanel(IActiveSession activeSession) { _activeSession = activeSession; activeSession.PropertyChanged += ActiveSession_PropertyChanged; DataContext = this; InitializeComponent(); CreateControls(); UpdateControls(activeSession, true); }
public ThreadListItem(ISessionThread sessionThread, IActiveSession parent, AppCpuTimelineChartModel applicationChartModel) { _sessionThread = sessionThread; _parent = parent; AppCpuTimelineChartModel = applicationChartModel; CpuUtilization = new ThreadCpuTimelineChartModel(applicationChartModel); CpuUtilization.SetContent(_sessionThread.CpuUtilization); JitJobsSource = new ThreadClrJobTimelineChartModel(applicationChartModel); JitJobsSource.SetContent(_sessionThread.ClrJobs, ClrJobType.JustInTimeCompilation); GcJobsSource = new ThreadClrJobTimelineChartModel(applicationChartModel); GcJobsSource.SetContent(_sessionThread.ClrJobs, ClrJobType.GarbageCollection); }
public void SetActiveSession(IActiveSession session) { var filters = new FilterPanel(session); Children.Add(filters); Grid.SetRow(filters, 0); Grid.SetColumn(filters, 0); var timeline = new TimelinePanel(session); RightGrid.Children.Add(timeline); Grid.SetRow(timeline, 0); Grid.SetColumn(timeline, 0); var callStack = new CallStackPanel(session); RightGrid.Children.Add(callStack); Grid.SetRow(callStack, 0); Grid.SetColumn(callStack, 2); }
public FilterPanel(IActiveSession activeSession) { _activeSession = activeSession; InitializeComponent(); InitializeButtons(); }
public void SetActiveSession(IActiveSession session) { _activeSession = session; Caption = session.Label; _content.SetActiveSession(session); }
private void UpdateControls(IActiveSession activeSession, bool updateTreeInput) { ListsGrid1.RowDefinitions.Clear(); ListsGrid1.Children.Clear(); var row = 0; var methods = activeSession.SessionModel.GetTopMethods(activeSession.CurrentThreadId, activeSession.StatisticsType); if (methods.Methods.Count > 0) { ListsGrid1.RowDefinitions.Add(new RowDefinition { Height = new GridLength(1, GridUnitType.Star) }); _topMethods.SetInputSource(methods); ListsGrid1.Children.Add(_topMethods); Grid.SetRow(_topMethods, row++); Grid.SetColumn(_topMethods, 0); ListsGrid1.RowDefinitions.Add(new RowDefinition { Height = GridLength.Auto }); var splitter = new GridSplitter { Height = 5, HorizontalAlignment = HorizontalAlignment.Stretch, VerticalAlignment = VerticalAlignment.Center, }; ListsGrid1.Children.Add(splitter); Grid.SetRow(splitter, row++); Grid.SetColumn(splitter, 0); Grid.SetColumn(splitter, 0); } ListsGrid1.RowDefinitions.Add(new RowDefinition { Height = new GridLength(1, GridUnitType.Star) }); ListsGrid1.Children.Add(_callTree); Grid.SetRow(_callTree, row); Grid.SetColumn(_callTree, 0); if (updateTreeInput) { _callTree.SetItemsSource(activeSession.SessionModel.GetCallTree(activeSession.CurrentThreadId), activeSession.StatisticsType); } else { _callTree.StatisticsType = activeSession.StatisticsType; } ListsGrid2.RowDefinitions.Clear(); ListsGrid2.Children.Clear(); row = 0; var paths = activeSession.SessionModel.GetHotPathes(activeSession.CurrentThreadId, activeSession.StatisticsType); if (paths.Methods.Count > 0) { ListsGrid2.RowDefinitions.Add(new RowDefinition { Height = new GridLength(1, GridUnitType.Star) }); _hotPathes.SetItemsSource(paths); ListsGrid2.Children.Add(_hotPathes); Grid.SetRow(_hotPathes, row); Grid.SetColumn(_hotPathes, 0); } _sourceLines = activeSession.SessionModel.GetTopLines(activeSession.CurrentThreadId, activeSession.StatisticsType); TopLines.SetItemsSource(_sourceLines); }