internal void SetData(ProcessMemoryInfo heapInfo) { m_heapInfo = heapInfo; m_issues = m_heapInfo.GetIssues(); m_grid.ItemsSource = m_issues; }
internal void SetData(ProcessMemoryInfo heapInfo) { m_heapInfo = heapInfo; m_diagramT0 = m_heapInfo.FirstEventTime; m_diagramT1 = m_heapInfo.LastEventTime; RedrawDiagram(); m_metrics = m_heapInfo.GetMetrics(); m_metricGrid.ItemsSource = m_metrics; m_allowResize = true; }
internal void SetData(ProcessMemoryInfo heapInfo) { m_heapInfo = heapInfo; IEnumerable <ThreadMemoryInfo> threads = m_heapInfo.Threads.Values; // Sort threads by name(type) and then CPU sample // .Net GC threads // .Net Finalizer threads // .Net BGC threads // .Net threads // Native threads m_threads = threads.OrderBy(e => e, new ThreadMemoryInfoComparer()).ToList(); m_grid.ItemsSource = m_threads; }
internal ThreadMemoryInfo(ProcessMemoryInfo proc, int threadID) { m_process = proc; m_threadID = threadID; }
void LaunchViewer(List <IProcess> selectedProcesses) { // Single process only if (selectedProcesses != null && selectedProcesses.Count != 1) { return; } IProcess proc = selectedProcesses[0]; int procID = proc.ProcessID; // Create the application's main window m_mainWindow = new Window(); m_mainWindow.Title = String.Format(FullTitle, proc.Name, procID); // HelpBox m_helpBox = new TextBox(); m_helpBox.TextWrapping = TextWrapping.Wrap; m_helpBox.Foreground = Brushes.Blue; m_statusBar = new StatusBar(); m_statusBar.Height = 24; // GCInfoView Panel GcInfoView gcinfo = new GcInfoView(); // Grid for 5 panels with adjustable heights Grid grid = new Grid(); m_gcInfoPanel = new GridRow(grid, gcinfo.CreateGCInfoPanel(m_helpBox).Wrap(GCEventPanelName), true, true, 0, 111); // HeapTickView Panel HeapAllocView heapAlloc = new HeapAllocView(); m_heapAllocPanel = new GridRow(grid, heapAlloc.CreateHeapAllocPanel(m_traceLog).Wrap(AllocTickPanelName), false, true, 1, 111); // Thread Panel ThreadView threadView = new ThreadView(); m_threadPanel = new GridRow(grid, threadView.CreateThreadViewPanel().Wrap(ThreadPanelName), false, true, 2, 111); // Issue Panel IssueView issue = new IssueView(); m_issuePanel = new GridRow(grid, issue.CreateIssuePanel(m_helpBox).Wrap(IssuePanelName), false, true, 3, 111); // HeapDiagram Panel HeapDiagram diagram = new HeapDiagram(m_dataFile, m_statusBar, m_mainWindow); m_heapDiagramPanel = new GridRow(grid, diagram.CreateHeapDiagramPanel(m_helpBox).Wrap(HeapDiagramPanelName), true, false, 4, 111); DockPanel main = new DockPanel(); main.DockBottom(m_statusBar); main.DockTop(CreateMainMenu()); main.DockBottom(grid); m_mainWindow.Content = main; m_mainWindow.Closed += CloseMainWindow; m_mainWindow.Show(); // Load events for the process m_heapInfo = new ProcessMemoryInfo(m_traceLog, m_dataFile, m_statusBar); m_statusBar.StartWork(String.Format("Loading events for process {0} (pid={1})", proc.Name, procID), delegate() { m_heapInfo.LoadEvents(procID, (int)m_traceLog.SampleProfileInterval.Ticks); m_statusBar.EndWork(delegate() { gcinfo.SetGCEvents(m_heapInfo.GcEvents); heapAlloc.SetAllocEvents(m_heapInfo.m_allocSites); threadView.SetData(m_heapInfo); diagram.SetData(m_heapInfo); issue.SetData(m_heapInfo); }); }); }